Add analytics

Choose one of these integrations to analyse your site traffic with Wowchemy:

Google

If you wish to use Google Analytics or Google Tag Manager, include your associated tracking code (e.g. UA-12345678-9) in config/_default/params.toml:

############################
## Marketing
############################
[marketing]
  google_analytics = ""
  google_tag_manager = ""

Microsoft

If you wish to use Microsoft Clarity, include your associated tracking code in config/_default/params.toml:

############################
## Marketing
############################
[marketing]
  microsoft_clarity = ""

[Requires Wowchemy v5.0.0.beta1+]

Troubleshooting

The integrated analytics track users on your live production website and not your own views on your development site, if you have one.

Hugo’s default environments are development when running the hugo serve command and production when running the hugo command. You can explicitly set the environment to production with HUGO_ENV or Hugo’s --environment option.

If you deploy with Netlify, the production environment should already be setup in your netlify.toml file, but if not, check that your Netlify settings in netlify.toml are similar to the latest Netlify settings in the Academic template.

If you choose to use Google Tag Manager, you’ll need to setup and configure your analytics solutions, such as Google Analytics, in the Google Tag Manager admin panel.

If you choose to use GA via Google Tag Manager (google_tag_manager) instead of directly via the google_analytics option, it will override the direct GA implementation to prevent tracking each user twice.

We recommend testing that your analytics are working as expected. If they are not, check that your production environment is as described above and check that your site URL in your Google/Microsoft admin panel matches your site’s URL. Furthermore, Google and Microsoft provide troubleshooting guides to help with any issues.

Next