Google Analytics Tag not showing on production #331
-
I have not been able to get the Google Analytics Tag to show when deploying the site for production, when using both the main Repository and the template. I defined the googleAnalytics in the config, and have been trying to edit analytics.js without success. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Some initial thoughts/questions:
|
Beta Was this translation helpful? Give feedback.
-
I followed the exact same steps. I placed the <script async src="https://www.googletagmanager.com/gtag/js?id=G-xxxxxxxxxx"></script> The beginning of the title = "Hinode"
copyright = "Copyright © 2023 Mark Dumay."
paginate = 9
enableGitInfo = true
# additional settings
baseURL = "https://template.gethinode.com/"
canonifyURLs = false
enableEmoji = true
enableRobotsTXT = true
enableInlineShortcodes = true
# prevent build failures when using Hugo's Instagram shortcode due to deprecated Instagram API.
# See https://github.com/gohugoio/hugo/issues/7228#issuecomment-714490456
ignoreErrors = ["error-remote-getjson"]
timeout = "120s"
languageCode = "en-us"
defaultContentLanguage = "en"
defaultContentLanguageInSubdir = true
googleAnalytics = "G-xxxxxxxxxx"
[taxonomies]
tag = 'tags'
[...] |
Beta Was this translation helpful? Give feedback.
I followed the exact same steps. I placed the
googleAnalytics = "G-xxxxxxxxxx"
value right above[taxonomies]
inhugo.toml
. When I look into the generated filepublic/en/index.html
I do see the following line as expected:The beginning of the
hugo.toml
file looks like this (I only inserted the Google tag):