データ収集
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})