Add Minimal Google Analytics (1.5kb) to Hugo

  1. Create a minimal analytics partial, for example: Minimal analytics for Hugo · GitHub
  2. Add it in your baseof.html template:
    {{ partialCached "minimal-analytics.html" . }}
  3. Add you analytics number in config, like:
    googleAnalytics: UA-PROPERTY_ID
5 Likes