Improved support for Google Tag Manager

Hi

Add a box on the Analytics page which allows you to enter your GTM Container ID and then automagically insert the two GTM Container code snippets in the appropriate places.

Google Tag Manager container code now has two code snippets.

The first code snippet needs to go as high as possible in the <head>. 

The second code snippet needs to go immediately after the <body> tag. The only way I know to do this at the moment is with a custom embed.  

Many thanks

 

Graham

  • Graham Cox
  • Jan 20 2017
  • Kai Thomas commented
    January 26, 2017 08:30

    Thanks for putting this on the list. Would make things much easier to implement!

  • Noelle Greenwood commented
    February 25, 2017 10:28

    Yes, yes, yes. So important.

  • Christoffer Furnes commented
    April 24, 2017 14:47

    +1

  • Chris Greer commented
    June 06, 2017 20:23

    How do you add the code for the <body>? And does this need to go on every page?

  • Cameron Roe commented
    June 09, 2017 21:20

    +3

  • Guillaume Eyries commented
    July 11, 2017 18:11

    +1 This would be great!

  • Michael Wells commented
    December 18, 2017 10:35

    Chris Greer- yes that's correct, even if you can ensure that the HTML embed would render immediately after the <BODY> tag, you'd need to create that on every single page on your site to have correctly installed GTM. 

    GTM seems to mostly work OK with the BODY snippet at the end, just before the closing </BODY> tag, which WebFlow allows you to do in site settings.

    However some features, like verifying Google Search Console sites won't work. There you get an error "The Google Tag Manager snippet on your site is in the wrong location."

  • Michael Wells commented
    December 18, 2017 10:38

    Adding some further references here for this item, regarding the current "The Google Tag Manager snippet on your site is in the wrong location" error.

    https://productforums.google.com/forum/#!topic/webmasters/Z7QR716p44A

    Webflow docs don't mention this problem-

    https://webflow.com/blog/integrating-google-tag-manager-with-google-analytics-in-webflow 

  • Cameron Roe commented
    July 21, 2018 11:10

    Agreed! This would allow for us to add our Google Analytics in our Google Tag Manager container instead of directly in Webflow for better control. Google Tag Manager is really all that is needed.

  • Micheal Reno commented
    August 16, 2018 04:05

    We solved this for exported sites! Check out https://jinglebell.io you can save a GTM code and apply it to many sites, on all pages at once.

  • Rohan Ganachari commented
    14 Jan 10:18

    +3

  • Ronald Edwards commented
    04 Mar 12:57

    this would definitely make it more elegant than putting it in the custom code field ;) Thanks a lot in advance.