This repository contains the necessary specifications to build an event driven data layer and install GTM on your web application.
The embed code is a script tag that you put on your web pages to load and execute the logic you build in GTM, including logic to configure and deploy tags for analytics, 3rd parties, and other Google services.
To install GTM on your web application:
In Google Tag Manager, click Workspace
Near the top right corner of the window, find your container ID, formatted as "GTM-XXXXXX". Click the container ID to launch the Install Tag Manager modal.
Copy and paste the code snippets into your website as instructed in the Install Tag Manager box.
Both code snippets should be implemented in the element of all HTML pages that will share the property. You might have one or several template files which control this globally across the site, making it a straightforward process.
Place the <script>
code snippet in the <head>
of your web page's HTML output, as close to the opening <head>
tag as possible, but below any Data Layer object settings.
Place the <noscript>
code snippet immediately after thetag in your HTML output.
Each file inside the events folder corresponds to a single use case or site event that needs to be implemented. These events are leveraged to trigger tracking rules in the tag management tool of choice and share data with the analytics reporting tool.
As the data layer is event-based, the order in which the events are fired is critical. In general, events should be pushed onto the data layer in the following sequence when a page load (virtual or otherwise) occurs:
Page Load Started > Other Page-level Events > Page Load Completed
If an Event is part of the page load sequence, it will be indicated in the corresponding event file.
Events that occur outside of the page load sequence should be pushed onto the data layer as they occur.
Data Layer events below should be fired:
contact_us: when users click any of the links to contact an expert (such as email, social, or download cv)
content_interaction: when users click on any CTA or links to download, print, or share content posts
register_event: when users click CTA to start an event or webinar registration.
donation_click: when users click CTA to start the donation form
interactive_click: when users click on any elements of the interactives (if not already tracked using Data Wrapper's integration)
navigation_click: when users click on any links on content navs such as primary and secondary navs, topics, or content modules on the homepage.
sign_up: when users click CTA to complete newsletter sign up
For any questions or comments, please contact jerry.bennett@searchdiscovery.com.