{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"redocly_category":"Products","product_name":"Audience Studio","type":"markdown"},"seo":{"title":"Use the Profiles API With Google DFP Doubleclick for Publishers","description":"Treasure Data Product Documentation · Collect and Unify · Segment and Activate · Experiment and Analyze · Decisioning Automate with AI Scale and Trust.","siteUrl":"https://docs.treasuredata.com","lang":"en-US","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"use-the-profiles-api-with-google-dfp-doubleclick-for-publishers","__idx":0},"children":["Use the Profiles API With Google DFP Doubleclick for Publishers"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You can integrate Treasure Data’s Profiles API Token with Google DFP (DoubleClick for Publishers). This integration allows advertisers to put ads on the segments you have defined in Treasure Data."]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/customer-data-platform/audience-studio/profiles/use-the-profiles-api-with-google-dfp-doubleclick-for-publishers#prerequisites"},"children":["Prerequisites"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/customer-data-platform/audience-studio/profiles/use-the-profiles-api-with-google-dfp-doubleclick-for-publishers#create-the-profiles-api-token"},"children":["Create the Profiles API Token"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/customer-data-platform/audience-studio/profiles/use-the-profiles-api-with-google-dfp-doubleclick-for-publishers#name-your-new-token"},"children":["Name Your New Token"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/customer-data-platform/audience-studio/profiles/use-the-profiles-api-with-google-dfp-doubleclick-for-publishers#configure-the-token"},"children":["Configure the Token"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/customer-data-platform/audience-studio/profiles/use-the-profiles-api-with-google-dfp-doubleclick-for-publishers#add-segments-to-the-token"},"children":["Add Segments to the Token"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/customer-data-platform/audience-studio/profiles/use-the-profiles-api-with-google-dfp-doubleclick-for-publishers#integrating-the-profiles-api-token-with-google-dfp"},"children":["Integrating the Profiles API Token with Google DFP"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/customer-data-platform/audience-studio/profiles/use-the-profiles-api-with-google-dfp-doubleclick-for-publishers#configure-google-dfp-for-use-with-the-profiles-api-token"},"children":["Configure Google DFP for use with the Profiles API Token"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/customer-data-platform/audience-studio/profiles/use-the-profiles-api-with-google-dfp-doubleclick-for-publishers#create-javascript-dfp-and-treasure-data-tags"},"children":["Create JavaScript DFP and Treasure Data Tags"]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"prerequisites","__idx":1},"children":["Prerequisites"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Basic knowledge of JavaScript and HTML"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Basic knowledge of Treasure Data"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Basic knowledge of Treasure Data JavaScript SDK"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Basic knowledge of Treasure Data Profiles API Token"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Basic knowledge of Google DFP (DoubleClick for Publishers)"]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"create-the-profiles-api-token","__idx":2},"children":["Create the Profiles API Token"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"name-your-new-token","__idx":3},"children":["Name Your New Token"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Open Treasure Console."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Navigate to Audience Studio and select a segment."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Select a folder."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Select Create New."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Select Profiles API Token."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/profileapitoken.bea076622b597c1a6dceff6cf17281c185891e4c46a25d693ec373a3e691613c.cf3845cb.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Enter a name for your token and optionally enter a description. Select Next."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"configure-the-token","__idx":4},"children":["Configure the Token"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The name and description carry over from when you named the token. You can make changes."]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Enter a ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Lookup Key"]},"."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["A Lookup Key is a column with a unique value inside the Parent Segment. This lookup key identifies the correct profile."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/note.767ca0ca6d076817a978148fbb7dd2a68ca7d067ced0ff61bfb3be582d0426d9.cf3845cb.png","alt":"Note"},"children":[]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Note:"]}," The lookup key update will take effect once the token workflow finishes."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["When using ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["td_global_id"]}," as the lookup key, the Profiles API retrieves the lookup value from the browser cookie instead of the API request's query param. For testing or verification purposes outside of a browser (eg, Postman), use a different column to pass in the lookup value manually."]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["(Optional) Enter a maximum of five Attributes.",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},"Profile attributes can be returned from the profile token when queried"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Choose one of the following:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Select Next to continue and add Segments."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Select Create to configure the token. (You can add segments later if you want.)"]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"add-segments-to-the-token","__idx":5},"children":["Add Segments to the Token"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Choose one of the following:"]}]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["After you configure your token, select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Next"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Navigate to Audience Studio > Folder > Profiles API Token."]}]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Add Segments to your Profiles API Token."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Save"]},"."]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"integrating-the-profiles-api-token-with-google-dfp","__idx":6},"children":["Integrating the Profiles API Token with Google DFP"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Complete the steps in the following sections to integrate the Profiles API Token with Google DFP:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/customer-data-platform/audience-studio/profiles/use-the-profiles-api-with-google-dfp-doubleclick-for-publishers#h1_1644201065"},"children":["Prerequisites"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/customer-data-platform/audience-studio/profiles/use-the-profiles-api-with-google-dfp-doubleclick-for-publishers#h1__441927612"},"children":["Create the Profiles API Token"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/customer-data-platform/audience-studio/profiles/use-the-profiles-api-with-google-dfp-doubleclick-for-publishers#UsetheProfilesAPIwithGoogleDFPDoubleClickforPublishers-NameYourNewToken"},"children":["Name Your New Token"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/customer-data-platform/audience-studio/profiles/use-the-profiles-api-with-google-dfp-doubleclick-for-publishers#UsetheProfilesAPIwithGoogleDFPDoubleClickforPublishers-ConfiguretheToken"},"children":["Configure the Token"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/customer-data-platform/audience-studio/profiles/use-the-profiles-api-with-google-dfp-doubleclick-for-publishers#UsetheProfilesAPIwithGoogleDFPDoubleClickforPublishers-AddSegmentstotheToken"},"children":["Add Segments to the Token"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/customer-data-platform/audience-studio/profiles/use-the-profiles-api-with-google-dfp-doubleclick-for-publishers#h1__115221623"},"children":["Integrating the Profiles API Token with Google DFP"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/customer-data-platform/audience-studio/profiles/use-the-profiles-api-with-google-dfp-doubleclick-for-publishers#h2__631907321"},"children":["Configure Google DFP for use with the Profiles API Token"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/customer-data-platform/audience-studio/profiles/use-the-profiles-api-with-google-dfp-doubleclick-for-publishers#h2_1416520366"},"children":["Create JavaScript DFP and Treasure Data Tags"]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"configure-google-dfp-for-use-with-the-profiles-api-token","__idx":7},"children":["Configure Google DFP for use with the Profiles API Token"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["In your web browser, navigate to Google DFP."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Navigate to ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Inventory"]}," >",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Key-values"]},"."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image-20190817-005708.9caf71ecf421c74fe5ce429e2d969ff9de4c37c2c0936972a00f69651f6be527.cf3845cb.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Select New Key."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Complete the Name and Display name fields."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image-20190817-005818.47386a6b5f18be7aba01eaa7dfd69765c3c421ea75e84a5e2004e5debc278637.cf3845cb.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Select Add Values."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["List all Treasure Data segment IDs, line-by-line. For example, 257, 258, 259."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image-20190817-005915.1e9c6c7dbf16602d95d6248f7891e7a0d52ea4ab6d3a656320430d6d7c29491f.cf3845cb.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Select Apply."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Optionally, add Display name to specific segment IDs."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image-20190817-010000.34f47caab6ff96b4c23acceef14349d2b83dc28c006960bc2d3ed585735e4263.cf3845cb.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Inventory"]}," > ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Ad units"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Select Ad Unit."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Complete the Code and Name fields."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image-20190817-010148.7813a892ab085eda685d31b6eaa986e2ee70563add103d2af256a5d16ed7a925.cf3845cb.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"ol","attributes":{"start":12},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Select Save."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Select Delivery > Orders."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Select New Order to create a new order."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image-20190817-010418.dd6184319971de6160b9f1bd3e1a172f8481832223dc44d1d1f46ccfb0023363.cf3845cb.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Edit the fields. For example, Name, Advertiser, Start time, End time, Quantity, and Rate."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image-20190817-010509.30703d5f0a3c29b020335f94a845d2c7aee61202cda51e19a85543b2a6fbff52.cf3845cb.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Scroll down to locate the Key-values section."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Specify the Key-value that you created. For example, td_kv_wp."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image-20190817-010551.c63e2dc0750e6c64133a436e5f7398a84b706d9596adaf3102b12ecc815f98c6.cf3845cb.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Select the list of Segment IDS that you created. For example:"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image-20190817-010637.6b9f71e14a56400e8a4479389b1823ab6cc45a0934af15b6c4d0d4a4d9672c8e.cf3845cb.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Select Inventory."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Select the advertisement unit that you created. For example, td-dfp-test-ad. An order object is created. For example:"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image-20190817-010727.db4a563ca99cc444be07e8ec62ba752f631472c9610bc84c5f5661e4ec0f0557.cf3845cb.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Navigate to Delivery > Line items to register the creatives."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Select Add Creatives."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image-20190817-010829.2bd49e3936f50d4b9779bbe0bdfbded30e260a0c94484b7a818d0e11fcb415a7.cf3845cb.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Select the creative type you'd like to create. For example, an image creative."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image-20190817-010915.c175a1bf871cd9d93255f50dfeb722878c4814b4ae105dff5635d1e8d226affa.cf3845cb.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Specify the Name and Destination."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Upload an image file for the creative."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Specify a Destination. For example, https://www.treasuredata.com/."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image-20191204-022437.44adf1069dd7bbe5307f06fc5bff8d42bc39dbdf04d6425bff485a8806ba0096.cf3845cb.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"create-javascript-dfp-and-treasure-data-tags","__idx":8},"children":["Create JavaScript DFP and Treasure Data Tags"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To generate Google DFP’s JavaScript tag:"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["In your web browser, navigate to Google DFP."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Navigate to Inventory > Ad units."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Select Generate Tags."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Select the advertising units that you created. For example, td-dfp-test-ad."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image-20190817-011046.27d2ee6034adbc0fd6bde98673dafa8f18413424e92946eb779581b9140b2809.cf3845cb.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Select the Google Publisher Tag as the Tag Type."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image-20190817-011142.727e1f8bc6d676624dc1e1d465236ca05364172fc0d14b1be75266b4de9bb595.cf3845cb.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Select Continue. A JavaScript tag is generated for the HTML header and body."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image-20191209-221112.81199d3a270674952c0267b946f3465606f1541dc2e8efbb7b6efd2f6db374b4.cf3845cb.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Save your work."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["To combine the DFP tag and your Treasure Data JavaScript tag:"]}]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Open the file where you want to combine your Treasure Data JavaScript and DFP tags."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Call googletag.pubads().setTargeting() function to pass Treasure Data’s segment IDs to Google DFP."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For example, the following HTML contains the integration code between DFP JavaScript Tag and TD JavaScript Tag."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"html","header":{"controls":{"copy":{}}},"source":"<!-- Header Script Tag: Start-->\n<script>\nvar googletag = googletag || {};\ngoogletag.cmd = googletag.cmd || [];\n\nvar td = new Treasure({...})\nvar successCallback = function (values) {\n  var segIdAll = [];\n  for (var i = 0; i < values.length; i++) {\n    segIdAll = segIdAll.concat(values[i].values);\n  };\n  var segId = segIdAll.filter(function (x,i,self) {return self.indexOf(x) === i;});\n  console.log(JSON.stringify(segId));\n  googletag.cmd.push(function() {\n    googletag.defineSlot('/YOUR_NUMBER_/td-dfp-test-ad', [200, 200], 'div-gpt-ad-YOUR-XYZ-0').addService(googletag.pubads());\n    googletag.pubads().enableSingleRequest();\n    googletag.pubads().setTargeting('td_kv_wp',segId);\n    googletag.enableServices();\n    googletag.cmd.push(function() { googletag.display('div-gpt-ad-XYZ-0')});\n  });\n};\nvar errorCallback = function (error) { console.log(err); };\n\ntd.fetchUserSegments({\n  audienceToken: ['YOUR_PROFILES_API_TOKEN_1', 'YOUR_PROFILES_API_TOKEN_2'],\n  keys: {\n    key_column_1: 'someValue',\n    key_column_2: 'someOtherValue',\n  }\n}, successCallback, errorCallback)\n\n</script>\n<!-- Header Script Tag: End -->\n</head>\n\n<title>Web Profiles API</title>\n<body>\n<b>Hello Treasure Data!</b>\n\n<!-- DFP Body Tag: Start -->\n<div id='div-gpt-ad-YOUR-XYZ-0' style='height:200px; width:200px;'></div>\n<!-- DFP Body Tag: End -->\n\n</body>\n</html>\n","lang":"html"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To test, access the HTML above, and review the result."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image-20191204-022522.638a506e9fb9031144c9f8d5ceeb325c05a08c460d82e5b2e2b31d3e79f0afd8.cf3845cb.png","alt":""},"children":[]}]}]},"headings":[{"value":"Use the Profiles API With Google DFP Doubleclick for Publishers","id":"use-the-profiles-api-with-google-dfp-doubleclick-for-publishers","depth":1},{"value":"Prerequisites","id":"prerequisites","depth":1},{"value":"Create the Profiles API Token","id":"create-the-profiles-api-token","depth":1},{"value":"Name Your New Token","id":"name-your-new-token","depth":2},{"value":"Configure the Token","id":"configure-the-token","depth":2},{"value":"Add Segments to the Token","id":"add-segments-to-the-token","depth":2},{"value":"Integrating the Profiles API Token with Google DFP","id":"integrating-the-profiles-api-token-with-google-dfp","depth":1},{"value":"Configure Google DFP for use with the Profiles API Token","id":"configure-google-dfp-for-use-with-the-profiles-api-token","depth":2},{"value":"Create JavaScript DFP and Treasure Data Tags","id":"create-javascript-dfp-and-treasure-data-tags","depth":2}],"frontmatter":{"seo":{"title":"Use the Profiles API With Google DFP Doubleclick for Publishers"}},"lastModified":"2026-06-01T09:09:59.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/products/customer-data-platform/audience-studio/profiles/use-the-profiles-api-with-google-dfp-doubleclick-for-publishers","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}