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 the
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.
For any questions or comments, please contact emma.anderson@searchdiscovery.com.