Unleashing the Power of the Data Layer in GTM

According to an article posted by Tech Crunch in 2017, ”the time U.S. users are spending in mobile apps is continuing to grow; according to new data released this week by analytics firm Flurry,  we’re up to 5 hours per day on our mobile devices.” With a large portion of our day being spent in the digital realm the need for digital content and creative is in high demand. In order to assess how well the content performs we use both Google Analytics and Google Tag Manager(GTM) to properly track and interpret the data. To ensure precise tracking it is extremely important to find unique attributes within each individual website event, which is where the data layer comes in handy.

The Data layer explained:

The Data Layer Explained

In layman’s terms, the data layer is a structure within a website that contains information being passed back and forth from the user to the server as shown in figure 1A when the user submitted a form with the title of “Contact Us”. In addition, the markup text (HTML) also contain data attributes that can act as a way to uniquely identify events, links, etc.  When a user visits a website or app any interaction that occurs during their session (such as click, submission, etc.) creates an event. These events push out information that can be viewed via GTM Preview mode or your browsers JavaScript console and appear in arrays as JSON objects. Each array starts with the event name (object) then followed by the info within the string made up of variable name and its corresponding key values. *Example provided below*

Que in Google Tag Manager:

JSON Data Structure

Thanks to the development of Google’s Tag Manager platform there is an improved method for pushing out data from the data layer; this is where you can attach triggers to fire the proper tags on your desired event(s). If you are looking to take it a step further or do not receive enough data from the pre-existing data layer you can inject a custom script to create your own events to be pushed out on wherever implemented. Utilizing the data layer structure in GTM helps ensure you have uniquely identified the event name by giving the trigger specific rules it must abide by in order to fire. For example, in figure 1A, the object contains the event of a Form Submission with the Title of “Contact Us”. If you wanted a form submission event with the title of “Contact Us” to be tracked and recoded, we could so by utilizing the data layer and setting a tag to fire with that specific criteria. By doing this, we are also able to ensure there is no missed conversions (site-wide) since the trigger will fire any time the event of “ddc.form.submission” occurs with the formTitle of “Contact Us”.

All in all, the Data layer serves many purposes, but unleashing the power and amount of data it holds will help you take you analytics skills to the next level. Contact us to find out how we can help bring you Analytics reporting to the next level.

Learn how Aronson can help your business grow!