Consent Data

Consent data is used to explicitly capture and report a customer's decision to grant or revoke tracking permission within the Salesforce Interactions SDK. This is essential for adhering to privacy regulations (like GDPR, CCPA, and so on).

When a customer opts in to tracking, the consent details are attached to the first tracked event, and typically included in subsequent events, ensuring a verifiable consent record is maintained.

The consent object is included within the event payload to record the user's tracking preference.

FieldTypeDescription
providerstringRequired. A named identifier indicating the consent management system providing the consent to the SDK.
purposestringRequired. Specifies the type of activity the customer consented to. For example, Tracking.
statusstringRequired. The customer's decision regarding the purpose. Values: Opt In or Opt Out.

This JSON structure shows how consent data is formatted before being attached to an event.

Use these built-in constants to populate the purpose and status fields.

NameValueDescription
SalesforceInteractions.ConsentPurpose.TrackingTrackingUsed to denote consent for general behavioral tracking.
SalesforceInteractions.ConsentStatus.OptInOpt InIndicates the customer has explicitly granted consent.
SalesforceInteractions.ConsentStatus.OptOutOpt OutIndicates the customer has explicitly denied or revoked consent.

See Also