monkeyWzr / hugo-theme-cactus

Cactus theme for hugo
MIT License
537 stars 338 forks source link

Google Analytics is not working in post pages #34

Closed monkeyWzr closed 3 years ago

monkeyWzr commented 3 years ago

It seems that ga script is not loaded

monkeyWzr commented 3 years ago

false negative

216049245 commented 3 years ago

Hi there is there anything else I need to do to get Google analytics to work besides adding in the measurement ID on the config.toml file?

andodet commented 3 years ago

@monkeyWzr It seems somethig might be up with Google Analytics as setting the tracking id as googleAnalytics in the config.toml file is not enough to get the script into the header section.

edit: in my case the problems seems to affect all pages.

monkeyWzr commented 3 years ago

@216049245 @andodet Sorry for the delay. I can’t remember why I closed this one as a false negative issue. I’ll handle this asap

andodet commented 3 years ago

@monkeyWzr thanks for the very quick reply, let me know if I can assist troubleshooting in any way.

monkeyWzr commented 3 years ago

@andodet Hi there I'll appreciate it if you can share some information:

baseURL = "http://example.org/"
languageCode = "en-us"
title = "My New Hugo Site"
theme = "cactus"
googleAnalytics = "G-XXXXXXXX" # this one must be set at top level instead of under [params]
# ...

[params]
# ...

(I tried both v3 and v4, and it seems working fine, at least the script is loaded)

andodet commented 3 years ago

@monkeyWzr You are definitely right, it was due to googleAnalytics ending up inside [params] after a fiddling session with my config files, sorry for the noise. You can definitely close this issue again.

monkeyWzr commented 3 years ago

@andodet Hi Really happy your situation could be solved. The readme was definitely misleading. Updated in #89. Thanks!