x

Google Analytics "code found outside of <head> tag"

I have inserted a Google Analytics tracking code to the header section of my Weebly premium web site as instructed. However, Google Alalytics is not tracking the traffic to my site. I have beed troubleshooting this issue for weeks without any results.  Google Tag Assistant is giving following text: "Code found outside of <head> tag". I have copied the snippet directly from Google Analytics a couple of times but without any results. Can anybody help me with this issue? 

1,870 Views
Message 1 of 9
Report
8 REPLIES 8

@TuomoKoo 

Take a look at this thread and the fix (s) in there....

https://community.weebly.com/t5/SEO/How-to-install-google-analytics/td-p/8462 

1,863 Views
Message 2 of 9
Report

I have followed the instructions and hints from various threats and tried also to fire up GA4 analytics in my new web site. Currently I have Google Universal analytics code in seo settings of my weebly site https://suomi-1944.weebly.com/. Real time view shows that Google is not receiving any response from my web site hits. This is strange since Google Analytics is working fine in my other Weebly web sites. Can anybody help me wit this issue?

1,849 Views
Message 2 of 9
Report
Square

Thanks for your post, @TuomoKoo.

Your code looks okay as far as I can tell, and I can see that Google's scripts are downloading successfully on page load. Are you seeing any data reported when checking something other than real-time stats?

1,847 Views
Message 2 of 9
Report

Hi Adam, thanks for your kind message. With extistin tracking code I can see one hit yesterday in Google analytics page. However, there seems still to be some malfunction. I have checked the functionality of analytics code with Google Tag Assistant and pasted the results in attached image.  The tracking code shown in appendix is only for testing purposes and will be changed as soon the problen is resolved. Br, Tuomo Kallioniemiimage

1,843 Views
Message 2 of 9
Report
Square

Did you add your code with an Embed Code element,  or to the Footer Code field? I don't know why it shows an HTTP response not detected error, but the other one suggests your code wasn't added to the Header Code field.

1,827 Views
Message 2 of 9
Report

Hi Adam, thanks for your kind reply. I tried to set up Google analytics code one more time. At this time I used a temporary measurement ID G-SQ674ZZKKG and pasted it in Weebly editor to footer section. I do not have any manually embedded html code in my weebly pages. After saving the changes and publishing the site I checked the functionality of GA with Google Tag Assistant (Chrome), and it showed still an error in UA-7870337-1 which is not an active property in my Google Analysis account. In attach screenshots you can see the results of GTA. As you can see, the new measurement ID G-SQ674ZZKKG is there in line 2783 but so is another code UA-7870337-1 as well in line 2786. Is there some conflict that prevents snippet to populate any data to Google Analytics?

image

1,824 Views
Message 2 of 9
Report
Square

That other one might be the tag we add to sites, which you can ignore any errors for. It shouldn't affect any tags and tracking you add of your own.

1,818 Views
Message 2 of 9
Report

@TuomoKoo    please screen shot where you put the codeSmiley Wink)

It goes in >>SETTINGS   >>SEO >>FOOTER CODE

https://www.weebly.com/seo/google-analytics

1,807 Views
Message 2 of 9
Report