{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-@l10n/ja/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"JavaScript SDK Version 3.1について","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":"javascript-sdk-version-31について","__idx":0},"children":["JavaScript SDK Version 3.1について"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["JavaScript SDK v3.1から、セキュリティを向上させ、ingestionのボトルネックを排除するために、新しいingestion endpointがサポートされています。この新しいendpointを使用することで、以下の拡張機能と変更が導入されます:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/ja/products/customer-data-platform/integration-hub/streaming/td-javascript-sdk/about-javascript-sdk-version-3-1#visible-changes"},"children":["表示される変更"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/ja/products/customer-data-platform/integration-hub/streaming/td-javascript-sdk/about-javascript-sdk-version-3-1#treasure-data-javascript-sdk-version-31-log-parameters"},"children":["Treasure Data JavaScript SDK Version 3.1のログパラメータ"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/ja/products/customer-data-platform/integration-hub/streaming/td-javascript-sdk/about-javascript-sdk-version-3-1#how-to-use-a-new-endpoint"},"children":["新しいendpointの使用方法"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/ja/products/customer-data-platform/integration-hub/streaming/td-javascript-sdk/about-javascript-sdk-version-3-1#faq"},"children":["FAQ"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/ja/products/customer-data-platform/integration-hub/streaming/td-javascript-sdk/about-javascript-sdk-version-3-1#limitations--changed-behavior"},"children":["制限事項と変更された動作"]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"表示される変更","__idx":1},"children":["表示される変更"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["これらの値は入力されなくなります。顧客は",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["td_user_agent"]},"からTrinoおよびHiveのTD_PARSE_AGENT関数を使用してそれらを取得する必要があります:"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["td_browser"]},": クライアントbrowser"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["td_browser_version"]},": クライアントbrowserバージョン"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["td_os"]},": クライアントoperating system"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["td_os_version"]},": クライアントoperating systemバージョン"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["注: ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["td_user_agent"]},"は、",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["navigator.userAgent"]}," APIを介してJavaScriptを使用して入力されます"]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["JSSDK/version"]},"が",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["td_user_agent"]},"プロパティの末尾に追加されます"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["すなわち、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["td_user_agent: \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36;JSSDK/3.1.1\""]}]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["新しいendpointは、requestが受信されるとAPIKEYを検証します。APIKEYが無効な場合、即座に401エラーを返します。"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["{\"code\":401,\"message\":\"Credentials are required to access this resource.\"}"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"treasure-data-javascript-sdk-version-31のログパラメータ","__idx":2},"children":["Treasure Data JavaScript SDK Version 3.1のログパラメータ"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["TD JS SDKは、trackPageview関数を使用して以下のパラメータをログに記録します。"]},{"$$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":"strong","attributes":{},"children":["パラメータ"]}]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":""},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["説明"]}]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":""},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["デフォルト"]}]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["td_version"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["td-js-sdkのバージョン"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["X"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["td_client_id"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["クライアントのuuid"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["NO"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["td_charset"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["文字セット"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["X"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["td_description"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["descriptionメタタグ"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["X"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["td_language"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["ブラウザ言語"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["X"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["td_color"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["画面のcolor depth"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["X"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["td_screen"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["画面解像度"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["X"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["td_viewport"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["viewportサイズ"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["X"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["td_title"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["ドキュメントタイトル"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["X"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["td_url"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["ドキュメントURL"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["X"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["td_user_agent"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["ブラウザuser agent"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["X"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["td_platform"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["ブラウザplatform"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["X"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["td_host"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["ドキュメントhost"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["X"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["td_path"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["ドキュメントpathname"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["X"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["td_referrer"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["ドキュメントreferrer"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["X"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["td_ip"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["リクエストIP(server)"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["NO"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["td_browser"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["クライアントbrowser(server)"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["X"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["td_browser_version"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["クライアントbrowserバージョン(server)"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["X"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["td_os"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["クライアントoperating system(server)"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["X"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["td_os_version"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["クライアントoperating systemバージョン(server)"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["X"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["td_global_id"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["3rd party cookie"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["NO"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["td_ssc_id"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Server Side Cookie"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["NO"]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["追跡されるデフォルトパラメータには、グローバルなプライバシー法への準拠を確保するために",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["td_client_id"]},"、",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["td.ip"]},"、および",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["td_global_id"]},"が含まれていません。td.setコマンドを呼び出すことで有効にできます。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"新しいendpointの使用方法","__idx":3},"children":["新しいendpointの使用方法"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["新しいJavaScript endpointをオプトインするための新しいオプションuseNewJavaScriptEndpointを導入します。これにはtrueまたはfalse値があります。このオプションを有効にする場合は、新しいendpointを指すようにhost設定も変更する必要があります。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["host設定は、使用する環境に応じて以下の値を持つ必要があります:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["AP02リージョン: ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"http://ap02.records.in.treasuredata.com"},"children":["ap02.records.in.treasuredata.com"]}]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Tokyoリージョン: ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"http://ap01.records.in.treasuredata.com"},"children":["ap01.records.in.treasuredata.com"]}]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["USリージョン: ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"http://us01.records.in.treasuredata.com"},"children":["us01.records.in.treasuredata.com"]}]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["EU01リージョン: ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"http://eu01.records.in.treasuredata.com/","title":"http://eu01.records.in.treasuredata.com"},"children":["eu01.records.in.treasuredata.com"]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["_",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["useNewJavaScriptEndpoint"]},"_を",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["false"]},"に設定するか、設定しないことでこの機能をオプトアウトする場合は、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["host"]},"を古い設定に更新してください。"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"javascript","header":{"controls":{"copy":{}}},"source":"var td = new Treasure({\n  database: 'foo',\n  writeKey: 'your_write_only_key',\n  useNewJavaScriptEndpoint: true,\n  host: 'us01.records.in.treasuredata.com'\n});\n","lang":"javascript"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"faq","__idx":4},"children":["FAQ"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["以前のバージョンでサポートされている既存の関数を使用できますか?",{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["はい。機能は現状のままです。"]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["queryでtd_browser、td_browser_version、td_os、td_os_versionを取得するにはどうすればよいですか?"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"sql","header":{"controls":{"copy":{}}},"source":"-- Trino\n-- element_atはkeyが欠落している場合でも処理できます。\nSELECT\n  element_at(\n    td_parse_agent(td_user_agent) ,\n    'name'\n  ) AS td_browser,\n  element_at(\n    td_parse_agent(td_user_agent) ,\n    'version'\n  ) AS td_browser_version,\n  element_at(\n    td_parse_agent(td_user_agent) ,\n    'os'\n  ) AS td_os,\n  element_at(\n    td_parse_agent(td_user_agent) ,\n    'os_version'\n  ) AS td_os_version\nFROM\n  web_access\n\n  -- OR, 以下はHiveとTrinoの両方で機能します\n  SELECT\n    td_parse_agent(td_user_agent) ['name'] AS td_browser,\n    td_parse_agent(td_user_agent) ['version'] AS td_browser_version,\n    td_parse_agent(td_user_agent) ['os'] AS td_os,\n    td_parse_agent(td_user_agent) ['os_version'] AS td_os_version\n  FROM\n    web_access\n","lang":"sql"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"制限事項と変更された動作","__idx":5},"children":["制限事項と変更された動作"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Real-time segmentationを使用するには、Backendからのルーティング有効化が必要です。Treasure サポートに連絡して、ルーティングを有効にするアカウント、database、tableをお知らせください。バックエンドから実行できます。将来のリリースでこの制限を削除する予定です。"]}]},"headings":[{"value":"JavaScript SDK Version 3.1について","id":"javascript-sdk-version-31について","depth":1},{"value":"表示される変更","id":"表示される変更","depth":1},{"value":"Treasure Data JavaScript SDK Version 3.1のログパラメータ","id":"treasure-data-javascript-sdk-version-31のログパラメータ","depth":1},{"value":"新しいendpointの使用方法","id":"新しいendpointの使用方法","depth":1},{"value":"FAQ","id":"faq","depth":1},{"value":"制限事項と変更された動作","id":"制限事項と変更された動作","depth":1}],"frontmatter":{"seo":{"title":"JavaScript SDK Version 3.1について"}},"lastModified":"2026-06-01T09:34:27.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/ja/products/customer-data-platform/integration-hub/streaming/td-javascript-sdk/about-javascript-sdk-version-3-1","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}