How can I tell if my google analytics code is present

We are about to launch a new site. We have a slot for putting in our google analytics ID in the admin backend area. I have done so. If I do a view source on a page I can see no sign of the google code in there.

Should I expect to be able to see this? I want to know that it is working before we go live.




I’d expect to see some markup in the page source for the analytics code or tag manager.
Is this a site you have developed?
It’s not clear from that snippet how the tags are being added… could be part of the project code, or through an add-on module. If the code isn’t showing up in the output, then it would be worth checking how it’s being implemented.

Thanks for your reply. We have a third party developing it. I don’t know if its a module or project code. My last query to them remains unanswered. I will ask one of their developers directly.


hmmm. Looks like we have the choice of UA, which isn’t working, or GTM. We are not signed up for GTM currently. We ARE using GA4. Do you know if there is an analytics module for Silverstripe that uses GA4 ?

My advice would be to get a GTM account set up and use that (it’s free and pretty well-documented). You can then add your existing analytics (and anything else you need) to the site without needing further developer input.

Honestly using a module for this is overkill - all you need is two fields in an extension on SiteConfig (or configured via yaml or .env config) and then paste whatever generic snippet the service provider tells you to paste into your base page template, or into an include template that you can then include in your base page template.