Need to add the Google Tag Manager code to our webflow project. Typically this code is supposed to be entered directly after the body tag, so the “Custom Code” section of the dashboard does not seem to accommodate. We’ve also tried to embed the code in the page, but unfortunately this puts it within a div, which is also problematic with GTM.
Any way to get GTM to work properly with webflow?
P.S. Site is responsive and needs to track desktop and mobile users.
Hi @Phil_T, the only way to add code directly under the body, is to use our embed widget. The embed div tags will also appear in the code, wrapping the google analytic tag manager code. If you can paste the link to your published site, where there is the tag code installed, I can run a tag verifier to see how the information is getting communicated to Google from the page.
Hey @cyberdave @Phil_T any work around for this? My company requires GTM for our new microsite also. I’ve tried the embed method but the div makes it throw an error when I checked the tag in chrome with a tag verifier.
I appreciate any assistance
It seems the embed feature is the only option for now. It will give you an error with a tag verifier but GTM still seems to work correctly on modern browsers.
That’s great to hear. Thanks Phil. Also, I assume we need to embed on each page?
Hi @richard_knight4, if you want to put the google code just after the body tag for EACH page, then use the embed widget as the first item on each page in the designer.
If you want to put the code in the Header or Footer of your site, you can use the custom code boxes for this: Custom code in head and body tags | Webflow University
I hope this helps, cheers