2

I'm asking this question to better understand how GTM works, in hopes of debugging it myself. But a better title might be:

I want enhanced eCommerce to "just work" when I push to the dataLayer. What am I doing wrong?

In the past, I've implemented GTM's enhanced eCommerce dataLayer on Magento 1. Because Magento is server-side-rendered, the dataLayer JS array is already populated with products/impressions/conversions/etc by the time the page loads. In those scenarios, I was able to simply:

  1. Adding a "Page View" Universal Analytics tag in GTM
  2. Check the checkbox for "Enable Enhanced Ecommerce Features" and "Use data layer"
  3. Having it fire on "All Pages Page View",

This was enough for GTM to automagically call the enhanced eCommerce functions that push that data up to Analytics.

I say automagically because I now realize I was taking for granted the way it worked. I'm now implementing this for a client-side rendered site, where the dataLayer isn't populated until long after the page loads. I've had to add additional GTM tags (UA with type=Event), and triggers to fire those tags when specific events are pushed to the dataLayer.

I now have the conversion/purchase tracking working, but for some reason, impressions don't get pushed. GTM says the tag is firing, and I do see an HTTP request to send the UA event (has t=event), but no impressions data is present in the request.

Ideally, I could add just one tag, and GTM would call the appropriate Analytics function whenever new productDetail/impressions/addToCart/purchase data gets pushed to the dataLayer -- the same way it behaves when the dataLayer is pre-populated at page load time.

Is it even possible to make GTM work this way (without manually adding a tag for each type of eComm event I want to push)? Or maybe I am just not understanding how it's supposed to work.

1

I'm on mobile right now so I can't confirm the details, but I think you are missing the Google Analytics "Event" tag. You mentioned just a pageview tag, and enabling eCommerce, however you are just sending page views to GA. You need a GA event to trigger the moment a purchase or other eCommerce event happens.

So:

1) New Universal Analytics tag in GTM, with type "Event" and then select the right type, like "Transaction", etc...

2) Assign this tag a new trigger which fires on all eCommerce events (these events should be defined by your dataLayer pushes each time a transaction happens)

I hope this helps.

  • If you're still struggling, its likely because you are missing some concepts/foundations about GTM triggers and variables. GTM will never do anything by itself just because you are pushing sth into the dataLayer. The dataLayer is simply a toolbox for creating triggers and variables in GTM. The trigger can be used to simply fire a tag on ALL events, without discerning which one, while the variables just pick up the different values within the dL. – Tobi S Sep 25 at 6:52
  • As stated previously, even with this Event tag set up, only conversions are being sent to UA (but not productDetails, impressions, etc). This need to configure a bunch of separate tags is also inconsistent with what I've observed in past implementations -- where UA PageView is the only tag in GTM, but all eComm events (productDetails, impressions, checkouts, and conversions) are still getting sent to UA. I will try to add some screenshots soon to better illustrate what I mean on these points. – Eric Seastrand Sep 25 at 13:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.