Blog
Tracking patterns for Next.js and Nuxt storefronts where the server does the heavy lifting.
Headless commerce gives you flexibility on the front end and removes a lot of the conventions you used to rely on for measurement.
The short version: measurement that does not need to be redone every time you change frameworks is mostly a matter of doing the obvious thing carefully. Move the canonical event collection to the server-rendered API layer, then forward to your sGTM container. Treat the front end as a presentation layer, not a measurement source.
You take on more measurement code. You also gain a measurement layer that survives front-end rewrites. That trade-off is the one most teams underweight when they plan the work, and it is the one that quietly determines whether the project ships on time.
If you want a longer treatment, we have a deeper post in the series. For now, the takeaway is small enough to fit on a sticky note: In a headless stack, the most durable measurement lives where the data does, which is rarely the browser.