How to test data layer variables in Google Tag Manager?

混江龙づ霸主 提交于 2019-12-03 13:23:15

The console is your friend. What I would do is type dataLayer into the console after dataLayer.push, then click on the last object in the array and you'll see your values.

For instance, I put the dataLayer.push on an onclick event and ran dataLayer and was able to see this come through. Granted they are static values, but you get the idea.

UPDATE:

Google Tag Manager has updated their debugger, allowing you to see both Names or Values being passed into GTM.

There is a Chrome extension called Google Tag Assistant that allows you to check if tags are getting fired as well as inspecting data coming through the dataLayer.

I had already been using this extension, but did not see my custom data layer variables. However, if you drill down through the tags, in Google Tag Assistant, you can see this other information (custom variables, etc). Note that, you need to ensure the tag is getting fired first.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!