Adding Google Analytics and a Privacy Policy

- hugo

Add Google Analytics tracking by adding this to your config.toml.

googleAnalytics = "UA-123-45-yournumber"

Hugo has wonderfully generated an easy drop in google_analytics template. Find your header template and add the code below inside the <head></head> tags. For me I added it to the bottom of meta.html before </head>.

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

Yes. Also, Google Analytics Terms of Service requires you to have a privacy policy on your website or appยน.

I stumbled down the google search blackhole looking for a decent privacy policy template. BBB offers a pretty standard Privacy Policy, but it didn’t seem up to date in the 2018 privacy climate. It had no section specifically for Google Analytics, which would be used conservatiely in 95% of cookie tracking websites?

I started looking through other sites to see their approaches to a Privacy Policy. Website Gohugo.io has instructions regarding turning cookie tracking features on and off in their documentation. And cookie tracking in their website header, https://www.googletagmanager.com... , but no Privacy Policy?! Hey! I can submit a pull request for one.

Where some sites have no policy, in my opinion Linkedin.com’s Privacy Policy is the industry leading one. They have a separate policy specifically regarding their use of cookies and a table with opt-out links to go with it.

In my search I finally came across a halfway decent evaluation of different Privacy Policy generators.

And, finally, Shopify’s Policy Generator won me over with it’s simplicity and robustness considering it takes into consideration age limits and GDPR in single paragraphs. It may not be deep enough for your needs and you will need to do some editing. If you are going to post this on your website you better review it! Once I removed paragraphs about orders and Shopify I felt it was web ready. Voila, my Site Privacy Policy.