{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"redocly_category":"Products","product_name":"Integration Hub","type":"markdown"},"seo":{"title":"About the TD JavaScript SDK Version 3.0","description":"Learn how to implement TD JavaScript SDK v3.0 for secure, real-time website user tracking and first-party cookie management across platforms.","siteUrl":"https://docs.treasure.ai","lang":"en-US","jsonLd":{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://www.treasure.ai/","name":"Treasure AI","url":"https://www.treasure.ai/","logo":"https://www.treasure.ai/hubfs/assets/images/logos/primary-logo.svg"},{"@type":"WebSite","@id":"https://docs.treasure.ai/#website","name":"Treasure AI Documentation","url":"https://docs.treasure.ai/","inLanguage":["en","ja"],"publisher":{"@id":"https://www.treasure.ai/"}}]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"about-the-td-javascript-sdk-version-30","__idx":0},"children":["About the TD JavaScript SDK Version 3.0"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["TD JavaScript SDK (TD JS SDK) allows Treasure Data to store first-party cookies on your domain’s website and to track your website’s users across the other platforms and collect information. By using the TD JS SDK, you don’t have to install anything server-side to track website activities."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["TD JS SDK version 3 provides security and reliability for real-time use cases and is based on the Fetch API, which eliminates JSONP API of TD JS SDK v2."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["In order to upgrade to v3.0, replace the existing JS SDK v2.5 code snippet with:"]},{"$$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=[\"addRecord\",\"blockEvents\",\"fetchServerCookie\",\"fetchGlobalID\",\"fetchUserSegments\",\"resetUUID\",\"ready\",\"setSignedMode\",\"setAnonymousMode\",\"set\",\"trackEvent\",\"trackPageview\",\"trackClicks\",\"unblockEvents\"],s=0;s<r.length;s++){var c=r[s];e[t].prototype[c]=function(t){return function(){return this[\"_\"+t]=this[\"_\"+t]||[],this[\"_\"+t].push(Array.prototype.slice.call(arguments)),this}}(c)}var n=document.createElement(\"script\");n.type=\"text/javascript\",n.async=!0,n.src=(\"https:\"===document.location.protocol?\"https:\":\"http:\")+\"//cdn.treasuredata.com/sdk/3.0/td.min.js\";var o=document.getElementsByTagName(\"script\")[0];o.parentNode.insertBefore(n,o)}}(\"Treasure\",this);\n</script>  \n","lang":"html"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Learn more about:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/customer-data-platform/integration-hub/streaming/td-javascript-sdk/about-javascript-sdk-version-3-1"},"children":["About JavaScript SDK version 3.1"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/customer-data-platform/integration-hub/streaming/td-javascript-sdk/treasure-data-javascript-sdk-version-3-migration"},"children":["Treasure Data JavaScript SDK Version 3 Migration"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/customer-data-platform/integration-hub/streaming/td-javascript-sdk/treasure-data-javascript-sdk-version-3-0-default-log-parameters"},"children":["Treasure Data JavaScript SDK Version 3.0 Default Log Parameters"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/customer-data-platform/integration-hub/streaming/td-javascript-sdk/treasure-data-javascript-sdk-version-2-5-0-version-update-summaries"},"children":["Treasure Data JavaScript SDK Version 2.5.0 Version Update Summaries"]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Additional information on setting up and configuring TD JS SDK v. 3 is available on ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://github.com/treasure-data/td-js-sdk/tree/3.0.0"},"children":["GitHub"]},"."]}]},"headings":[{"value":"About the TD JavaScript SDK Version 3.0","id":"about-the-td-javascript-sdk-version-30","depth":1}],"frontmatter":{"seo":{"title":"About the TD JavaScript SDK Version 3.0","description":"Learn how to implement TD JavaScript SDK v3.0 for secure, real-time website user tracking and first-party cookie management across platforms."}},"lastModified":"2026-06-17T07:22:53.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/products/customer-data-platform/integration-hub/streaming/td-javascript-sdk/about-the-td-javascript-sdk-version-3-0","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}