philraymond philraymond - 18 days ago 7
Javascript Question

Google Analytics code is on my site, but invisible

On my website ( https://www.smilinggardener.com/ ), the Google Analytics tracking code isn't visible in the page source code, and Google Search Console can't see it in order to verify my site.

Yet the Google Tag Assistant says it's there, and when I run developer tools and go to 'network', I see the analytics.js file is loaded, and most important, it is tracking visitors.

Any ideas what could be going on?

Answer

The analytics code is loaded via an external file.

If you look at your network tab in Chrome there is a column "initiator" (if it isn't there by default you can enable it by clicking the table header and check the respective option). The initiator is the file (if any) that triggered an external dependency.

enter image description here

That in your case the filename contains a complicated id suggests that it is dynamically created by some extension in your CMS.