Adding Google Analytics Tracking Code to my Child Theme

Hi Support,

I’m having issues adding my Google Analytics tracking code correctly. I followed one support form by adding:

to my functions.php file. I thought going about it using the method of adding it to the child theme was better overall, but I don’t think I pulled it off correctly. I installed a google tag assistant extension to my browser, and it didn’t catch anything when I tested my site, so I know my tracking code isn’t set up right.

Any help is much appreciated. I wanted to set it up through the child theme, but If it’s much easier and still safe to use a plugin and that’s what you’d advise, please let me know which one works the best with X theme.

Hi @burnich,

Thanks for reaching out.

May I know which specific site should have this code? And please note that if you have active cache or any form of it, that change will not take effect instantly, or not all if not cleared.

Thanks!

Hi Rad,

It’s for https://blog.navigationtrading.com. I’ll be honest, I’m not even sure what active cache means, and how to go about clearing it. :no_mouth::grimacing: I know that’s super sad, can you give me a brief rundown of how to do that?

Hey @burnich,

Simply looking at the screenshot in your first post, there’s already a problem with it. You have a stray script tag. Please remove it and test again.

If that does not work though, please contact the Google Tag Manager support. I checked your site’s source code and your tag manager code is outputted in the head correctly so there’s nothing on our side is causing this.

I removed the screenshot in your first post also because it contains your tag manager ID which is a sensitive information. Please use the Secure Note next time.

Thanks.

Learning new things all the time. Thanks, that did the trick.

You are most welcome!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.