What this is
Google Tag Manager (GTM) is a source: data flows into Zeotap CDP. The Zeotap Collect Tag runs on your website through your GTM container, captures events and user information as customers navigate the site, and sends them to Zeotap CDP. The tag is asynchronous and does not affect the loading of the site or the end-user experience. This page covers the GTM side of the integration. The Zeotap side, creating the source and reading its write key, is covered in Create a Tag Manager source. For an overview of the connector, see Google Tag Manager. There are three main parts to GTM:- Tags – Snippets of JavaScript or tracking pixels.
- Triggers – This tells GTM when or how to fire a tag.
- Variables – Additional information GTM may need for the tag and trigger to work.
Supported identifiers
Configure these in the Login and identities setting section of the tag, except the Google Analytics client ID, which sits under Google Analytics Configurations. Each identifier is read from adataLayer variable or cookie that you select.
User attributes are configured in Login and identities setting too, but they are not identifiers: they carry user-related information alongside the identities.
Prerequisites
- A Google Tag Manager account, with the GTM container installed on your website. For more information about tags, accounts and containers, and how to set them up, refer to Google’s Setting up and Installing Tag Manager.
- A data layer on your website that carries the events and user information you want to collect.
- A Google Tag Manager source in your Zeotap CDP account, which supplies the write key the tag needs.
- For Method 2 of adding the template only: the template file, shared as a
.tplfile. Check with your Zeotap Product Operations Manager for it.
Create the Google Tag Manager source
Create the source in Zeotap CDP before you configure the tag — the Write Key is issued with the source and is mandatory for recording events. Follow Create a Tag Manager source, then come back here with the write key from the source details.Add the Zeotap Collect Tag template
You can add the Zeotap Collect Tag template in one of the following ways.Method 1: add the template from the gallery
1
Log into your GTM account and click Templates from the left menu.
2
Under Tag Templates, click Search Gallery on the top-right corner.

3
Search and choose Zeotap Collect Tag Template from the list.
4
Click Add to your workspace to add the tag template for further usage.
Method 2: import the template file
1
Check with your Zeotap Product Operations Manager for the template file. It is shared as a
.tpl file.2
Log into your GTM account and click Templates from the left menu.
3
Under Tag Templates, click New on the top-right corner.
4
In the top-right corner, click the vertical ellipses and select Import.

5
Select the
.tpl file shared in step 1 above.6
Name the template as Zeotap Collect Tag and save it for further usage.
Add the tag
Once you have added the tag template, the next step is to add the tag.1
Log into your GTM account and click Tags from the left menu.
2
Click New and name the tag descriptively. For example, Zeotap Collect.
3
Click Tag Configuration and search for Zeotap Collect Tag Template. The tag is listed under Custom.
4
Click Zeotap Collect Tag Template, then configure it as described in Configure the tag.

