How to Reference the Plugin's dataLayer inside GTM
-
This plugin looks awesome for getting WP sites instrumented with GA via GTM. However, I am having a problem figuring out how to reference the dataLayer created by your plugin from inside of GTM.
It seems that the dataLayer created by your plugin is an Array of objects. Therefore, if I want to reference pageCategory, I need to use:
dataLayer[0].pageCategory
See the image here: https://i.imgur.com/G9zrK5B.jpg
However, when I am creating a variable inside of GTM, I have not way to access dataLayer[0]. I have to simply reference “pageCategory”.See the image here: https://i.imgur.com/KiUMkU3.jpg
I feel like I am missing something fundamental here. Looking forward to your response!
https://www.ads-software.com/plugins/duracelltomi-google-tag-manager/
- The topic ‘How to Reference the Plugin's dataLayer inside GTM’ is closed to new replies.