I have a website that uses Hugo, in particular the hugo-renga theme (https://github.com/nanxstats/hugo-renga/blob/master/exampleSite/config.toml). In the past, Google Analytics has worked perfectly. However, I am trying to switch to Google Analytics 4. I have updated the tag in my config.yaml file:
googleAnalytics: ...
but it doesn't work - Google Analytics detects nothing from my site.
I have also tried :
googleAnalyticsID: ...
but this doesn't work either. What can I do to get it to work?
googleAnalytics="G-XXXXX"
in your config file.tid
property of your calls.If you see your tid, then you're good. Give it two days max and you should start seeing the traffic reflected in reports. Or see real-time reports if you want to confirm further without waiting.
If you don't see your tid, then it looks like your theme ignores the config's GA4 setting, so it might be hardcoded there. You have two ways from here: change your theme to use the right code whether from the settings or just hardcode the right ga4 code, or you can just keep using your UA tracking but ask Google to cast it all into GA4 through the setup assistant.
The best solution here would be ditching UA/GA4 implementation and reimplement tracking through GTM completely. That is if you're serious about tracking and need to do more than trivial pageviews.