To move Google Tag Manager (GTM) and existing pixels from a WordPress site to a Webflow site — along with 301 redirects and a cleaner URL structure — you don’t need a new GTM container. You can reuse the existing container with adjustments.
1. Reuse Your Existing GTM Container
- Do not create a new GTM container unless there’s a specific reason (e.g., separating analytics/data ownership by domain).
- Copy the GTM embed code (both
<head> and <body> parts) from WordPress and place it in Webflow: - Go to Webflow Project Settings → Custom Code.
- Paste the GTM head snippet inside the Head Code section.
- Paste the GTM body snippet inside the Before </body> tag section.
2. Review and Update Tag Triggers in GTM
- Webflow has different page structure and DOM events than WordPress. So:
- Revisit any DOM-based triggers, form submissions, or click events.
- Ensure all Triggers in your GTM container align with the new Webflow page structure.
- For Google Analytics, Facebook Pixel, etc., tags can remain as-is — but verify they are firing correctly using Preview Mode in GTM or Tag Assistant.
3. Implement 301 Redirects in Webflow
- Webflow allows 301 redirects via the Hosting → 301 Redirects tab.
- Manually map old WordPress URLs to new clean Webflow URLs.
- Example:
/old-blog-post → /blog/post-title. - This preserves SEO value and ensures pixel events still match expected URLs.
4. Validate Data Layer Compatibility (Optional)
- If your WordPress setup had custom dataLayer pushes, those may not exist in Webflow.
- Webflow doesn’t expose
dataLayer by default. You may need to: - Recreate them via Webflow’s Custom Code blocks in the page or site-wide.
- Or adjust GTM Tags/Triggers to not rely on missing values.
5. Use Preview and Debugging Tools
- Test everything using GTM Preview Mode.
- Use Google Tag Assistant or Facebook Pixel Helper browser extensions to confirm correct firing and events.
Summary
Reuse your existing GTM container, embed it in Webflow via Project Settings → Custom Code, and review your tag triggers for compatibility. 301 redirects can be added in Webflow’s Hosting settings to maintain SEO and tracking continuity.