6 thoughts on “GTM: Enhanced eCommerce Tracking for Single Page Apps”

  1. Hi Jim,

    so overall: instead of using history change triggers, pageviews are hooked onto eCom-Events which makes total sense to me.

    One basic understanding I still miss:

    If the SPA is running within a traditional round-trip page, the GTM Snippet is most likely included in the head tag outside the app. Will the dataLayer payload/ecom-snippet, which is placed with a push inside the app, reach the GTM snippet outside the app?

    This is a very basic question, but sth I don’t really get.

    Thanks a lot,
    Chris

    Reply
    • Hey Chris – Depends on the context. If the dataLayer is defined anywhere on the page, it will reach GTM in some way, shape, or form. You can update the dataLayer object through the dataLayer.push() parameters like normal and choose whether you want to reset it on each virtual page load or if you want to just append more data to the object.

      Reply
  2. Hi,

    Thank you for the article!

    Why do you suggest not to send Enhanced Ecommerce data via custom events (“unless it’s absolutely necessary”)?

    What is the advantage of enabling E-Ecommerce on the main Universal Analytics pageview tag, instead of exclusively using custom events (as triggers) and dedicated tags for sending E-Ecommerce data to Google Analytics?

    Reply
  3. Hi
    I have a problem with single page application and GA4.

    I implemented eccommerce tracking with datalayar and developer.
    But the number of eevents are lower than reality.

    Reply

Leave a Comment