- Posts: 5
- Thank you received: 0
Google Analytics script head in wrong place?
- DF_Dunedin
- Topic Author
- Offline
- New Member
-
Less
More
6 years 6 days ago #76296
by DF_Dunedin
Dunedin Toastmasters (New Zealand)
Club #2890
Google Analytics script head in wrong place? was created by DF_Dunedin
Hello FTH gurus
I have just inherited our FTH webpage - dunedin.toastmastersclubs.org/ - and have begun the process of renovating it.
For analytics, have received a <head> script tag from Google, and placed this in the "Google Analytics Script Code" box in the admin console.
However when this is done, Google is still reporting that the tag is missing.
When I view our page source, it appears that the script is being injected into the HTML body rather than the page head.
I wonder if I have done something dumb or if this is a real bug?
Many thanks in advance
Doug F, Dunedin NZ
I have just inherited our FTH webpage - dunedin.toastmastersclubs.org/ - and have begun the process of renovating it.
For analytics, have received a <head> script tag from Google, and placed this in the "Google Analytics Script Code" box in the admin console.
Code:
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-144859337-2">
</script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-144859337-2');
</script>
However when this is done, Google is still reporting that the tag is missing.
When I view our page source, it appears that the script is being injected into the HTML body rather than the page head.
I wonder if I have done something dumb or if this is a real bug?
Many thanks in advance
Doug F, Dunedin NZ
Dunedin Toastmasters (New Zealand)
Club #2890
The topic has been locked.
- DF_Dunedin
- Topic Author
- Offline
- New Member
-
Less
More
- Posts: 5
- Thank you received: 0
6 years 5 days ago - 6 years 5 days ago #76306
by DF_Dunedin
Dunedin Toastmasters (New Zealand)
Club #2890
Replied by DF_Dunedin on topic Google Analytics script head in wrong place?
I just want to clarify my issue here. I don't actually care where the tag sits and I understand there are very good arguments for it being located in different places in the head or body.
My issue is that the tag, placed where it is, does not seem to be detected by Google on our page.
I have installed the tag in the admin console and as far as I can see I did it all exactly as directed, and can confirm the tag is appearing in the page's source. But, if I use Google Webmaster Tools, I get this:
And in another Google Console
(Sorry I can't hotlink the images)
I tried using both http:// and https:// and carefully checked the URL, but no difference.
My assumption was the placement of the tag was causing the problem but that could be irrelevant
Thanks again
Doug
My issue is that the tag, placed where it is, does not seem to be detected by Google on our page.
I have installed the tag in the admin console and as far as I can see I did it all exactly as directed, and can confirm the tag is appearing in the page's source. But, if I use Google Webmaster Tools, I get this:
i.imgur.com/B5z8Y7H.pngVerification method: Google Analyics
Failure reason: We could not find any Google Analytics tracking codes on the index page of your site...
And in another Google Console
i.imgur.com/A1y0pa5.pngNo tag found / No smart campaign ID/tag was found on your website...
(Sorry I can't hotlink the images)
I tried using both http:// and https:// and carefully checked the URL, but no difference.
My assumption was the placement of the tag was causing the problem but that could be irrelevant
Thanks again
Doug
Dunedin Toastmasters (New Zealand)
Club #2890
Last edit: 6 years 5 days ago by DF_Dunedin.
The topic has been locked.
- SteveTheTechie
- Offline
- Administrator
-
Less
More
- Posts: 11526
- Thank you received: 3050
6 years 4 days ago #76307
by SteveTheTechie
Replied by SteveTheTechie on topic Google Analytics script head in wrong place?
I can see the GA script code in the page source. Try clearing your browser cache.
The topic has been locked.
- wesb
- Visitor
-
6 years 4 days ago #76318
by wesb
Replied by wesb on topic Google Analytics script head in wrong place?
Steve...
I know that our European compliance implementation doesn't put the Google Analytics stuff in unless the visitor accepts cookies, and i can see the GA stuff only after accepting them. In their site, I need to try to log in as site admin before getting the option to accept cookies. I'd suspect that Google won't try to do this.
Under these circumstances, it's possible that Google truly won't see the GA code?
I know that our European compliance implementation doesn't put the Google Analytics stuff in unless the visitor accepts cookies, and i can see the GA stuff only after accepting them. In their site, I need to try to log in as site admin before getting the option to accept cookies. I'd suspect that Google won't try to do this.
Under these circumstances, it's possible that Google truly won't see the GA code?
The topic has been locked.
- DF_Dunedin
- Topic Author
- Offline
- New Member
-
Less
More
- Posts: 5
- Thank you received: 0
6 years 4 days ago #76319
by DF_Dunedin
Dunedin Toastmasters (New Zealand)
Club #2890
Replied by DF_Dunedin on topic Google Analytics script head in wrong place?
I tried emptying the browser cache and it made no difference. I can see the code in the page's source but Google's dashboards seem to struggle.
Dunedin Toastmasters (New Zealand)
Club #2890
The topic has been locked.
- SteveTheTechie
- Offline
- Administrator
-
Less
More
- Posts: 11526
- Thank you received: 3050
6 years 3 days ago #76326
by SteveTheTechie
Replied by SteveTheTechie on topic Google Analytics script head in wrong place?
If the system is inserting the code as expected, but you are still having issues, then maybe you should get support from Google about why they cannot see it.
The topic has been locked.
Time to create page: 0.108 seconds
Copyright © 2025 FreeToastHost 3 Support. All Rights Reserved.