{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"redocly_category":"Products","product_name":"Integration Hub","type":"markdown"},"seo":{"title":"Retargeting Unknown Visitors With Google Display Video 360","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":"retargeting-unknown-visitors-with-google-display-video-360","__idx":0},"children":["Retargeting Unknown Visitors With Google Display Video 360"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Cookie Sync is a common technique for retargeting unknown visitors via the Ads platform. This document describes how Cookie Sync works between Treasure Data and Google Display & Video 360 (Google DV360).",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},"Since 2021, Google has required customers to store the mapping/syncing of a td_global_id to Google's cookie ID in Google DV360. You'll use Treasure Data JavaScript SDK to upload a synced Treasure Data's td_global_id with Google Cookie to your Treasure account."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Example"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["A website visitor is assigned td_global_id ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["123"]}," on a customer's website, while the visitor is also assigned a Google cookie ID ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["ABC"]},". The CDP must inform Google that Google's ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["ABC"]}," and TD's ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["123"]}," are the same visitor."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This topic contains:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#implementing-the-synchronization-process"},"children":["Implementing the Synchronization Process"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#synchronization-endpoint-sample"},"children":["Synchronization Endpoint Sample"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#set-up-segmentation"},"children":["Set up Segmentation"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#set-up-google-display--video-360-authentication"},"children":["Set up Google Display & Video 360 Authentication"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#set-up-activation"},"children":["Set up Activation"]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"implementing-the-synchronization-process","__idx":1},"children":["Implementing the Synchronization Process"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/overview.69605299a336eb7722a74f0b4565a62113188b02b49d6fe4a2f1c17844974216.ad50cbca.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"synchronization-endpoint-sample","__idx":2},"children":["Synchronization Endpoint Sample"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Prepare the synchronization endpoint using TD JS SDK and populate the correct URL values."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["https://cm.g.doubleclick.net/pixel?google_nid=treasuredata_dmp&google_hm=NThkOTVmNDAtMzAyOS00Y2FkLWIxYWQtM2ZlYWVmNzE5Njhk"]}]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["google_nid: 'treasuredata_dmp'"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["google_hm: base64-encoded td_global_id value"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Ref. ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://developers.google.com/authorized-buyers/rtb/cookie-guide"},"children":["https://developers.google.com/authorized-buyers/rtb/cookie-guide"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Prepare a pixel tag to track the td_global_id with Google Cookie"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The following code includes a sample tag for synchronizing and tracking the td_global_id with Google Cookie via pixel tag."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"html","header":{"controls":{"copy":{}}},"source":"<script type=\"text/javascript\">\n!function(t,e){if(void 0===e[t]){e[t]=function(){e[t].clients.push(this),this._init=[Array.prototype.slice.call(arguments)]},e[t].clients=[];for(var r=function(t){returnfunction(){return this[\"_\"+t]=this[\"_\"+t]||[],this[\"_\"+t].push(Array.prototype.slice.call(arguments)),this}},s=[\"blockEvents\",\"unblockEvents\",\"setSignedMode\",\"setAnonymousMode\",\"fetchUserSegments\",\"resetUUID\",\"fetchServerCookie\",\"addRecord\",\"fetchGlobalID\",\"set\",\"trackEvent\",\"trackPageview\",\"trackClicks\",\"ready\"],n=0;n<s.length;n++){var c=s[n];e[t].prototype[c]=r(c)}var o=document.createElement(\"script\");o.type=\"text/javascript\",o.async=!0,o.src=(\"https:\"===document.location.protocol?\"https:\":\"http:\")+\"//cdn.treasuredata.com/sdk/3.0/td.min.js\";var a=document.getElementsByTagName(\"script\")[0];a.parentNode.insertBefore(o,a)}}(\"Treasure\",this);\n    \n// Generate a pixel tag for Cookie Sync\nfunction googleSyncCallback() {\n  td.fetchGlobalID(\n    function(global_id) {\n    \tvar gidsync_url = 'https://cm.g.doubleclick.net/pixel?';\n    \tvar params = [\n    \t\t'google_nid=treasuredata_dmp',\n    \t\t'google_hm=' + btoa(global_id)\n    \t];\n    \tvar img = new Image();\n    \timg.src = gidsync_url + params.join('&');\n    \tdocument.body.appendChild(img)\n      }\n    );\n  }\n    \n  // Generate a general tracking tag\n  var td = new Treasure({\n    host: 'in.treasuredata.com',\n    writeKey: '<YOUR WRITE ONLY KEY>',\n    database: '<Your target Database>',\n    startInSignedMode: true\n  });\n  var tbl = 'cookie_sync_table';\n  td.set('$global', 'td_global_id', 'td_global_id');\n    \n  // Syncted google_hm and td_global_id require to be a same value.\n  td.trackPageview(tbl, googleSyncCallback);\n</script>  \n","lang":"html"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"set-up-segmentation","__idx":3},"children":["Set up Segmentation"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/customer-data-platform/audience-studio/segment/segments-overview"},"children":["Set up segments"]}," in TD Audience Studio to support your requirements."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"set-up-google-display--video-360-authentication","__idx":4},"children":["Set up Google Display & Video 360 Authentication"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You can authenticate Google Display & Video 360 Authentication by Google Partner ID or Google Advertiser ID. These are related but not identical concepts:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Google Partner ID is for the enterprise customer of the DV360 platform."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Google Advertiser ID is for a particular brand."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/info.aa88698bdb590fb167080bc7bc900e461aa937f4b3774de0759e678e7a8aab37.ad50cbca.png","alt":"Information"},"children":[]}," | Different outside ad agencies might manage the marketing and ads if a customer has multiple brands. So each brand may have a unique advertiser ID assigned, while the customer has a single Partner ID."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["---|---"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"set-up-activation","__idx":5},"children":["Set up Activation"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Set up your activation as follows."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image2023-5-22_15-8-33.a95b103d9914ec9b47a92983706e0c43ee559800843036abf60453e6a10c6487.ad50cbca.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Field"},"children":["Field"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Values"},"children":["Values"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Source column name mappings"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["cookie: cookie,list_name:list_name"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The left side of the colon is Google's expected attribute, for example, cookie: or list_name:"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The right side of the colon is the designated attribute name in the Activation. The value names are arbitrary."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image2023-5-22_15-55-12.029a9002378a024dea0f633690807c41d1b10d5bff9659f10227b6834a50a620.ad50cbca.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Field| Values| Description|",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},"---|---|---|---",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},"Column Mapping| Source: td_global_id",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},"Output Column Name: cookie| The value is the data point that should be used as the cookie."]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":""},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/info.aa88698bdb590fb167080bc7bc900e461aa937f4b3774de0759e678e7a8aab37.ad50cbca.png","alt":"Information"},"children":[]}]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"The Output Column Name displays on the Details tab."},"children":["The Output Column Name displays on the Details tab."]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["String Builder| String: xxx_DV360_Test_v2",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},"Output Column Name: list_name|  |  ",{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/info.aa88698bdb590fb167080bc7bc900e461aa937f4b3774de0759e678e7a8aab37.ad50cbca.png","alt":"Information"},"children":[]}," |  The Output Column Name displays on the Details tab.",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},"---|---"]}]},"headings":[{"value":"Retargeting Unknown Visitors With Google Display Video 360","id":"retargeting-unknown-visitors-with-google-display-video-360","depth":1},{"value":"Implementing the Synchronization Process","id":"implementing-the-synchronization-process","depth":1},{"value":"Synchronization Endpoint Sample","id":"synchronization-endpoint-sample","depth":2},{"value":"Set up Segmentation","id":"set-up-segmentation","depth":2},{"value":"Set up Google Display & Video 360 Authentication","id":"set-up-google-display--video-360-authentication","depth":2},{"value":"Set up Activation","id":"set-up-activation","depth":2}],"frontmatter":{"seo":{"title":"Retargeting Unknown Visitors With Google Display Video 360"}},"lastModified":"2026-06-01T09:09:59.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/products/customer-data-platform/integration-hub/streaming/td-javascript-sdk/retargeting-unknown-visitors-with-google-display-video-360","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}