Consent
Salesforce Interactions SDK はユーザーのプライバシーを尊重するように設計されているため、同意が付与されるまで、収集したデータは保存または転送されません。サイトに既存の同意管理機能がある場合は、その機能を SDK に統合し、ユーザーが追跡に同意していることを通知する必要があります。
ユーザーの同意は、次の場合に Salesforce Interactions SDK に提供される可能性があります。
- 初期化中
- updateConsents = (consents: Consent | Consent[]): void のコール中
1SalesforceInteractions.init({
2 consents: new Promise(resolve => {
3 // user clicks button that grants consent
4 document.getElementById('opt-in')
5 .addEventListener('click', () => {
6 resolve([{
7 provider: 'Test Provider',
8 purpose: SalesforceInteractions.ConsentPurpose.Tracking,
9 status: SalesforceInteractions.ConsentStatus.OptIn
10 }])
11 }, { once: true })
12
13 // user clicks button that revokes consent
14 document.getElementById('opt-out')
15 .addEventListener('click', () => {
16 resolve([{
17 provider: 'Test Provider',
18 purpose: SalesforceInteractions.ConsentPurpose.Tracking,
19 status: SalesforceInteractions.ConsentStatus.OptOut
20 }])
21 }, { once: true })
22
23 })
24})同意メソッド
1getConsents: ConsentWithMetadata[]最終更新時間および最終送信時間を含む同意データを返します。
1updateConsents = (consents: Consent | Consent[]): void初期化後に同意を更新する方法、たとえば、OneTrust コードから直接コールする方法を次に示します。
1// when the user opts in
2SalesforceInteractions.updateConsents({
3 purpose: SalesforceInteractions.ConsentPurpose.Tracking,
4 provider: "OneTrust",
5 status: SalesforceInteractions.ConsentStatus.OptIn
6})
7
8// when the user opts out
9SalesforceInteractions.updateConsents({
10 purpose: SalesforceInteractions.ConsentPurpose.Tracking,
11 provider: "OneTrust", status:
12 SalesforceInteractions.ConsentStatus.OptOut
13})