google-analyticsgoogle-tag-managerdata-layer

Using a DataLayer with Google Analytics without using Tag Manager


I am working on a project where I am integrating analytics into a website. I am very interested in using a Data Layer like the one described in this article,

https://developers.google.com/tag-manager/devguide

However, this tutorial only defines how to use a data layer when using Google Tag Manager. If I am using a different tag manager, like BrightTag or OpenTag, is there anyway to hook Google Analytics into a Data Layer using just JavaScript?

Thanks! DS


Solution

  • OpenTag has it's own specification for a data layer - they call it "universal variable", specs are here: https://github.com/QubitProducts/UniversalVariable. Presumably BrightTag uses yet another format

    Updated to add: Brighttag is now Signal and they do not seem to use a standardized format, they simply grab global variables - but of course you still can declare an object to create a pseudo-namespace and minimize naming collisions, and pick your values from that object

    There seems to be no commom specification which would be compatible with multiple/all Tag Management Systems.

    So yes, you can use some kind of data layer with other Tag Management Systems but it might be called differently and how it will be implemented depends on your platform of choice.

    Updated to add: Also keep in mind that the GTM dataLayer does not just contain key/value pairs, the GTM code also overwrites the native push method for the dataLayer array. That might be a concern if you plan to use multiple tools that manipulate the dataLayer variable at once.