Data layer implementation - Google Tag Manager


(Oliver Kass) #1

Hi folks,

 

I'm trying to figure out the simplest solution for adding multiple GTM data layers to a Matrix site. The data layers have to be placed straight after the body tag and above the GTM code.

 

Would the best option be to create design customisations for each instance of a unique data layer and customise the body area to include the script? I'm also trying to get my head round if the GTM code could just be implemented in the master design but still appear after the data layer.

 

Any thoughts or tips from those already doing this in Matrix would be much appreciated,

 

Thanks

 

Oli 

 

 


(Gilles Olivier Guegan 1) #2

Hi Oli,

 

Are you trying to specify different data layer variables for different pages/sections of the site?

 

Unless it can't be helped, I'd avoid creating too many customisations, as that will get quickly out of hand.

 

Would creating a metadata field to hold the data work? You can then print that field through a design area on a single customisation. Drawback of this solution is having to set this field on each asset, if you have a lot of them.

 

Where your data layer variables and main GTM appear is just up to you and how you configure your design areas in your parse file.

 

Gilles


(Oliver Kass) #3

Hi Gilles,

 

Thanks for this. I think you're right, metadata could be the way to go. There may be a fair bit of hassle in the setup initially but once it's up and running it wouldn't be too tricky to maintain I suppose.

 

So I guess I just need one design customisation that prints the metadata field above the GTM code in the parse file? All the assets that have the data layer metadata filled out would then also need this customisation applied to them?

 

Oli