Google Tag Manager(GTM) has some pretty good documentation about how to implement it with Google Analytics and other Google products. However, I wanted to pass some custom site variables directly into GTM and then to feed that data into a custom HTML tag that’s sitting inside the GTM container. I figured I’d outline the solution here in simple terms for all to see.
The Data Flow
GTM offers a simple way to pass custom site data into its container. This is done through the dataLayer object.
The dataLayer is an array that GTM asynchronously reads. Basically, it’s a table with your data as pairs of values.
For example, you want to pass your page category and the type of visitor that’s on the site in to your dataLayer. Continue reading How to read custom site data from the GTM dataLayer