Important: Please ensure your CMP configuration includes new Vendor ID 1469 for 1st Party data tracking. Additionally, include Vendor ID 301 if cookie sync is enabled. Learn more
Usage
The Zeotap Web SDK can be configured by passing an options object during theinit call. eg: window.zeotap.init("writeKey", <options>);
Mandatory
| Key | Type | Description |
|---|---|---|
writeKey | String | Required. Your unique Zeotap Write Key to send data to your specific source. It can be obtained from access details of your web javascript source created in Zeotap CDP. |
SDK Configuration Options
PII related Options
Only works for PIIs (cellno, email, loginid) sent using setUserIdentities| Option | Type | Description |
|---|---|---|
areIdentitiesHashed | Boolean | Set to true if the identities you pass to setUserIdentities are already hashed (e.g., SHA-256). Defaults to false. |
hashIdentities | Boolean | Set to true to enable automatic client-side SHA-256 hashing of email/phone identities before sending. Defaults to true. |
Consent Options
| Option | Type | Description |
|---|---|---|
useConsent | Boolean | If set to true, the SDK waits to receive a consent signal and uses that consent to manage actions. Defaults to false. |
checkForCMP | Boolean | If set to false, the Non-TCF Zeotap CMP is used for consent management. Defaults to true. |
purposesForTracking | Number[] | TCF Purpose IDs required for tracking user activity. Default depends on TCF version/config (e.g., [1,3,4] or [1,5,6]). |
purposesForCookieSync | Number[] | TCF Purpose IDs required for cookie syncing. Default depends on TCF version/config (e.g., [1,3,4] or [1,5,6]). |
includeTCFString | Boolean | If true, the TCF consent string is included in the event payload regardless of the consent mechanism used. No default specified. |
shouldCheckZeotapVendorConsent | Boolean | If true, the SDK checks for Zeotap’s vendor consent (ID 1469) before checking tracking purposes. Defaults to false. |
partnerConsentKeyMap | Object | Maps keys in your setConsent call to Zeotap Partner IDs to control cookie syncing consent per channel partner (e.g. Google, Meta). Only active in custom consent mode (useConsent: true, checkForCMP: false). Defaults to undefined. |
Important: Please ensure your CMP configuration includes new Vendor ID 1469 for 1st Party data tracking. Additionally, include Vendor ID 301 if cookie sync is enabled. Learn more’
Storage options
| Option | Type | Description |
|---|---|---|
storageExpirationDays | Number | Defines how long (in days) any cookies used for storage are set for. Not applicable to localStorage. Defaults to 365. |
domain | String | If specified, cookies are stored against this domain (e.g., ‘.yourdomain.com’). By default, cookies are saved against the top-level domain. Defaults to undefined. |
persistenceInCookieStorage | Boolean | If true, identities and consent info are persisted in cookie storage; otherwise, sessionStorage is used. Defaults to false. |
ID5 integration Options
| Option | Type | Description |
|---|---|---|
enableID5 | Boolean | Set to true to enable the ID5 Universal ID integration. Defaults to false. |
id5PartnerId | Number | Your specific partner ID provided by ID5. Required if enableID5 is true. No default. |
sendPartnerDataToID5 | Boolean | If true, allows the SDK to send user PII (hashed email/phone) to ID5. Requires enableID5 to be true. Defaults to false. |
GA integration options
| Option | Type | Description |
|---|---|---|
allowGAClientId | Boolean | If set to false, the Google Analytics Client ID will not be forwarded in POST calls. Defaults to true. |
gaClientIdCookiePrefix | String | Cookie prefix for the Google Analytics Client ID cookie. If set to <value>, the SDK looks for a cookie named <value>_ga. Defaults to ''. |
gaUserIdCookieName | String | Cookie name for the Google Analytics User ID. If set to <value>, the SDK looks for a cookie named <value>. Defaults to ''. |
gaUserIdOnlyLoginEvent | Boolean | If set to false, the GA User ID is sent in all event calls. If true, it’s sent only on setUserIdentities calls. Defaults to false. |
Interact SDK options
| Option | Type | Description |
|---|---|---|
loadInteractScript | Boolean | Set to true to automatically load the Zeotap Interact SDK alongside the main Web SDK. This enables client-side data delivery features. Defaults to false. |
interactScriptUrl | String | Specifies a custom URL from which to load the Interact SDK script. If not provided, the SDK will use a default URL when loadInteractScript is true. |
Logging options
| Option | Type | Description |
|---|---|---|
enableLogging | Boolean | If set to false, debug logs won’t appear in the browser console, regardless of logLevel. Defaults to false. |
logLevel | String | Sets the minimum level for logs to appear (‘debug’, ‘info’, ‘warn’, ‘error’). Defaults to 'warn'. |
debug | Boolean | If set to true, events are logged to the console instead of being sent to the backend. Useful for development. Defaults to false. |
Other options
| Option | Type | Description |
|---|---|---|
allowCookieSync | Boolean | If set to true, cookie syncing takes place. Defaults to true. |
user_country | String | If set with a country code (e.g., ‘US’, ‘DE’), this code is sent with every request as user.user_country. Defaults to null. |
eventRetryDelayMillis | Number | The delay in milliseconds added per backoff attempt when retrying failed event posts. Defaults to 500. |
eventUploadPeriodMillis | Number | If the event queue size is less than eventUploadThreshold, the request to post events will be scheduled after this many milliseconds. Defaults to 500. |
eventUploadThreshold | Number | The maximum number of events allowed in the unsent queue before dispatching immediately. Defaults to 1. |
uploadBatchSize | Number | The number of events that should be posted at once in a single batch request. Defaults to 1. |
maxRetries | Number | The maximum number of retries for posting events before dropping them. Defaults to 3. |
maxEventsQueuedTillConsentUnresolved | Number | The maximum number of events to queue in memory while consent status is unresolved. Defaults to 10. |