Configure the tag
The tag configuration is divided into the following sections.
Initialisation options
Expand Initialisation Options and enter the following details:- Write Key – When you create a GTM-based source in your Zeotap CDP account, a write key is provided in the source details. This is a mandatory field for recording events.
- User Country – This is the ISO Alpha 3 country code that is used to determine the region for storage. If this country code is not sent, then the Zeotap servers use the IP address to determine the same. Therefore, use this country code if your account is set up only for specific regions.
- Event Key – This is the key against which event names are stored in the
dataLayerobject. You can choose not to fill this if you are using GTM’s default key,event. - Data Persistence – In case of multi-domain websites, the identifiers are reset once the user navigates to a webpage with a different domain name. In such scenarios, you can select the Persist data in cookie storage check box, which continues to store their identifiers in the cookie storage, irrespective of the domain name of the web page they browse through.
Configure consent settings
Under Configure Consent Settings › Primary Consent, pick a Primary Consent Method. The Zeotap Collect Tag has three options that can be used to determine consent actions.-
Default Opt-in – This option sets the
optOutoption tofalseand is used to record events. Choose this option to fire the tag only for the consented users. The consent communication happens through other methods such as your own API integration, file upload and so on. You can also use the options available under Additional Consent Settings to send TC String and custom brand consent.
-
Check TCFv2 CMP (GDPR) – This option sets the
useConsentandcheckForCMPoptions totrue. The JS automatically checks for the presence of thecmp.jsscript and the__cmpvariable in the global scope. The JS also queries theTCF APIto fetch the latest publisher consent before recording the events on each JS load. Ensure that you configure the parameter Purposes for tracking of events while using the GDPR consent module. This option is used to pass a list of purpose IDs, based on which you can manage the consent for tracking. By default, the three options shown in the image below are selected. However, you can modify them based on your requirement. You can also use the option available under Additional Consent Settings to send custom brand consent.
-
Custom Consent – Select Custom Consent as the Primary Consent Method, then specify the following under SDK Consent Signals:
- Event name indicating that consent is set – Choose the
dataLayerevent that is fired when custom consent is set. - Track, Identify and Cookie Sync – Choose the
dataLayervariables that set the values of these consent signals.
You can also use the option available under Additional Consent Settings to send TC String and custom brand consent.
- Event name indicating that consent is set – Choose the
Track page views and events
Expand Track page views and events and enter the following details:- Page View Tracking Event Name – By default, page views are tracked for the
gtm.jsevent name. When using some other event name, ensure to update that event name in the input for overriding. - Event Tracking – Enter a regex pattern that matches all the event names you want to track. If you want to track just a single event, then just enter that event name. By default, the
.*pattern is used to identify the events. - Special Events – If you want to track event names apart from the regex provided, then add all such events here.
- Pre Defined Properties – Input the properties that you want to attach or override. You can either define the values from your variables or provide static values for them.
- PII to be excluded – Enter all the PII and user-related fields in the
dataLayerthat need to be excluded from the event properties. For example, email is pushed into thedataLayerin the raw form. This option is also used to exclude other non-essential keys that need not be recorded.
The records for the
country and city columns are blacklisted for ingestion because Zeotap uses the user’s IP address to find out the country and city automatically. For the complete list of blacklisted fields, see Blacklisted fields for data ingestion.Login and identities setting
Expand Login and identities setting and enter the following details:-
Login Event – Choose the
dataLayerevent that is fired on user login. -
Are your identities hashed? – Based on whether you want your identities to be hashed or not, perform one of the following actions:
-
If your identities are hashed – Select this checkbox and make the following selections for the identities:
- Hashed Email – Select the Capture hashed email checkbox and then proceed to add a row for the hash algorithm. Click Add Row and then choose the appropriate Hash Algorithm and its corresponding Hashed Email Variable from the drop-down menus. You can add more rows as per your requirement.
- Hashed Cellphone with country code – Select the Capture hashed cellphone number with country code checkbox and then proceed to add a row for the hash algorithm. Click Add Row and then choose the appropriate Hash Algorithm and its corresponding Hashed Cellphone Number Variable from the drop-down menus. You can add more rows as per your requirement.
- Hashed Loginid – Select the Capture hashed Loginid checkbox and then proceed to add a row for the hash algorithm. Click Add Row and then choose the appropriate Hash Algorithm and its corresponding Hashed Loginid Variable from the drop-down menus. You can add more rows as per your requirement.
- If your identities are not hashed – Then do not select this checkbox and proceed to the next option.
-
If your identities are hashed – Select this checkbox and make the following selections for the identities:
-
Is hashing of raw identities required? – Based on whether you want to hash the raw identities or not, perform one of the following actions:
-
If hashing of the raw identities is required – Select this checkbox and make the following selections for the identities:
- Raw Email – Select the Capture Email checkbox and then choose the appropriate Email Variable from the drop-down menu.
- Raw Cellphone with country code – Select the Capture cellphone number with country code checkbox and then choose the appropriate Cell number variable from the drop-down menu.
- Raw Loginid – Select the Capture Loginid checkbox and then choose the appropriate Loginid Variable from the drop-down menu.

-
If hashing of the raw identities is not required – Then do not select this checkbox and proceed to the next option.
To know about the hashing guidelines for email addresses and cell phone numbers, see Hashing guidelines.
-
If hashing of the raw identities is required – Select this checkbox and make the following selections for the identities:
- Create First Party ID+ cookie on user login – If you are a publisher who is using Zeotap’s ID+ services, then ensure to select this checkbox to activate the ID+ calls.
- Organisation partner ID – This ID is provided by Zeotap after enabling ID+ for your organisation. Ensure that the ID is properly added.
-
User Logout – Specify the
dataLayerevent that captures the user logout. The same event is used to unset the email address, phone number or loginid from the subsequent events. -
User Attributes – Specify the
dataLayervariables that contain user-related information. The same variable is passed in thesetUserPropertiescall.
If you are implementing ID+ rather than event collection, see the Google Tag Manager implementation guide, which covers the separate Zeotap IDP tag template.
Google Analytics configurations
If you want to capture IDs relating to your Google Analytics (GA) account for ID completeness, reporting or outward integration, you can configure the settings in this section to capture the same.-
Pick Google Analytics client ID – Select this checkbox if you want the Zeotap tag to pick the Google Analytics client ID that is used for user identification.
- GA Client ID Cookie Prefix – If your GA cookie is configured with a cookie prefix, you can add the same here. For example, a typical GA cookie that was named
_gamay be configured with a brand name prefix in your GA settings; you can configure the corresponding cookie name here.
- GA Client ID Cookie Prefix – If your GA cookie is configured with a cookie prefix, you can add the same here. For example, a typical GA cookie that was named
- Use only for Login Event – If this checkbox is selected, then the GA user ID is attached only for the post-login events.
Advanced settings
Under the Advanced Settings section, choose the Once per event option from the Tag firing drop-down menu. Only this option is supported. You need not make any other selection under Advanced Settings.Set up the trigger
The inputs for the template help the tag to track all the relevant events happening on the web application, so the recommended trigger is for all the real events that you want to capture using the tag. The following are the various events for which you can fire the tag:- If you want to fire the tag only for tracking page views, then use the All Pages built-in trigger.
- If you want to fire the tag to capture all the events, then use the All Events trigger.
Method 1: create the trigger first
1
Go to the Trigger Configuration section from your left menu.
2
Click New to add a trigger.
3
Provide a descriptive name for the trigger.
4
Click anywhere on the Trigger Configuration block. This opens the Choose trigger type slider window on the screen.
5
Under Other, choose Custom Event as the Trigger Type.
6
Type ‘Login event’ as the event name.
7
Select the Use regex matching checkbox to add your own regex, if your events follow a specific naming convention. Type
^(?!gtm\.load)(?!gtm\.dom).* if you want to set this regex for all the events.This regex sets the trigger for all the events except GTM’s internal events,
gtm.load and gtm.dom.8
Select the All Custom Events radio button. Note that the trigger is set for the login event only.
9
Click Save.

