I’ve searched the forums for information, but the majority of the forum posts on the topic have either not been answered at all or what workaround (placing the per-page code in an embed code container just below the body and removing the “script” tag) I have found is not working and results in a " No HTTP response detected" error from Google.
Read Only Link: https://preview.webflow.com/preview/pivotal-it?preview=06cc96718c14c579fb7089680bf9ba91
Live Site: https://www.itispivotal.com/
I ran into a similar issue while setting up the same for my website. I copied the analytics code as the last piece of code after all other scripts in the head area and that seemed to fix. I dont know why but just try it might work for you.
If you do this, do not enter the Universal Analytics code in the SEO section of your site’s settings since this always adds it at the top.
I moved the code down to the bottom as you suggested and the second code snippet that is supposed to be inserted just after the is embedded just below the body, but it’s still not working.
The error has changed from “No HTTP response detected” to “GTM no-script code not found: either missing or not in ”
Yes, I downloaded the guide (and tried everything I could to get it to work) - You found no references to Google Tag Manager on our site because I deleted all of it out - no need for it if it will not work correctly in Webflow.
GTM wants it’s snippet to be the first thing in the body.
Webflow does not provide a custom section for this area like the others.
You can place an HTML embed as the first element on your pages. I recommend making this one of those reusable sections. You will need to manually set this for all pages you want GTM to run on.
In the HTML embed, and the GTM snippet, then set the ID to gtag-div in the RHS config area.
Add my JS code to the project wide custom footer, so it runs on all pages.
So what’s happening here…
Webflow loads your page with the GTM inside of a div, almost as the first element.
GTM does not like this and will not run properly
My JS code, because of the ID, extracts the GTM snippet from the div and puts it in the right place.
This is not ideal because GTM is not running as early as it could and we would like. This is a hack around a missing feature in Webflow, which is native integration for GTM. If they added that, we could supply the container ID and they would put the GTM snippets in the appropriate places on all pages without us needing to do more. Or have this hack of a solution.
I’m using https://docsy.dev and probably migrating to netlify. I’m a technical person though.
Interesting situation. If I understand correctly, the problem is integrating GTM inside an HTML embed on a specific page and not all pages? What is the use case for this?
I’m not a technical person. Can you explain step 4 to me in more detail?
Before reaching out to you, I had already added your script to the Project Custom Code footer, as well as placing the GTM code within a symbol, as the worthless tutorial from Webflow recommended. It seems they put all of their efforts into production and very little into useful information.