You can use your Google Tag Manager (GTM) to implement your CHEQ tag on your website. The process of the implementation consists of implementing the invocation tag and the <noscript>
tag and validating that the tags were implemented in the GTM successfully.
Base Tag Implementation
Implement Invocation Tag
Before adding the tag to GTM, you will need to copy the script tag and paste into the a text editor for use later.
First, find your CHEQ tag and go ahead and click the Copy content_copy icon for the invocation tag script. Now go to Google Tag Manager and create a Tag.
It should look something like this:
Field | Description | Example |
Tag Type | Select Custom HTML. | Custom HTML |
Name (Recommended) | Some name that makes sense. This doesn't impact functionality. | CHEQ Tag |
Support document.write | Ensures the script that's posted is secure and triggers the right way. | Checked |
Tag firing priority | Something over 9,000 just to ensure it triggers first. | 9999 |
Click Save in the top-right. Validate the tag by Previewing the Workspace and then Publish!
Implement the <noscript>
Tag
Before starting, Find your CHEQ <noscript>
tag and go ahead and click that Copy content_copy icon for the <noscript>
tag. To implement this, we will need 3 elements: a Variable, Trigger, and a Tag.
In Google Tag Manager, create a Custom JavaScript Variable by going to the Variables section and clicking New.
Field | Description | Example |
Variable Type | Select Custom JavaScript. | Custom JavaScript |
Name (Recommended) | Some name that makes sense. This doesn't impact functionality. | JS Enabled |
Custom JavaScript | The custom JavaScript that is pasted into the code editor. | function() { return true; } |
Click Save.
Next, navigate to the Triggers section and click New to create a Trigger to fire the tag for when users' JavaScript is disabled.
Field | Description | Example |
Trigger Type | Select Initialization. | Initialization |
Name (Recommended) | Some name that makes sense. This doesn't impact functionality. | JS is Disabled |
Trigger fires on | If users have JavaScript, it will return true - and we want the opposite of that. | JS Enabled does not contain true |
Click Save.
Finally, head to the Tags section and click New to create the image Tag that will load for users without JavaScript enabled.
Field | Description | Example |
Tag Type | Select Custom Image. | Custom Image |
Name (Recommended) | Some name that makes sense. This doesn't impact functionality. | CHEQ No-Script |
Tag firing priority | Something over 9,000 just to ensure it triggers first. | 9999 |
Click Save.
Make sure you validate the tag (it shouldn't fire unless you have JavaScript disabled) and then Publish the Workspace.
Data Layer Integration
The Data Layer Connector allows CHEQ Analytics users to quickly and easily plug CHEQ data into Google Tag Manager. To use this, you must first implement the CHEQ Invocation Tag referenced in the previous section.
Configure the Data Layer Connector to use Google Tag Manager's standard data layer object name named dataLayer
, as shown below (there's a very small chance your analytics developer has modified this name):
Detecting Data Layer Updates
An event is assigned in every payload which will proactively signal that the user’s status has changed (for instance, from Valid to Malicious). This event will trigger every time the status is changed, including the first time it is set. This is especially useful to eliminate race conditions because users can trigger a server call when the status is set instead of relying on the data to be sent with the pageview payload.
Note: Please ensure you have considered implications on hit volume in your analytics tool, as the event currently triggers once per page. Please consider limiting the tag to trigger once per Visit.
The following example is used to build a Trigger in Google Tag Manager:
Field | Description |
Name | User-defined name of the Trigger. |
Trigger Type | Select Custom Event. |
Event Name | Whatever the value was set for the Event in your Data Layer connector settings. |
This trigger fires on | Select All Custom Events. |
Creating Variables
Navigate to the Google Tag Manager property and create a new Variable to store your value(s) from the Data Layer Push connector. In most cases, you will create a Variable for each Key specified in the Data Layer Connector (see below).
Note: Add a Key:Value pair for each data point you would like to send to your data endpoint (like Google Analytics).
The configuration for each Key should look something like this:
Field | Description |
Name | User-defined name of the variable. |
Variable Type | Select Data Layer Variable. |
Data Layer Variable Name | Represents a Key that was input from the Data Layer Connector interface. |
Data Layer Version | Select Version 2. |
Default Value | Optional. If there’s no value, fall back to some other value. |
From here, the Variable can be used in any Tag in your Property.
Next Step: Send CHEQ Data to Marketing Tools
Please refer to our guide(s) on how to send data to various endpoints from Google Tag Manager: