Welcome, Guest
Username: Password: Remember me
1. The "search..." box above searches the Docs & Forum Posts. The "Search" tab above just searches the Forum Posts. :side:
Please use these to search for your issue *before* creating a new message topic, as your issue may have been previously solved.
2. Please put your Club # and Club Web Address in your Forum Signature (best) OR in each post to get faster support from us.
Click here to edit your signature at the bottom of the Profile Information tab.
3. Our user and admin docs are available at: support.toastmastersclubs.org/doc "There's a doc for that!" ;)
4. There is an "Opt In" Feature for newly added members. The Opt In document explains the strikethrough member information. Click Here to View the Post
5. When posting a New Topic , please include all relevant details and be specific. When did your issue 1st occur? What operating system, browser, & browser version are you using? Did you refresh your browser cache? Are your cookies enabled? Lastly, a screen shot is often helpful.
6. Please abide by the Terms of Use . We are volunteers contributing our spare time. We are happy to assist you, so long as you are respectful and courteous.
7. We are always looking for new FreeToastHost Ambassadors to join our team and support fellow Toastmasters in their use of the FreeToastHost website system. If you are familiar with the system and have some interest, send a Send Us a Private Message.
  • Page:
  • 1

TOPIC:

Google Analytics script head in wrong place? 5 years 11 months ago #76296

  • DF_Dunedin
  • DF_Dunedin's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 5
  • Thank you received: 0
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.
<!-- 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.

Google Analytics script head in wrong place? 5 years 11 months ago #76306

  • DF_Dunedin
  • DF_Dunedin's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 5
  • Thank you received: 0
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:

Verification method: Google Analyics
Failure reason: We could not find any Google Analytics tracking codes on the index page of your site...

i.imgur.com/B5z8Y7H.png

And in another Google Console

No tag found / No smart campaign ID/tag was found on your website...

i.imgur.com/A1y0pa5.png
(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: by DF_Dunedin.
The topic has been locked.

Google Analytics script head in wrong place? 5 years 11 months ago #76307

  • SteveTheTechie
  • SteveTheTechie's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 11526
  • Thank you received: 3795
I can see the GA script code in the page source. Try clearing your browser cache.
The topic has been locked.

Google Analytics script head in wrong place? 5 years 11 months ago #76318

  • wesb
  • wesb's Avatar
  • Visitor
  • Visitor
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?
The topic has been locked.

Google Analytics script head in wrong place? 5 years 11 months ago #76319

  • DF_Dunedin
  • DF_Dunedin's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 5
  • Thank you received: 0
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.

Google Analytics script head in wrong place? 5 years 11 months ago #76326

  • SteveTheTechie
  • SteveTheTechie's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 11526
  • Thank you received: 3795
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.

Google Analytics script head in wrong place? 5 years 11 months ago #76334

  • DF_Dunedin
  • DF_Dunedin's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 5
  • Thank you received: 0
I'm sure the first thing Google will ask is 'have you followed our directions,' i.e.

"Paste it immediately after the <head> tag on each page of your site."

And having not done this I doubt they will be interested in helping much further, regardless of anything else.

I'll still have a go at contacting Google support.

I understand GA does support asynchronous loading so the old rationale of placing the script where it is to avoid blocking may no longer apply. I don't know enough about the technical specifics and I am certainly not trying to start a debate, just suggesting it might be worth reviewing this.
Dunedin Toastmasters (New Zealand)
Club #2890
The topic has been locked.

Google Analytics script head in wrong place? 5 years 11 months ago #76337

  • SteveTheTechie
  • SteveTheTechie's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 11526
  • Thank you received: 3795
I am not going to spend a lot of time getting into this... Suffice to say I have put a *lot* of time into code placement issues like this in the past. You may think I need to review this yet again, but believe me, I have put countless hours into updating and maintaining this system. I did not just implement the system as it stands now in a few Saturday afternoons...:pinch: I have done tons of research, learning, and trying out what works best.

Google has changed their placement recommendations in the past. I put the code where it makes most sense in the past based on my research and how *I designed the FTH implementation to work*. I try to accommodate Google as appropriate, but the system design comes first, and I am not going to re-litigate all my past research and design decisions based on just one club's experience. Especially, when I know that this is very likely an outlier as we have not heard anything like this from any other club/district ... If it was a big issue caused by our system code we would have heard about it from others.

I suspect that you configured GA in some way that prevents it from working. Maybe you used a slightly different URL to set up your GA account for example.
Last edit: by SteveTheTechie.
The topic has been locked.

Google Analytics script head in wrong place? 5 years 11 months ago #76338

  • DF_Dunedin
  • DF_Dunedin's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 5
  • Thank you received: 0
OK, thanks for your time. Doug
Dunedin Toastmasters (New Zealand)
Club #2890
The topic has been locked.

Google Analytics script head in wrong place? 5 years 11 months ago #76341

  • SteveTheTechie
  • SteveTheTechie's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 11526
  • Thank you received: 3795
The topic has been locked.
  • Page:
  • 1
Moderators: Pamjliumarc33NotLiabledeedubbleyooNSBPhyllis Kirouac
Time to create page: 0.043 seconds
Powered by Kunena Forum