tabler logo Tushar Gupta's Blog GTM Audit Tool
tgupta logo Tushar Gupta's Blog

Datalayer QA: Guidelines for troubleshooting

February 16, 2019 in Analytics

Datalayer is a crucial part of analytics tracking, and its equally important to QA it before sending to production. The common problem is that, the developers generally have hard times to understand how the datalayer object should perform or what values must it contain.

This post will help you to compile points for sending to your developers and ensure they did proper implementation of the datalayer.

In my opinion, here are the basic steps that must be followed

  1. Ensure datalayer is defined before GTM tag.
  2. There should be an event key for every datalayer push.
  3. The variable definition in GTM must match against the keys in the datalayer.
  4. The naming conventions are followed from the tracking plan
  5. The datalayer push is happening only on the desired actions.
  6. Debug in Preview mode from GTM to check the tags getting fired.
  7. Remove unused dataLayer variables.

Key : Value Explanantion

In simple terms, the data in datalayer object is in the form of key : value pairs.

  
    dataLayer.push({
       'key': 'value'
     });
  

A simple dataLayer push looks like below:

  
    dataLayer.push({
       'event': 'custom_event'
       'color': 'red',
       'conversionValue': 50
     });
  

  • The value of this event key [in our example, 'custom_event'] will be mapped to the GTM tag trigger. Thus its very important to ensure that the key's value must match to tracking plan provided by analyst for each push.
  • Other keys present will be used as variables to store the repective values. Thus making sure the values populated are in line to tracking plan is very important

Final Thoughts

The datalayer is something which takes a lot of time for implementation. And after that it comes to making sure the data present makes sense and is good to report upon. Thus testing and troubleshooting of datalayer is very important for every type of business.

P.S: This is my first blog post, and so I would love if you can leave a comment so that I can improve :)


Related topics