Consent Configuration Options
The Zeotap Web SDK provides several configuration options within the init method to manage how user consent is handled. These settings are crucial for ensuring compliance with privacy regulations like GDPR. Understanding these options helps you tailor the SDK's behavior to match your chosen consent strategy, whether you're using a TCF v2.x compliant Consent Management Platform (CMP), a custom consent solution, or operating under specific regional requirements.
Refer to the Choosing Your Consent Management Strategy guide for an overview of the different approaches.
useConsent
- Type:
Boolean - Default:
false - Description: This is the primary flag to enable or disable the SDK's consent management features.
false(Default): The SDK operates in its default mode. Tracking and cookie syncing behavior are primarily controlled by theoptOutflag. The SDK assumes consent unless explicitly opted out.true: Activates consent management. The SDK will now expect and respect consent signals before performing actions like tracking or cookie syncing. It will either look for a TCF CMP (ifcheckForCMPistrue) or wait forsetConsentcalls (ifcheckForCMPisfalse). Events may be queued until consent is determined.
checkForCMP
- Type:
Boolean - Default:
true - Description: This option is only relevant when
useConsentis set totrue. It tells the SDK how to determine consent status.true(Default): The SDK will actively look for the IAB TCF v2.x__tcfapiframework on the page. If found, it will use the signals (TC String) provided by the CMP to determine consent for tracking and cookie syncing based on the configuredpurposesForTrackingandpurposesForCookieSyncing.false: The SDK will not look for the TCF__tcfapi. Instead, it will rely solely on explicit calls to thewindow.zeotap.setConsent()function to receive consent signals. This is used for custom consent implementations.
purposesForTracking
- Type:
Number[](Array of numbers) - Default:
[1, 3, 4](Common TCF v2.0/2.1 defaults) - Description: Specifies the list of IAB TCF Purpose IDs for which the user must have granted consent (via a TCF CMP) in order for the SDK to perform tracking actions (e.g., sending events via
setEventProperties, automatic page views). This option is only used whenuseConsent: trueandcheckForCMP: true. The SDK checks if consent is granted for all purposes listed in this array.- Example TCF Purposes:
1: Store and/or access information on a device3: Create a personalised advertising profile4: Select personalised advertisements
- Example TCF Purposes:
Refer TCF/GDPR consent strategy for usage and more details.
purposesForCookieSyncing
- Type:
Number[](Array of numbers) - Default:
[1, 3, 4](Common TCF v2.0/2.1 defaults) - Description: Specifies the list of IAB TCF Purpose IDs for which the user must have granted consent (via a TCF CMP) in order for the SDK to perform cookie syncing operations. This option is only used when
useConsent: true,checkForCMP: true, andallowCookieSync: true. The SDK checks if consent is granted for all purposes listed in this array before initiating syncs.- Example TCF Purposes: (Often the same as
purposesForTracking)1: Store and/or access information on a device3: Create a personalised advertising profile4: Select personalised advertisements
- Example TCF Purposes: (Often the same as
Refer TCF/GDPR consent strategy for usage and more details.
includeTCFString
- Type:
Boolean - Default:
false - Description: Determines whether the full TCF consent string (TC String), if available from a CMP, should be included in the payload of events sent to the Zeotap backend.
false(Default): The TC String is not included in the event payload.true: If the SDK detects a TCF CMP and retrieves a TC String, that string will be added to the event payload under the keytc_string. This can be useful for auditing and debugging purposes.- note tc_string is by default passed in the payload if TCF/GDPR consent strategy is chosen.
shouldCheckZeotapVendorConsent
- Type:
Boolean - Default:
false - Description: Adds an additional layer of validation when using a TCF CMP (
useConsent: trueandcheckForCMP: true).false(Default): The SDK only checks for consent against the configuredpurposesForTrackingandpurposesForCookieSyncing.true: In addition to checking purpose consents, the SDK will also explicitly check if consent has been granted for Zeotap as a vendor (Vendor ID 301) within the TCF consent string. Tracking and/or cookie syncing will only proceed if both the required purpose consents and vendor consent for Zeotap are present.
Combined usage
useConsent | checkForCMP | setConsent() call | Description of SDK Behavior |
|---|---|---|---|
| Not Passed | Not Passed | Only called for passing brand consents. | Default Behavior: Consent management is disabled. The SDK assumes consent is granted and performs tracking and cookie syncing. |
true | true | Only called for passing brand consents. | TCF Integration: Consent management is enabled, and the SDK expects to interact with a TCF v2.x compliant CMP. The SDK reads consent signals (TC String) from the CMP to determine tracking and cookie syncing permissions. The track and cookieSync parameters within setConsent (if called) are ignored, but Brand Consents are processed. |
true | false | Required for passing consent signals and/or brand consents. | Custom Consent Management: Consent management is enabled, and the SDK relies on manual setConsent() calls to receive consent signals. The track and cookieSync parameters directly control tracking and cookie syncing behavior, respectively. Additional properties (brand consents) are also processed and sent. |
Consent Configuration Combinations and SDK Behavior
useConsent: IfuseConsentisfalse, the SDK essentially ignores any subsequent consent signals and leads to default consent mode. It's the main configuration to enable/disable consent management.checkForCMPfor TCF vs. Custom: WhenuseConsent: true, this flag dictates whether the SDK automatically listens for a TCF CMP (checkForCMP: true) or relies on manual calls tosetConsent()(checkForCMP: false).setConsent()Behavior: ThesetConsent()function's behavior is highly dependent on theuseConsentandcheckForCMPsettings:- TCF (
checkForCMP: true): ThetrackandcookieSyncparameters insetConsentare ignored; the TC String from the CMP is the source of truth. However, non-standard properties (brand consents) are still processed. - Custom (
checkForCMP: false): ThetrackandcookieSyncparameters directly control SDK tracking and cookie syncing actions.
- TCF (
By configuring these options correctly, you can ensure the Zeotap Web SDK aligns with your specific consent requirements and respects user privacy choices.