Skip to main content

What this is

The Zeotap Web JavaScript SDK (zeotap.js) is a client-side library you embed in your website’s <head> tag to send first-party data — page views, events, user identities, user properties, and consent — into your Zeotap CDP account. In the CDP, the Web JS source is the object that receives every payload the browser posts against its write key, then makes the data available for segmentation, insights, and activation to your downstream platforms. This page covers the source side end-to-end: what the Web JS source is, how to create one, how to wire the snippet into your site, how to handle consent, and how to confirm data is landing.
Looking for the developer reference? The Zeotap Web JavaScript SDK developer documentation covers installation, configuration options, the full API reference, consent management, and release notes. This page focuses on creating and operating the Web JS source inside the Zeotap CDP.

Prerequisites

Before you configure the Web JS source, confirm that:
  • You have access to the Zeotap CDP instance for your workspace.
  • A Consent Management Platform (CMP) is integrated on the site the SDK will run on, if your consent strategy is anything other than the default opt-in.
  • You can edit the HTML of the pages you want to track, or push a change through your tag manager.

Create the Web JS source

The source holds the write key, region, and incoming-data preview for a given site (or set of sites). Every SDK payload posts against that source’s write key.
  1. In the Zeotap CDP app, go to the Sources application under Integrate.
  2. Start a new source and pick Website Events as the category, then Web JavaScript as the data source.
  3. Give the source a short descriptive name, add the website URL (recommended so you can track which sites are onboarded), and select the region of upload.
  4. Save the source. The new entry appears on the Sources listing page — open it to see the snippet code and write key on the Implementation Details tab.
For the full walkthrough, see Creating Web JS Source.

Add the SDK snippet to your site

Copy the snippet from the Implementation Details tab and paste it into the <head> tag of the pages you want to track. The snippet initialises the SDK with your write key and the default options.
Replace YOUR_WRITE_KEY with the write key from the Implementation Details tab. The snippet exposes window.zeotap, which your page code uses to call setPageProperties, setEventProperties, setUserProperties, setUserIdentities, and setConsent.
Paste the snippet into the <head> tag of every page you want to track.
The SDK honours user consent through options passed to init:
  • useConsent: true — the SDK waits for a consent signal before capturing events, identifying the user, or running cookie sync.
  • checkForCMP: true — the SDK queries the __cmp API on the page for the publisher’s consent. Use this when your site runs a TCF-compliant CMP.
  • checkForCMP: false — the SDK uses the consent you provide via setConsent. Use this for a custom consent flow where you supply granular signals per SDK purpose.
For a custom consent flow, provide the granular signals after init:
For the recommended configurations per consent type (TCF, Custom, Default Opt-in), see Best Practices for Web JS SDK.

Verify data is landing

Once the snippet is live and users hit instrumented pages, open the source you created and go to the Preview tab. Incoming payloads appear there as the SDK posts them. When you see records with the event names and properties you called on the client — pageView, your custom event names, page URL and path, identity fields — the source is receiving data. If the Preview tab stays empty after the snippet is live, work through the troubleshooting checks below.

Troubleshooting

The snippet is on the page but no events reach Preview

Confirm the write key in your snippet matches the one on the source’s Implementation Details tab. A mismatched or stale write key posts against a different source, so the current source’s Preview stays empty.

Events fire in the browser but nothing lands in the source

When useConsent: true is set and the SDK has not received a consent signal, it stays idle and does not post. Either supply the consent signal through your CMP (with checkForCMP: true) or call setConsent explicitly (with checkForCMP: false). Until one of those happens, the SDK captures nothing.

Identities are set on the client but do not stitch to profiles

The keys you pass to setUserIdentities — for example email, cellno, crmID — must match the source field names configured for your write key. Unrecognised keys are dropped silently. Compare the keys in your setUserIdentities call against the source field configuration for this source.

When to contact support

Contact your Zeotap customer success representative if:
  • The Preview tab remains empty after you have confirmed the write key, verified consent is granted, and checked that events fire in the browser console.
  • You see records in Preview but they do not appear in downstream segments or activations.
  • The SDK throws an initialisation error the browser console does not resolve after you re-copy the snippet from Implementation Details.
Include in your request:
  • The source ID and a live URL where the SDK is loaded
  • The write key (or a partial identifier) so support can match it against the source
  • A browser HAR export or console log showing the SDK call and the outbound network request
  • The init options passed on the page (redact any secrets)

FAQ

For a standard multi-page website, add the snippet to the <head> tag of every page you want to track. For a single-page application, add it once in the root index.html; it persists across client-side route changes.
Both are supported. With areIdentitiesHashed: false and hashIdentities: true, the SDK hashes raw PII (email, cell number) to SHA-256 before posting. With areIdentitiesHashed: true, the SDK treats the values as already hashed and forwards them as-is (SHA-256 hashes must be 64-character hex). Custom identities such as crmID are always forwarded as-is regardless of the hashing options.
Yes — a single Web JS source and write key can serve multiple sites. To distinguish traffic by site in reporting or segmentation, add page properties (for example, the site name) via setPageProperties on each site.
Call zeotap.unsetUserIdentities() on logout to remove all stored identities from the browser, or pass an array of specific keys — for example zeotap.unsetUserIdentities(['email', 'cellno']) — to remove only those.

Next steps

Last modified on November 18, 2026