dss-ialh/dss-blogs

Installing google analytics to be able to track attendance

Closed this issue · 5 comments

Installing google analytics to be able to track attendance

We'll need to set up a google analytics account, then add this line to the config.toml:

# Enable analytics by entering your Google Analytics tracking ID
GoogleAnalytics = "enter tracking ID here"

Should we set up an Acting Admin google account for this? Or use one of our personal accounts?

After you setup a Google Analytics account for dss-blogs, this tutorial shows how to set it up (I can do it after you make the Google Analytics account, just send me the Google Analytics tracking ID you make for dss-blogs).

I followed the tutorial for my personal site, and it worked without hassle. The only small snag: when they mention adding a line to header.html, it will be blog\themes\hugo-academic\layouts\partials\site_head.html for us, since we are using hugo-academic.

@mrparker909 , thanks for looking into this. I have just set up the google analytics account with the graphmaker.in.chief@gmail.com email.

<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-161008775-1"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'UA-161008775-1');
</script>

Please incorporate it into the dss-blogs. @wibeasley , was asking about our audience the last time I spoke with him, so this will be a very timely addition. I keep forgetting to incorporate it into my blog. Thanks for the legwork on the tutorials!

Google Analytics have been implemented and appear to be working. A final note, I was wrong about using site_head.html (newer hugo versions use header.html). If you want easy access to the blog usage statistics on your phone, there is a Google Analytics app available in the play store which works quite nicely.