{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-@l10n/ja/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["admonition"]},"type":"markdown"},"seo":{"title":"TD JavaScript Consent Extension の使用","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":"td-javascript-consent-extension-の使用","__idx":0},"children":["TD JavaScript Consent Extension の使用"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Treasure Data JavaScript Consent Extension (TD JS Consent Extension) は、クライアント側で consent 管理ソリューションを実装する API セットです。TD のお客様は、データ使用のカテゴリーと consent 収集のための異なる context を定義できます。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Consent Extension は、Web サイト訪問者が自分についてのデータの収集方法に関する consent 設定を制御およびカスタマイズできるようにします。訪問者は、完全にオプトアウトするか、データ使用の目的に同意しない場合は特定の context でのデータ収集を選択的にオプトアウトすることができます。UI で完全にカスタマイズ可能な consent 管理を構築できるアドオンもあります。"]},{"$$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":"MarkdownLink","attributes":{"href":"https://github.com/treasure-data/td-js-sdk"},"children":["TD JS SDK"]}," に精通していること"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Treasure Data Platform にアクセスするための Write ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/my-settings/getting-your-api-keys"},"children":["API KEY"]}]}]}]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Treasure Data では、本番環境で使用を開始する前に、Treasure Data JavaScript SDK version 3 を使用してサイトの新機能や機能の実装を検証することをお勧めします。cookie の管理方法が異なります。これらの記事のほとんどを参照する際は、ソリューションで推奨される event collector と Treasure Data JavaScript SDK version 3 の呼び出しを定義する必要があることに注意してください。例えば、//cdn.treasuredata.com/sdk/2.5/td.min.js を //cdn.treasuredata.com/sdk/3.0.0/td.min.js に変更します。"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"context-と-consent-について","__idx":2},"children":["Context と Consent について"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Treasure Data JavaScript Consent Extension には、Web サイトの consent 情報を定義できる以下の概念があります:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Context"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Consent"]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["例えば、consent の ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["context_id"]}," と ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["purpose"]}," のパラメータを含めて、consent を一意にすることができます。この組み合わせにより、Treasure Data で消費者の consent をクエリしてフィルタリングできます。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"context","__idx":3},"children":["Context"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Context は、ブランド、ドメイン、consent 収集のタイプなどの一般的な情報を定義します。これらの情報は、ユーザーが consent に同意または拒否した context を識別します。Treasure Data は、context に対して以下のデフォルトフィールドを提供します。context を充実させるために、いつでも追加のフィールドを追加できます。"]},{"$$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":["Parameter"]}]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":""},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Description"]}]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["brand"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["会社のブランド名。"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["domain_name"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["ブランドコンテンツと TD-JS SDK をホストしている Web サイトのドメイン名。"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["collection_type"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["異なるタイプの収集 context を含みます。例えば、consent 収集 context は、ショッピングカートページ、Web フォーム、または Web サイト全体に対して設定できます。"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["collection_point_id"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["別のシステムから渡すことができる各収集ポイントの識別子。例えば、収集 context がショッピングカートページの場合、この ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["collection_point_id"]}," にショッピングカートトランザクション ID を使用できます。"]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["context_id"]},"| 各 context に対して自動生成される ID。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["例えば、context のコードスニペットは次のようになります:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"javascript","header":{"controls":{"copy":{}}},"source":"{\n  brand: 'A brand',\n  domain_name: 'abrand.com',\n  collection_type: 'shopping_cart',\n  collection_point_id: 'shopping_trnx_id',\n  context_id: 'xxxxxxxxxx'\n}\n","lang":"javascript"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"consent","__idx":4},"children":["Consent"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Consent は、消費者によって与えられた consent のセマンティクスを定義します。Consent フィールドは次のように定義されます。"]},{"$$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":["Parameter"]}]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":""},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Description"]}]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["purpose"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["データ使用のカテゴリー。"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["status"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Consent のステータス。",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["given"]},"、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["refused"]},"、または ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["notgiven"]}," のいずれか。"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["datatype"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["個人データタイプ。"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["context_id"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["consent が属する Context。"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["identifier"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["ユーザー識別子。"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["expiry_date"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["consent の有効期限。"]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["例えば、consent のコードスニペットは次のようになります:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"javascript","header":{"controls":{"copy":{}}},"source":"{\n  purpose: 'analytics',\n  status: 'given',\n  datatype: 'Purchase',\n  context_id: 'xxxxxxxxxx',\n  identifier: 'client id',\n  expiry_date: 'YYYY-MM-DD'\n}\n","lang":"javascript"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"td-consent-manager-の設定","__idx":5},"children":["TD Consent Manager の設定"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Consent Manager は、TD JS Consent Extension のメイン JS オブジェクトです。Consent Manager の設定は、TD JavaScript SDK の初期化と共にセットアップされます。database 名、API write key、およびお客様のリージョンに適した host を入力します。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["TD Consent Manager を次のように設定します:"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["JS SDK を使用している新しい ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://github.com/treasure-data/td-js-sdk"},"children":["js file"]}," を開くか作成します。例えば、td_initializations.js です。"," ","ファイルは次のようになります:"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"javascript","header":{"controls":{"copy":{}}},"source":"var td = new Treasure({\n   database: 'database',\n   writeKey: '1/xxxxxxxxxx',\n   host: 'in.treasuredata.com',\n   ...\n","lang":"javascript"},"children":[]},{"$$mdtype":"Tag","name":"ol","attributes":{"start":2},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["前述のパラメータに従って TD JS Consent Manager の設定を開始します。"," ","例は次のようになります:"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"javascript","header":{"controls":{"copy":{}}},"source":"var td = new Treasure({\n  database: 'database',\n  writeKey: '1/xxxxxxxxxx',\n  host: 'in.treasuredata.com',\n  consentManager: {\n    storageKey: 'storage key',\n    successConsentCallback: function () {},\n    failureConsentCallback: function () {},\n    expiredConsentsCallback: function () {},\n    consentTable: 'consent_table_name',\n    contextTable: 'context_table_name',\n    issuer: 'name of the consent management platform',\n    dateFormat: 'YYYY-MM-DD'\n  }\n})\n","lang":"javascript"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"td-consent-manager-parameters","__idx":6},"children":["TD Consent Manager Parameters"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["以下のパラメータを使用して TD Consent Manager を設定できます。"]},{"$$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":["Parameter"]}]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":""},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Type"]}]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":""},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Required"]}]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":""},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Description"]}]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["storageKey"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Optional"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["local storage の名前。デフォルト: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["td_consent_preferences"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["consentTable"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Optional"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["consent テーブルの名前。デフォルト: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["td_cm_consent"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["contextTable"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Optional"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["context テーブルの名前。デフォルト: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["td_cm_context"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["issuer"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Optional"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["consent 管理プラットフォームの名前。デフォルト: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["treasuredata"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["dateFormat"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Optional"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["日付フォーマット文字列。デフォルト: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["YYYY-MM-DD"]},"。Treasure Data は日付フォーマットを処理するために ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://github.com/iamkun/dayjs"},"children":["dayjs"]}," を使用しているため、日付フォーマット文字列はこのドキュメント ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://day.js.org/docs/en/parse/string-format"},"children":["string-format"]}," に従う必要があります。"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["successConsentCallback"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Function"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Optional"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["consent の保存が成功した場合の callback"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["failureConsentCallback"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Function"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Optional"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["consent の保存が失敗した場合の callback"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["expiredConsentsCallback"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Function"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Optional"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["consent が期限切れの場合の callback"]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["ページが読み込まれるたびに、TD JS Consent Manager は consent の有効期限をチェックし、期限切れの consent がある場合は ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["expiredConsentCallback"]}," がトリガーされます。また、期限切れの consent のステータスを ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["expired"]}," に更新します。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"デフォルト-context-の作成","__idx":7},"children":["デフォルト Context の作成"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["consent に context を追加すると、TD platform にデータを送信する際に context が含まれます。独自の context ID を指定できます。指定しない場合は、新しい context ID が戻り値として生成されます。"]},{"$$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":["Parameter"]}]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":""},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Type"]}]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":""},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Required"]}]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":""},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Description"]}]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["context"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Object"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Yes"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Context 情報"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["brand"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Yes"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["ブランド名"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["domain_name"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Yes"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["ドメイン名"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["collection_type"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Yes"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Consent 収集タイプ"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["collection_point_id"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Yes"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Consent 収集ポイント ID"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["context_id"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Optional"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Context ID"]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["例えば、コードスニペットは次のようになります:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"javascript","header":{"controls":{"copy":{}}},"source":"sdk.addContext({\n  brand: 'A Brand',\n  domain_name: 'abrand.com',\n  collection_type: 'shopping_cart',\n  collection_point_id: 'shopping_trnx_id'\n  context_id: 'uuid'\n})\n","lang":"javascript"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"デフォルト-consent-preferences-の作成","__idx":8},"children":["デフォルト Consent Preferences の作成"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["context ID を持たない consent は、デフォルトの context に追加されます。"]},{"$$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":["Parameter"]}]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":""},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Type"]}]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":""},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Required"]}]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":""},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Description"]}]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["purpose"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Yes"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["データ使用の目的を記述します。consent を作成する際、consent オブジェクトの名前として ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["purpose"]}," を使用します。"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["description"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Optional"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Consent の説明"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["datatype"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Yes"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["データタイプ"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["status"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Yes"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Consent のステータス。次のいずれかになります: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["given"]},"、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["refused"]},"、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["notgiven"]},"。デフォルト: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["notgiven"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["expiry_date"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["(String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Number"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Date)"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["context_id"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Yes"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Context ID"]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["例えば、コードスニペットは次のようになります:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"javascript","header":{"controls":{"copy":{}}},"source":"sdk.addConsents({\n  'marketing': { // <--- purpose\ndescription: 'description of consent',\ndatatype: 'Attibutes',\nstatus: Given | Refused,\nexpiry_date: 'YYYY-MM-DD',\ncontext_id: 'context_id'\n  },\n  'storing': { // <--- purpose\ndescription: 'description',\ndatatype: 'datatype',\nstatus: Given | Refused,\nexpiry_date: 'YYYY-MM-DD',\ncontext_id: 'context_id'\n  },\n  'recommendations': { // <--- purpose\ndescription: 'description',\ndatatype: 'datatype',\nstatus: Given | Refused,\nexpiry_date: 'YYYY-MM-DD',\ncontext_id: 'context_id'\n  }\n)\n","lang":"javascript"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"callback-functions-の設定","__idx":9},"children":["Callback Functions の設定"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["SDK は、consent が期限切れになった場合、consent が更新された場合、consent が Treasure Data に正常に送信された場合、または consent が失敗した場合など、さまざまな callback 関数を提供します。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["これらの callback がトリガーされたときの動作を決定するために、追加のコードを追加できます。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["例えば、コードスニペットは次のようになります:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"javascript","header":{"controls":{"copy":{}}},"source":"function successCallback (preferences) {\n  if (preferences['analytics'].status === 'given') {\ntd.setSignedMode()\ntd.unblockEvents()\n  } else if (preferences['analytics'].status === 'refused') {\ntd.setAnonymousMode()\ntd.blockEvents()\n  }\n","lang":"javascript"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"web-サイト訪問者から-consent-を求める","__idx":10},"children":["Web サイト訪問者から Consent を求める"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Web サイトに表示される cookie banner を作成してデプロイし、Web サイト訪問者から consent を求めることができます。cookie banner には通常、訪問者にデータが収集されていること、および consent に従って特定の目的に使用されることを知らせる短い声明が含まれています。さらに、サイト訪問者が consent 設定を直接制御できる Consent Manager UI へのリンクを追加できます。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["cookie banner と Consent Manager UI の例については、",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://github.com/treasure-data/td-js-consent"},"children":["Treasure Data GitHub repo"]}," を参照してください。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"td-consent-manager-への-consent-preferences-の更新","__idx":11},"children":["TD Consent Manager への Consent Preferences の更新"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["デフォルトの consent preferences を作成するのと同様に、ユーザーが特定のデータ使用の consent を承認または拒否した場合に、consent ステータスを更新できます。そのためには、デフォルトとして設定したときと同じ名前を consent に使用し、以下のパラメータで ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["updateConsent (contextId, consentObject)"]}," を呼び出します:"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Consent preferences を更新するための Parameters"]}]},{"$$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":["Parameters"]}]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":""},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Type"]}]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":""},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Required"]}]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":""},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Description"]}]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["contextId"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Yes"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Context ID"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["consentObject"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Object"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Yes"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["更新したい context の値"]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["例えば、コードスニペットは次のようになります:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"javascript","header":{"controls":{"copy":{}}},"source":"sdk.updateConsent('xxxxxx-context-id', {\n  'recommendations': {\nstatus: 'refused'\n  }\n})\n","lang":"javascript"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["consent を更新すると、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["saveConsents"]}," を呼び出した後、更新された consent のみが ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["successConsentCallback"]}," に送信されます。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"td-consent-manager-への-context-の更新","__idx":12},"children":["TD Consent Manager への Context の更新"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["既存の context を更新して、context を説明するための詳細情報を追加することもできます。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Context を更新するための Parameters"]},":"]},{"$$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":["Parameters"]}]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":""},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Type"]}]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":""},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Required"]}]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":""},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Description"]}]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["contextId"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Yes"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Context ID"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["values"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Object"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Yes"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["更新したい context の値"]}]}]}]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"javascript","header":{"controls":{"copy":{}}},"source":"sdk.updateContext('xxxxxx-context-id', {\n  brand: 'Other brand',\n  domain_name: 'otherdomain.com'\n})\n","lang":"javascript"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"consent-と-context-の-treasure-data-への保存","__idx":13},"children":["Consent と Context の Treasure Data への保存"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["以下の呼び出しを使用して、consent と context を local storage と Treasure Data に保存できます:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"javascript","header":{"controls":{"copy":{}}},"source":"saveConsents(success, error);\nsaveContexts(success, error);\n","lang":"javascript"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Consent を保存するための Parameters"]},":"]},{"$$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":["Parameters"]}]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":""},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Type"]}]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":""},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Required"]}]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":""},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Description"]}]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["success"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Function"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Optional"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["consent の保存が成功した場合の Callback"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["error"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Function"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Optional"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["consent の保存が成功した場合の Callback"]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["例えば、コードスニペットは次のようになります:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"javascript","header":{"controls":{"copy":{}}},"source":"function success () {\n  // yay()\n}\n\nfunction error (err) {\n  /**\n  * err: { success: false, message: 'Timeout' }\n  */\n}\nsdk.saveContexts(success, error)\n","lang":"javascript"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Contexts を保存するための Parameters:"]}]},{"$$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":["Parameters"]}]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":""},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Type"]}]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":""},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Required"]}]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":""},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Description"]}]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["success"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Function"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Optional"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["context の保存が成功した場合の Callback"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["error"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Function"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Optional"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["context の保存が成功した場合の Callback"]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["例えば、コードスニペットは次のようになります:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"javascript","header":{"controls":{"copy":{}}},"source":"function success () {\n  // yay()\n}\n\nfunction error (err) {\n  /**\n  * err: { success: false, message: 'Timeout' }\n  */\n}\nsdk.saveContexts(success, error)\n","lang":"javascript"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"その他の-functions","__idx":14},"children":["その他の Functions"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["これらは、TD Consent Manager からローカルに consent 情報を取得するために呼び出すことができるその他のユーティリティ関数です。"]},{"$$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":["Function"]}]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":""},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Description"]}]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"getconsents","__idx":15},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["getConsents()"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["| consent のリストを返します"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"getcontexts","__idx":16},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["getContexts()"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["| context のリストを返します"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"getconsentexpirydatecontextid-consentpurpose","__idx":17},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["getConsentExpiryDate(contextId, consentPurpose)"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["特定の consent の有効期限を取得します"," ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["getExpiredConsents()"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["期限切れの consent を返します"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["getConsentExpiryDate の Parameters:"]},{"$$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":["Parameters"]}]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":""},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Type"]}]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":""},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Required"]}]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":""},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Description"]}]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["contextId"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Yes"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Context ID"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["consentPurpose"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Yes"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["consent の purpose"]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["例えば、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["getConsentExpiryDate"]}," のコードスニペットは次のようになります:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"javascript","header":{"controls":{"copy":{}}},"source":"sdk.getConsentExpiryDate('context_id', 'analytics')\n","lang":"javascript"},"children":[]}]},"headings":[{"value":"TD JavaScript Consent Extension の使用","id":"td-javascript-consent-extension-の使用","depth":1},{"value":"前提条件","id":"前提条件","depth":1},{"value":"Context と Consent について","id":"context-と-consent-について","depth":2},{"value":"Context","id":"context","depth":3},{"value":"Consent","id":"consent","depth":3},{"value":"TD Consent Manager の設定","id":"td-consent-manager-の設定","depth":2},{"value":"TD Consent Manager Parameters","id":"td-consent-manager-parameters","depth":2},{"value":"デフォルト Context の作成","id":"デフォルト-context-の作成","depth":2},{"value":"デフォルト Consent Preferences の作成","id":"デフォルト-consent-preferences-の作成","depth":2},{"value":"Callback Functions の設定","id":"callback-functions-の設定","depth":2},{"value":"Web サイト訪問者から Consent を求める","id":"web-サイト訪問者から-consent-を求める","depth":2},{"value":"TD Consent Manager への Consent Preferences の更新","id":"td-consent-manager-への-consent-preferences-の更新","depth":2},{"value":"TD Consent Manager への Context の更新","id":"td-consent-manager-への-context-の更新","depth":2},{"value":"Consent と Context の Treasure Data への保存","id":"consent-と-context-の-treasure-data-への保存","depth":2},{"value":"その他の Functions","id":"その他の-functions","depth":2},{"value":"getConsents()","id":"getconsents","depth":4},{"value":"getContexts()","id":"getcontexts","depth":4},{"value":"getConsentExpiryDate(contextId, consentPurpose)","id":"getconsentexpirydatecontextid-consentpurpose","depth":4}],"frontmatter":{"seo":{"title":"TD JavaScript Consent Extension の使用"}},"lastModified":"2026-05-14T07:31:32.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/ja/products/customer-data-platform/integration-hub/streaming/td-javascript-sdk/using-td-javascript-consent-extension","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}