All methods are called on the global zeotap object (or window.zeotap). They’re queued safely until the SDK has loaded, so you can call them immediately after the snippet.
setPageProperties
Logs a page-view event and attaches page-level properties to every subsequent event on the same page.
zeotap.setPageProperties({ name: 'Product' });
| Parameter | Type | Description |
|---|
properties | Object | Page-specific properties. |
Sample payload
{
"event": {
"eventName": "pageView",
"eventTimestamp": 1584350000
},
"page": {
"name": "Product Page",
"url": "https://www.xyz.com/products",
"path": "/products"
},
"User": {
"zi": "user_123",
"zs": "session_123"
}
}
If you don’t call setPageProperties, the SDK still attaches page.url, page.path, and the referrer URL by default to every event payload.
setEventProperties
Tracks a named event with arbitrary properties.
zeotap.setEventProperties('viewProduct', {
productID: 'prod_123'
});
| Parameter | Type | Description |
|---|
eventName | String | Name of the event. |
eventProperties | Object | Properties attached to this event. |
Sample payload
{
"event": {
"eventName": "viewProduct",
"productID": "prod_123",
"eventTimestamp": 1584350000
},
"page": {
"url": "https://www.xyz.com/products/?pid=prod_123",
"path": "/products/?pid=prod_123"
},
"User": {
"zi": "user_123",
"zs": "session_123"
}
}
setUserProperties
Sends user attribute information attached to the current zi (and any identities set via setUserIdentities).
zeotap.setUserProperties({
age: 25,
gender: 'Male',
country: 'IND'
});
country and city are blacklisted for ingestion — Zeotap derives these from the IP address. See blacklisted fields for the full list.
PII reserved keys (email, cellno, loginid, fpuid) passed to setUserProperties are hashed before being sent, the same as setUserIdentities. Prefer setUserIdentities for identities so they persist across events; use setUserProperties for everything else.
Sample payload
{
"event": {
"eventName": "set_user_properties",
"eventTimestamp": 1584350000
},
"page": {
"url": "https://www.xyz.com/post_login",
"path": "/post_login"
},
"User": {
"age": 25,
"gender": "Male",
"country": "IND",
"zi": "user_123",
"zs": "session_123",
"email": {
"sha256": "f42d22f9a2de86d9ee38e8e7dee54ecfefca679b8276991a4ecb056f2cd008cb",
"sha1": "7790bb717a66e6c379fd46b4b687cdef3ec0d98b",
"md5": "a8c358b62218df2b0319828ef89949e2"
}
}
}
setUserIdentities
Captures user identities that persist across events. Identities fall into three categories: raw PII, hashed PII, and custom identities.
Identities passed via setUserIdentities are stamped in storage and persisted on every subsequent server call until you call unsetUserIdentities.
Raw PII
When you have raw PII and want either the SDK to hash it (hashIdentities: true) or to forward it as-is (hashIdentities: false).
zeotap.setUserIdentities({
email: 'john.doe@gmail.com',
cellno: '45454545'
});
| Scenario | SDK options | Behavior |
|---|
| Forward raw PII as-is | areIdentitiesHashed: false, hashIdentities: false | Sent unchanged. |
| Let the SDK hash | areIdentitiesHashed: false, hashIdentities: true | SDK applies sha256 (lowercase + uppercase), sha1, md5 before sending. |
| Parameter | Type | Description |
|---|
[properties.fpuid] | String | First-party ID for a given user (CRM ID, DB ID, etc.). |
[properties.email] | String | User’s raw email address. |
[properties.cellno] | String | User’s raw cell phone number. Recommended format: code<space>number. |
[properties.loginid] | String | User’s login ID. Always hashed before logging. |
Hashed PII
When you’ve hashed PII client-side and want to send the hashes directly.
zeotap.setUserIdentities({
email_sha256_lowercase: 'f660ab912ec121d1b1e928a0bb4bc61b15f5ad44d5efdc4e1c92a25e99b8e44a',
cellno_with_country_code_sha256: '...'
});
Set areIdentitiesHashed: true in init() options.
sha256 hashes must be hex with 64 characters.
Supported hashed PII keys
| Field | Available hash variants |
|---|
| Email | email_sha256_lowercase, email_sha256_uppercase, email_md5_lowercase, email_md5_uppercase, email_sha1_lowercase, email_sha1_uppercase |
| Cell phone (without country code) | cellno_without_country_code_sha256, cellno_without_country_code_md5, cellno_without_country_code_sha1 |
| Cell phone (with country code) | cellno_with_country_code_sha256, cellno_with_country_code_md5, cellno_with_country_code_sha1 |
| Login ID | loginid_sha256_lowercase, loginid_sha256_uppercase, loginid_md5_lowercase, loginid_md5_uppercase, loginid_sha1_lowercase, loginid_sha1_uppercase |
For hashing rules and recommended preprocessing, see Zeotap hashing guidelines.
Custom identities
Any first-party identifier outside the reserved PII keys — crmID, ECID, visitorID, etc. Custom identities are always forwarded as-is; hashing flags do not apply.
zeotap.setUserIdentities({ crmId: '12345' });
unsetUserIdentities
Clears persisted identities. Use this when a user logs out so subsequent events aren’t stitched to the logged-in profile.
zeotap.unsetUserIdentities(['email', 'cellno']); // remove specific keys
zeotap.unsetUserIdentities(); // remove all identities
| Parameter | Type | Description |
|---|
[removedPropertyKeys] | Array | If provided, only these keys are removed. If omitted, all identities are cleared. |
setConsent
Records the user’s consent decision. The shape of the value depends on which consent strategy you’ve configured. See Consent Resolution for the full guide.
zeotap.setConsent({ track: true, cookieSync: true, brandConsent: true });
Quick reference