# Integrate TD Profiles API with Marketo Web Personalization You can integrate Treasure Data’s Profiles API with Marketo’s Web Personalization feature to provide fully personalized experience for your customers by leveraging all of your customer data. * [Prerequisites](/products/customer-data-platform/audience-studio/profiles/integrate-td-profiles-api-with-marketo-web-personalization#prerequisites) * [Integrating TD Profiles API with Marketo](/products/customer-data-platform/audience-studio/profiles/integrate-td-profiles-api-with-marketo-web-personalization#integrating-td-profiles-api-with-marketo) * [Configure Marketo for use with the TD Profile API](/products/customer-data-platform/audience-studio/profiles/integrate-td-profiles-api-with-marketo-web-personalization#configure-marketo-for-use-with-the-td-profile-api) * [Add a Marketo RTP Tag and Treasure Data Tag](/products/customer-data-platform/audience-studio/profiles/integrate-td-profiles-api-with-marketo-web-personalization#add-a-marketo-rtp-tag-and-treasure-data-tag) * [Examples](/products/customer-data-platform/audience-studio/profiles/integrate-td-profiles-api-with-marketo-web-personalization#examples) # Prerequisites * Basic knowledge of JavaScript and HTML * Basic knowledge of Treasure Data * Basic knowledge of Treasure Data JavaScript SDK * Basic knowledge of Treasure Data Profiles API * Basic knowledge of [Marketo Web Personalization](https://docs.marketo.com/display/public/DOCS/Understanding+Web+Personalization) * Access to Marketo’s add-on Web Personalization feature. Use of Treasure Data JavaScript SDK might require the direction of Treasure Data Support or Services team. # Integrating TD Profiles API with Marketo Complete the steps in the following sections to integrate the TD profiles API with Marketo: * Configure Marketo for use with the TD profile API * Create JavaScript DFP and Treasure Data Tags ## Configure Marketo for use with the TD Profile API 1. Open Marketo. 2. Select the Marketo icon. 3. Select Web Personalization. ![](/assets/image-20190829-000347.ffb085130c7b0a84ff1dd699dc588a7ade40a267fce6e108df1b463b48fd6409.cf3845cb.png) 1. Select Segments. ![](/assets/image-20190829-000239.99622038b8e54f1e82d7b1f7b9c32366541eb8e0fc04ebad62633d6022c68a59.cf3845cb.png) 1. Select Create New. ![](/assets/image-20190829-000032.8506b4d8da21bb63f5ec1f0efb32e8ced4217c77463ef9aa3d4e88688c391c94.cf3845cb.png) 1. Specify the segment number that you created in Treasure Data. ![](/assets/image-20190828-235909.ac60440369551b0d5812bc2ca30b343e77ceca43a3538ffcded425dfefc3c6b7.cf3845cb.png) 1. Select Save. 2. Navigate to Campaign. For example, select Marketo logo > Campaign. 3. Select Create New Web Campaign. ![](/assets/image-20190828-235832.4e81bb76dc62523e0028099ffa009770454c2198700a0a93bda456574ad588f6.cf3845cb.png) 1. Select the segment name that you created in Treasure Data. 2. Set the contents. For example, Dialog, In Zone, and Widget. ![](/assets/image-20190828-235754.08546d531bf44f2c90d77ea2575fca9128f01bcdaaa87ffb6c20842d602c2b89.cf3845cb.png) ## Add a Marketo RTP Tag and Treasure Data Tag 1. Load Market’s Web Personalization JavaScript tag into your page. See e xamples below and refer to [Marketo Documentation: Web Personalization](http://developers.marketo.com/javascript-api/web-personalization/) 2. Add a call to Treasure Data’s Profiles API. 3. Send the response to Marketo using the User Context feature of Marketo’s RTP tag.See examples below and refer to [Marketo Documentation: User Context](http://developers.marketo.com/javascript-api/web-personalization/user-context/). 4. Test your code. For example: ![](/assets/image-20191209-220910.f90bb9f2d24e925667372b768bd654cdff3f98db46dc45fdbcd9160f0e2364be.cf3845cb.png) # Examples Example code for loading Market’s Web Personalization JavaScript tag into your page: ```javascript // (function(c,h,a,f,e,i){c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)}; c[a].p=e;c[a].a=i;var g=h.createElement("script");g.async=true;g.type="text/javascript"; g.src=f;var b=h.getElementsByTagName("script")[0];b.parentNode.insertBefore(g,b)}) (window,document,"rtp","[rtp-js-cdn-url]","[pod-url]","[accountId]"); rtp('setAccount', 'YOUR_MARKETO_ACCOUNT_ID'); ``` Example code for integrating TD profiles API with Marketo web personalization ```html ```