Google Analytics

Add your google analytics id to data/seo.yaml file

# data/seo.yaml

google_analytics_id: ""

Note: The google analytics snippet is not added in development mode. Ie when running hugo server you will not see the Google Analytics snippet in the browser DOM. This prevents test data from polluting your analytics data.

Netlify Environment Variables

You can also set the Google Analytics ID using Netlify environment variables.

Netlify environemnt variable settings