further-external / loews-dl-spec-ga4

An Apollo generated Event Driven Data Layer
0 stars 1 forks source link

loews-dl-spec-ga4

Overview

This repository contains the necessary specifications to build an event driven data layer and install GTM on your web application.

Google Tag Manager Deployment

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:

  1. In Google Tag Manager, click Workspace

  2. 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.

  3. Copy and paste the code snippets into your website as instructed in the Install Tag Manager box.

Implement the Code Snippets in the of the Sample HTML Page

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 tag in your HTML output.

Data Layer

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.

Questions/Comments

For any questions or comments, please contact anne.wilson@searchdiscovery.com.