この文章は Salesforce 機械翻訳システムを使用して翻訳されました。詳細はこちらをご参照ください。
英語に切り替える

データ収集

Salesforce Interactions SDK でデータの取得を開始するには、Salesforce Interactions SDK を初期化し、データの追跡に関してユーザの同意を得る必要があります。

この関数は、初期化同意で使用します。

1SalesforceInteractions.init({
2  consents: [{
3    purpose: "Tracking", 
4    provider: "OneTrust", 
5    status: "Opt In"
6  }]
7})

サイトに既存の同意管理機能がある場合は、その機能を Salesforce Interactions SDK に統合し、ユーザが追跡に同意していることを通知します。

ユーザエンゲージメントデータの取得

顧客インタラクションを取得するには、sendEvent 関数をコールします。

1SalesforceInteractions.sendEvent({
2    interaction : {
3        name : "View Catalog Object",
4        catalogObject: { 
5          type : "Product", 
6          id : "65e4e737",
7          attributes: {
8            description: "Shoes"
9          }
10        }
11    }
12    })

プロファイルデータの取得

プロファイルデータも同じ sendEvent 関数で取得されます。

1SalesforceInteractions.sendEvent({
2    user: {
3        attributes: {
4            email: 'user@domain.com'
5        }
6    }
7})

プロファイルデータとエンゲージメントデータの取得

プロファイルデータを取得する場合、ユーザはその最小限のインタラクション形式に制限されません。いずれかのインタラクションデータモデルをプロファイル情報と組み合わせて、イベントのコンテキストを可能な限り収集することができます。

1SalesforceInteractions.sendEvent({
2    interaction : {
3        name : "View Catalog Object",
4        catalogObject: { 
5          type : "Product", 
6          id : "65e4e737",
7          attributes: {
8            description: "Shoes"
9          }
10        }
11    },
12    user: {
13        attributes: {
14            email: 'user@domain.com'
15        }
16    }
17})