Ref
CS-12
Filed
2023
Status
Validated

Case study / E-commerce (skincare and beauty retail)

GA4 and Ecommerce Tracking for a Headless Magento 2 Skincare Storefront

CS-12Dermacare DirectUKMagento 2 / Headless / Multi-Store / SPAGA4 · GTM · Ecommerce Tracking · dataLayer Implementation · GTM Migration · Looker Studio

Dermacare Direct website
LIVE SITE Dermacare Direct

Results recorded

UNIFIEDFour domains routed to the right GA4 properties
RECOVEREDLegacy tags fixed for the SPA
LIVEFull ecommerce live on headless Magento 2
TRUSTEDFunnel drop-offs visible in Explorations

01 The broken state

Dermacare Direct ran a multi-store headless Magento 2 storefront built as a single-page application, spanning four domains: two production sites and two staging sites. Data from each domain had to reach its own GA4 property, the SPA had no dataLayer in place, and existing tags needed migrating from the legacy standard Magento 2 GTM account to a new headless container.

02 What we changed

  1. Routed data from all four domains to the correct GA4 properties using a single GTM Lookup Variable, avoiding the overhead of four separate containers
  2. Tracked SPA route changes by relying on GA4 page_view handling and configuring other tags with a History Change trigger
  3. Migrated tags from the legacy standard Magento 2 GTM account to the new headless GTM container
  4. Specified the required dataLayer and worked with the client's development team, providing detailed documentation and hands-on support for its implementation
  5. Implemented full ecommerce tracking in GA4 via GTM once the dataLayer was in place
  6. Built funnels in GA4 Explorations to surface drop-off points across the site

03 The outcome

GA4 and ecommerce tracking for Dermacare Direct's multi-store headless Magento 2 storefront, routing four domains to separate GA4 properties and standing up SPA-friendly tracking on a site that had no dataLayer.

Record specification

Sector
E-commerce (skincare and beauty retail)
Region
UK
Platform
Magento 2, Headless, Multi-Store, SPA
Services
GA4, GTM, Ecommerce Tracking, dataLayer Implementation, GTM Migration, Looker Studio

Next step

Want results like these on your stack?

Book a 15-minute call and we will tell you, plainly, what is wrong with your tracking and how we would fix it.