Skip to main content
If your website has a TCF API on the page, then the consent resolution mechanism must be TCF and not the default Optin. This helps the Zeotap SDK to also capture the gdpr_consent string. In some cases, you may set up a default consent resolution mechanism and invoke the Zeotap JavaScript only if the user performs any action on the CMP. However, note that we do not recommend this step. Even when you invoke the SDK with the TCF Consent Configurations, the JS communicates with the TCF API on the page and only then the JS collects/captures the events. Otherwise, the JS just sits idle. We recommend the following SDK configurations for the above scenario:
Code
{

useConsent: true,

checkForCMP: true

}
If you are setting up a Custom Consent collection on your website, ensure that you also choose the same in the SDK configurations. This is required in order to collect granular consent from the website. The SDK primarily performs the following three main tasks:
  • Capture user events
  • Identify user
  • CookieSync
With the custom consent resolution mechanism, you can provide granular consent instead of a blanket boolean (yes/no) for all SDK purposes. We recommend the following SDK configurations for the above scenario:
Code
{

useConsent: true,

checkForCMP: false

}
After you have set up the SDK configurations, you can invoke the setConsent method as mentioned below.
window.zeotap.setConsent({ track: true, identify: false, cookieSync: true })

Capturing User Identities

With Collect SDK, you can collect User Identities (PIIs like email and cellphone number along with Custom Identities). The identities collected are then persisted across all the upcoming event-capturing calls. To persist user identities across the event payloads, invoke the setUserIdentities method and not the setUserProperties method. In order to persist user identities, you can use the setUserIdentities method as follows:

Case 1: Incoming identities are raw and can be sent to Zeotap CDP as is

SDK Configurations:
Code
{
areIdentitiesHashed: false,
hashIdentities: false
}

setUserIdentities method:

window.zeotap.setUserIdentities({
email: 'xyz@gmail.com', // User PII
crmID: '12345' // Custom Identity
})

Case 2: Incoming identities are raw and need be sent to Zeotap CDP after hashing

SDK Configurations:
Code
{
areIdentitiesHashed: false,
hashIdentities: true
}

setUserIdentities method:

window.zeotap.setUserIdentities({
email: 'xyz@gmail.com', // User PII, will be hashed
crmID: '12345' // Custom Identity, consumed as is
})

Case 3: Incoming identities are hashed

SDK Configurations:
Code
{
areIdentitiesHashed: true
}

setUserIdentities method:

window.zeotap.setUserIdentities({
email_sha256_lowercase: '32e19a491662fd86de7d3806b1199b76f0ee44e928d3475f05b0c8a59912c097',
crmID: '12345' // Custom Identity, consumed as is
})

Google Analytics Settings

With the Collect SDK, you can provision optional capturing of the GA client Id and user Id cookies for retargeting purposes on platforms like Optimize 360. To allow the SDK to capture the GA cookies, add the following configurations to the window.zeotap.init(WRITE_KEY, { .... }) call:
Code
{

//If set to false , Google Analytics ClientId will not be forwarded in POST calls allowGAClientId: true,

// cookie prefix for Google Analytics Client ID, if set with <value>, GA Client Id cookie fetch with name as '<value>_ga' gaClientIdCookiePrefix: 'client',

// cookie name for Google Analytics User ID, if set with <value>, GA User Id cookie fetch with name as 'value' gaUserIdCookieName: 'user_ga'

}
Last modified on February 26, 2026