10
In the tag, add this as the trigger for the Zeotap Collect tag. This means an event collection call is fired for each event on the website.

Method 2: create the trigger while configuring the tag
You can also set a trigger on a tag while configuring it, from the Tag Configuration section.1
Navigate to the Tag Configuration section of the tag to which you want to attach a trigger.
2
Click + under the Triggering section.
3
In the Choose a trigger window that appears, click +.
4
Choose Custom Event as the Trigger Type.
5
Type your ‘Login event’ as the event name.
6
Select the Use regex matching checkbox to add your own regex, if your events follow a specific naming convention. Type
^(?!gtm\.load)(?!gtm\.dom).* if you want to set this regex for all the events.This regex sets the trigger for all the events except GTM’s internal events,
gtm.load and gtm.dom.7
Select the All Custom Events radio button. The trigger is set for the login event only.
Verify the configured Collect tag
After you have added the Zeotap Collect Tag, configured it and set the trigger, perform the following steps to evaluate how it works:1
Click Tags from the left menu. Of all the tags that are listed, ensure that your tag is in an inactive state and has not been paused.
2
Click the Preview button that appears on the top right corner. You are taken to the Tag Assistant page.
3
In the Google Tag Assistant window that appears, enter the website where you have integrated the GTM and then click Start.
4
You are redirected to the website URL that you had entered. Perform any action on the website.
5
After performing any action on the website, right-click on the web page and click Inspect.
6
Go to the Console tab of the DevTools window that opens and, under
dataLayer, look for the event name that you have configured.7
Go back to the Tag Assistant window and click Continue.
8
Under Tags Fired you can find the tag that was fired.
Troubleshoot the Google Tag Manager source
The Zeotap Collect Tag never fires
This is most often a consent configuration that the site cannot satisfy: Check TCFv2 CMP (GDPR) is selected as the Primary Consent Method, but no TCF CMP API is available on the page, so the tag never gets consent to track. Check the consent method the tag is actually using, and whether the CMP API is present, from the browser:1
Accept consent on the website first, then open your browser’s developer console.
2
Enter
zeotap.getConfig(). If checkForCMP and useConsent are both true, the tag is using the TCF CMP consent method.3
Enter
_tcfapi. An error means the TCF CMP API is not set up correctly on the website. If it resolves, the blocker is elsewhere in the implementation.GTM’s own events are arriving as data
Event names such asgtm.elementClasses or gtm.historyChangeSource are produced by GTM’s built-in variables rather than your data layer. They arrive when the trigger’s regex is broad enough to match them. Either narrow the Event Tracking regex to the event names you want, or click Add Exception under Triggering on the tag and add a trigger that excludes them.
Options described here are missing from the tag
The template in your workspace may be older than the one described here. When GTM flags that a newer version of the gallery template is available, accept the update and reopen the tag — newer options only appear once the updated template is applied.The tag fires but no data reaches the source
Confirm in Tag Assistant that the tag appears under Tags Fired, and that the Write Key in the tag matches the write key shown in the source details in Zeotap CDP. If events are arriving but fields are missing downstream, the catalogue mapping for the source is the next thing to check — see Map the catalogue for customer data.Next steps
- Create a Tag Manager source: the Zeotap-side source and its write key.
- Map the catalogue for customer data: make the collected events usable in Zeotap CDP.
- Knowing the fields on the Preview Data tab: confirm incoming data on the source.
- Introduction to Zeotap GTM Tag: the full per-section reference for the Collect Tag template.
- Hashing guidelines: hashing rules for email addresses and cell phone numbers.