Skip to content

Add Google Analytics to your Thulite Site

Google Analytics is an analytics service that enables you to measure traffic and engagement across your websites and apps.

Set up Google Analytics

To follow this guide, you’ll need an existing Thulite site and a Google Analytics 4 property.

Add script

Add to layouts/partials/head/script-header.html:

{{ template "_internal/google_analytics.html" . }}

Add tracking ID

Add your tracking ID to config/_default/hugo.toml:

[services]
[services.googleAnalytics]
ID = 'G-MEASUREMENT_ID'

Official Resources

More Analytics Guides