Google Analytics UA code shows up on homepage

Posted in: Newspaper
Post count: 8

Hi,
When I put my google analytics UA code in the designated area in the theme panel and hit save, that number shows up at the top of my homepage and doesn’t track anything. It should not be visible.

Can anyone help with this?
thanks,
nicole

Post count: 8

Hi,
When I put my google analytics UA code in the designated area in the theme panel and hit save, that number shows up at the top of my homepage and doesn’t track anything. It should not be visible.

Can anyone help with this?
thanks,
nicole

Post count: 9544

Double check the code is correct with the opening and closing elements; make sure you paste into the correct box in the ‘custom code’ box for GA.

Also, if you’re doing that in YOAST SEO, don’t also put it in the theme too.

Post count: 22421

Hello,

Make sure you also include the script tags. If not included you will see the code on the front-end.

Thanks.

Post count: 8

Can you be more specific in how it should look. I am not a developer.
right now I have it as <UA CODE #>. It is not working that way either.

Before I was just able to insert the number. I’m confused as to why I can’t anymore or why in the pop up help box it doesn’t say how to do it.

Thank you

Post count: 22421

You just need to insert <script> at the start of the code and </script> at the end of the code.

here is an example of how to use the script tag
https://www.w3schools.com/tags/tag_script.asp

Thank you!

Post count: 8

ok thank you i think i got it! We’ll see at the end of the day if i did it right 🙂

cheers!
Nikki

Post count: 8

Ok, so I input the code exactly like this and it has been 24 hours. I still do not see any stats in my GA. Can you please help me?
thanks

Post count: 9544

Check your page source to see if the code is actually there (‘view source’ in your web browser). If it’s there, theme can’t do anything more with it. You have to wait awhile for GA to work. Theme just helps you put the code on the page — nothing else related to GA.

Post count: 1

Your code might be like this, I think:
<!– Global Site Tag (gtag.js) – Google Analytics –>
<script async src=”https://www.googletagmanager.com/gtag/js?id=YOUR CODE”></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag(‘js’, new Date());

gtag(‘config’, ‘ENTER YOUR CODE’);
</script>

Viewing 10 posts - 1 through 10 (of 10 total)
The forum ‘Newspaper’ is closed to new topics and replies.