Google Analytics Tag Manager

I’ve tried implementing the Google Tag Manager code in the part, however, I can’t save it (‘Save Changes’ is grey) and I have the following view:

​On the top left, when hovering over the red cross, one gets the following message:

<img

2 questions here now:

  1. Usually, when entering the tag in WordPress, it would work like this. What needs to be changed here in order to have Webflow recognize it properly?
  2. How does one best implement event tracking with Javascript on Webflow?

Hello @chtompkins026

That is a great question! What is blocking the script to run properly - hence - saving the changes is the fact that you have broken your tag into few lines of code. You currently have a line that goes:

<iframe src="..." 
height="..." width="..." style="..."></iframe>

Having that broken into 2 lines is causing the error, as html tags cannot be broken that way and have to be in one line. Same thing goes to script that goes from line 14 to 18 - you have script broken with new lines. Please make sure that one function/script is within one line and let the editor to wrap the code itself. That should do the trick and fix your website.

If you will still have problem please post your code here (make sure to wrap with the code button, see below) and I’ll do my best to help you out :)

I’ll be standing by for your response!

Cheers,
Bart

1 Like

Hi Bart,

Thank you for your response to questions 1. I will check that out and let you know if it works. Do you have any insight on 2?

  1. How does one best implement event tracking with Javascript on Webflow?

Hey,

Please take a look at the following thread - that might be helpful and answer your question :)

I just tried to implement it with his tips, but I still get the same error:

​With the code being fully written out:

Push line 18 to the end of line 17 and try again.

I’ve tried your advice, but still get the same message with this code:


1 Like