Comments on: GTM dataLayer.push Examples (Standard, Ecommerce, Advanced) https://mixedanalytics.com/blog/gtm-data-layer-push-examples-standard-ecommerce-nested-arrays/ APIs, Sheets, and Analytics Thu, 25 Feb 2021 08:43:25 +0000 hourly 1 https://wordpress.org/?v=6.5.5 By: Ana https://mixedanalytics.com/blog/gtm-data-layer-push-examples-standard-ecommerce-nested-arrays/#comment-11293 Thu, 24 Oct 2019 15:47:30 +0000 https://mixedanalytics.com/?p=7492#comment-11293 In reply to Anonymous.

Not sure I totally understand what you're asking, but yes you could put these data layer pushes into a custom HTML tag if you wanted. Let me know if that answers your question.

]]>
By: Anonymous https://mixedanalytics.com/blog/gtm-data-layer-push-examples-standard-ecommerce-nested-arrays/#comment-11292 Thu, 24 Oct 2019 15:29:18 +0000 https://mixedanalytics.com/?p=7492#comment-11292 Can I simply call these like any other JS var in my custom HTML tag?

]]>
By: Ana https://mixedanalytics.com/blog/gtm-data-layer-push-examples-standard-ecommerce-nested-arrays/#comment-6685 Fri, 29 Mar 2019 16:31:35 +0000 https://mixedanalytics.com/?p=7492#comment-6685 In reply to Mike.

Hey Mike, that should work fine. GTM will pick up any data layer pushes automatically, so you don't need to do anything else. However, you can't do anything with these values until you push them into triggers and variables. So if you're pushing an event called trackEvent into the data layer, in GTM you now need to go to Triggers > New > Custom Event and enter Event name = trackEvent. Similarly, if you've pushed a key named pageType into the data layer, in GTM you should go to Variables > New > Data Layer Variable and enter Data Layer Variable Name = pageType. Then you can use trackEvent as a trigger, and push pageType into any of your tags.

]]>
By: Mike https://mixedanalytics.com/blog/gtm-data-layer-push-examples-standard-ecommerce-nested-arrays/#comment-6680 Fri, 29 Mar 2019 15:17:15 +0000 https://mixedanalytics.com/?p=7492#comment-6680 I’m having a little trouble getting this to work and I’m not sure how I can go about debugging it. I think I’ve followed the directions in the article properly. It’s a little fuzzy to me how exactly GTM hears the event being fired. I put mine within a click event handler that simply pushed the values into the dataLayer object as you’ve outlined in the first step. Does GTM watch for changes to that object, or is there something else I need to do to make GTM pass the values?

]]>