{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"redocly_category":"Products","product_name":"Integration Hub","type":"markdown"},"seo":{"title":"About Migrating to TD JavaScript SDK Version 4.2.1","description":"Step-by-step migration guide for TD JavaScript SDK v4.2.1, covering new ingest endpoints, changes in web tracking, user agent modifications, and key migration considerations for developers.","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/"}}]},"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":"about-migrating-to-td-javascript-sdk-version-421","__idx":0},"children":["About Migrating to TD JavaScript SDK Version 4.2.1"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This article describes how to migrate v2 or v3 web tracking modules to v4."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"whats-new-in-td-javascript-sdk-40","__idx":1},"children":["What's new in TD JavaScript SDK 4.0"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The following changes have been made to td-js-sdk v4:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["The SDK now uses the new \"records.in\" ingest base URL. For example, US developers will configure the ingest endpoint to \"https://us01.records.in.treasuredata.com\". (For a list of new ingest endpoints by region, see ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/apis/endpoints/endpoints"},"children":["Treasure Data Sites and baseURLs"]},".)"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["The SDK no longer populates these values:",{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["td_browser"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["td_browser_version"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["td_os"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["td_os_version"]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["These values can be obtained by parsing td_user_agent with the Hive or Presto function ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/customer-data-platform/data-workbench/queries/sql-reference/td_hive_function_reference"},"children":["TD_PARSE_USER_AGENT"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The JS SDK version string will be added to the td_user_agent property for metric tracking and tracing. For example, JSSDK/4.0.1 will be added for the following browsers:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["AppleWebKit/537.36 (KHTML, like Gecko)"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Chrome/116.0.0.0"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Safari/537.36"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"limitations","__idx":2},"children":["Limitations"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Using Real-time segmentation requires routing enablement from the back end. Contact Treasure Support for assistance in enabling JS SDK 4.x for real-time processing. Be prepared to provide the following information to Treasure Support:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Account number"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Database name"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Table name"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Treasure Data anticipates removing this limitation in a future release."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For instructions on migrating to version 4.x see ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/customer-data-platform/integration-hub/streaming/td-javascript-sdk/migrating-to-td-js-sdk-4-0"},"children":["Migrating to TD JS SDK 4.0"]},"."]}]},"headings":[{"value":"About Migrating to TD JavaScript SDK Version 4.2.1","id":"about-migrating-to-td-javascript-sdk-version-421","depth":1},{"value":"What's new in TD JavaScript SDK 4.0","id":"whats-new-in-td-javascript-sdk-40","depth":2},{"value":"Limitations","id":"limitations","depth":2}],"frontmatter":{"seo":{"title":"About Migrating to TD JavaScript SDK Version 4.2.1","description":"Step-by-step migration guide for TD JavaScript SDK v4.2.1, covering new ingest endpoints, changes in web tracking, user agent modifications, and key migration considerations for developers."}},"lastModified":"2026-06-17T07:22:53.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/products/customer-data-platform/integration-hub/streaming/td-javascript-sdk/about-migrating-to-td-javascript-sdk-version-4-2-1","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}