Hugo

Turning off Google Analytics for Local Hugo Server

April 3, 2020
Categories:
Tutorial
Tags:
Hugo

TL;DR: If using Google Analytics, most Hugo themes load the tracking script even when running locally. This causes a bunch of bogus page views when writing a new article. Creating separate config files for development and production is an easy way to fix this.

images/bogus-google-analytics.png
Whoops... that's me visiting my site on localhost
...

© DevOps Directive 2023