Skip to main content

Configurations

Usage

The Zeotap Web SDK can be configured by passing an options object during the init call. eg: window.zeotap.init("writeKey", <options>);

Mandatory

KeyTypeDescription
writeKeyStringRequired. 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

Only works for PIIs (cellno, email, loginid) sent using setUserIdentities

OptionTypeDescription
areIdentitiesHashedBooleanSet to true if the identities you pass to setUserIdentities are already hashed (e.g., SHA-256). Defaults to false.
hashIdentitiesBooleanSet to true to enable automatic client-side SHA-256 hashing of email/phone identities before sending. Defaults to true.

Learn more about PII hashing options

OptionTypeDescription
useConsentBooleanIf set to true, the SDK waits to receive a consent signal and uses that consent to manage actions. Defaults to false.
checkForCMPBooleanIf set to false, the Non-TCF Zeotap CMP is used for consent management. Defaults to true.
purposesForTrackingNumber[]TCF Purpose IDs required for tracking user activity. Default depends on TCF version/config (e.g., [1,3,4] or [1,5,6]).
purposesForCookieSyncNumber[]TCF Purpose IDs required for cookie syncing. Default depends on TCF version/config (e.g., [1,3,4] or [1,5,6]).
includeTCFStringBooleanIf true, the TCF consent string is included in the event payload regardless of the consent mechanism used. No default specified.
shouldCheckZeotapVendorConsentBooleanIf true, the SDK checks for Zeotap's vendor consent (ID 301) before checking tracking purposes. Defaults to false.

Learn more about combined usage of consent options

Storage options

OptionTypeDescription
storageExpirationDaysNumberDefines how long (in days) any cookies used for storage are set for. Not applicable to localStorage. Defaults to 365.
domainStringIf specified, cookies are stored against this domain (e.g., '.yourdomain.com'). By default, cookies are saved against the top-level domain. Defaults to undefined.
persistenceInCookieStorageBooleanIf true, identities and consent info are persisted in cookie storage; otherwise, sessionStorage is used. Defaults to false.

ID5 integration Options

OptionTypeDescription
enableID5BooleanSet to true to enable the ID5 Universal ID integration. Defaults to false.
id5PartnerIdNumberYour specific partner ID provided by ID5. Required if enableID5 is true. No default.
sendPartnerDataToID5BooleanIf true, allows the SDK to send user PII (hashed email/phone) to ID5. Requires enableID5 to be true. Defaults to false.

GA integration options

OptionTypeDescription
allowGAClientIdBooleanIf set to false, the Google Analytics Client ID will not be forwarded in POST calls. Defaults to true.
gaClientIdCookiePrefixStringCookie prefix for the Google Analytics Client ID cookie. If set to <value>, the SDK looks for a cookie named <value>_ga. Defaults to ''.
gaUserIdCookieNameStringCookie name for the Google Analytics User ID. If set to <value>, the SDK looks for a cookie named <value>. Defaults to ''.
gaUserIdOnlyLoginEventBooleanIf 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

OptionTypeDescription
loadInteractScript BooleanSet to true to automatically load the Zeotap Interact SDK alongside the main Web SDK. This enables client-side data delivery features. Defaults to false.
interactScriptUrlStringSpecifies 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

OptionTypeDescription
enableLoggingBooleanIf set to false, debug logs won't appear in the browser console, regardless of logLevel. Defaults to false.
logLevelStringSets the minimum level for logs to appear ('debug', 'info', 'warn', 'error'). Defaults to 'warn'.
debugBooleanIf set to true, events are logged to the console instead of being sent to the backend. Useful for development. Defaults to false.

Other options

OptionTypeDescription
allowCookieSyncBooleanIf set to true, cookie syncing takes place. Defaults to true.
user_countryStringIf set with a country code (e.g., 'US', 'DE'), this code is sent with every request as user.user_country. Defaults to null.
eventRetryDelayMillisNumberThe delay in milliseconds added per backoff attempt when retrying failed event posts. Defaults to 500.
eventUploadPeriodMillisNumberIf the event queue size is less than eventUploadThreshold, the request to post events will be scheduled after this many milliseconds. Defaults to 500.
eventUploadThresholdNumberThe maximum number of events allowed in the unsent queue before dispatching immediately. Defaults to 1.
uploadBatchSizeNumberThe number of events that should be posted at once in a single batch request. Defaults to 1.
maxRetriesNumberThe maximum number of retries for posting events before dropping them. Defaults to 3.
maxEventsQueuedTillConsentUnresolvedNumberThe maximum number of events to queue in memory while consent status is unresolved. Defaults to 10.