For the first year of building XreplyAI, our tracking setup was the standard mess: gtag scripts in _app.tsx , conversion events scattered across components, and a tacit rule that any tracking change needed a full deploy cycle.
It worked, but it had a real cost: we consistently under-instrumented. Adding a conversion event for a new experiment didn't feel worth a PR when you're moving fast solo.
The switch to GTM
The migration was about 2 hours. The short version:
Replace inline gtag calls with window.dataLayer.push() calls
Move all tag configs (Google Ads, GA4, any new pixels) into a GTM container
Publish the container — done
What actually changed
No deploys for tracking changes. New pixel, new conversion event, tweaked trigger — all done in GTM in minutes. This sounds minor until you ship 3 new conversion events in a week without opening your codebase once.
Preview mode is a real debugger. GTM shows every tag, trigger, and variable state as you click through your app in real time.…