Running the GTM tag and the Hydrogen SDK at the same time during a phased migration
We are mid-replatform, which is going about as smoothly as replatforms go. Some routes still serve the old Liquid theme, where Croct runs through the GTM tag. The new routes are on Hydrogen with the Hydrogen SDK. Yesterday I spotted a "conflicting app ID" error in the console on one page and I would like to know how bad that is before it becomes my personality.
What is the safe way to phase the two integrations? Do they fight over the same session, or is it just about not loading both on one page
1 answer
It is the second one: the conflicting app ID error is a documented problem that appears when two integrations initialize on the same page. Only one should be active per page. It does not corrupt anything, but the page where it happens is not tracking reliably, so worth fixing promptly.
The safe pattern for a phased migration is per-surface:
- On Liquid-served pages, keep the GTM tag. Scope its trigger so it only fires on routes still served by the theme.
- On Hydrogen routes, use only the Hydrogen SDK. Make sure the GTM container either is not loaded there or the Croct tag's trigger excludes those paths.
- Never both on one page. The console error you saw means one page currently has both, most likely a route that flipped to Hydrogen while the GTM trigger still matches it.
The good news for the migration itself: both integrations feed the same application, so profiles, audiences, and experiment assignments stay consistent as visitors cross between old and new routes. A shopper who starts on a Liquid page and checks out on Hydrogen is the same profile throughout.