Skip to content
Last updated

Treasure Data Javascript SDK Version 2 5 0 Version Update Summaries

TD JavaScript SDK (TD JS SDK) allows Treasure Data to store first-party cookies on your domain’s website and to then 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.

Treasure Data recommends you verify the implementation of any new features or functionality at your site using the Treasure Data JavaScript SDK version 3 before you start using it in production. It manages cookies differently. Be aware when referring to most of these articles that you need to define the suggested event collectors and Treasure Data JavaScript SDK version 3 calls in your solutions.For example, change //cdn.treasuredata.com/sdk/2.5/td.min.js to //cdn.treasuredata.com/sdk/3.0.0/td.min.js.

Learn more at Getting Started with Web Tracking and Web Tracking Using the TD JavaScript SDK Tutorial. Additional information on setting up and configuring TD JS SDK version 2.5.0 is available on GitHub.

This topic contains:

Version 2.5.0 Updates

You can also use TD SDK Consent extensions for your consent management activities, including the ability to collect consumer consent, define different categories of data use, and present consumer consent preferences in the browser, which are viewable from their browser.

Learn more about configuring your Consent Manager.

Treasure Data JavaScript SDK Version 2.5.0 Log Parameters

The TD JS SDK uses the function trackPageview to log the following parameters.

ParameterDescriptionDefault
td_versiontd-js-sdk's versionX
td_client_idclient's uuidNO
td_charsetcharacter setX
td_descriptiondescription meta tagX
td_languagebrowser languageX
td_colorscreen color depthX
td_screenscreen resolutionX
td_viewportviewport sizeX
td_titledocument titleX
td_urldocument urlX
td_user_agentbrowser user agentX
td_platformbrowser platformX
td_hostdocument hostX
td_pathdocument pathnameX
td_referrerdocument referrerX
td_iprequest IP (server)NO
td_browserclient browser (server)X
td_browser_versionclient browser version (server)X
td_osclient operating system (server)X
td_os_versionclient operating system version (server)X
td_global_id3rd party cookieNO
td_ssc_idServer Side CookieNo

The default parameters tracked do not include td_client_id , td.ip , and td_global_id to ensure compliance with global privacy laws. You can enable them by calling the td.set command.

Cookie IDs

In Treasure Data, 1st party cookies are called td_client_id, and 3rd party cookies are called td_global_id.

Version 2.4.2 Updates

Chrome and Firefox enforce a secure-by-default cookie classification system. This system treats cookies with no declared SameSite value as SameSite=Lax. Only cookies set as SameSite=None; Secure are available in third-party contexts, provided they are accessed from secure connections. Treasure Data JS SDK version 2.4.2 uses SameSite=None; Secure cookies by default to adapt the new cookie enforcement. When you upgrade TreasureData JS SDK to version 2.4.2, you must call resetUUID or fetchGlobalID for the new update to take effect.

Additionally, in version 2.4.2, the Client ID cookie is disabled in Anonymous mode. If the startInSignedMode option is false or td.setAnonymousMode() is called, the _td cookie will be disabled. This prevents _td cookie from being attached to requests when the user has opted out of device identification.