USGS-WiM / StreamStats-National

Nationwide StreamStats application using NLDI services
https://streamstats.usgs.gov/national-beta/
Other
4 stars 0 forks source link

Add Google Analytics #39

Closed kjacobsen16 closed 2 years ago

kjacobsen16 commented 3 years ago

Assigning myself so I can get more info for this issue

HansVraga commented 3 years ago

@lprivette could possibly advise a bit here

lprivette commented 3 years ago

happy to if I can help at all, Katrin.

In case it's helpful, I made a tracker that I don't have a blank template for but this is what it looks like for whispers: https://doimspp.sharepoint.com/:x:/r/sites/GS-UMidWIM/_layouts/15/Doc.aspx?sourcedoc=%7BC4D390E8-1E9E-4235-8F04-28D286A0A01B%7D&file=Whispers%20Google%20Analytic%20Event%20Trackers.xlsx&action=default&mobileredirect=true

i went a little crazy with the colors 😬

if you need a new ga property just let me know

kjacobsen16 commented 3 years ago

@lprivette it's beeeautiful... 😆

Thanks! If you have instructions on-hand for getting ga set up let me know, otherwise I'll do some digging. It's been a long time since I've set it up

kjacobsen16 commented 3 years ago

Also we'll probably be looking into setting up a dashboard like you did for Paul.

lprivette commented 3 years ago

No instructions document unfortunately. If you have an account, it'd have been created using a personal google email of yours. I don't see any that look like they belong to you under the WIM USGS account, but you could try to login with one and see.

I can create the GA property (unless there already is one?) and then pass you the code snippet to insert into the index.html file.

If you have a personal gmail that you don't mind using, I can add you. When adding tag events it's really nice to be logged in a confirm them working in the Realtime > Overview

kjacobsen16 commented 3 years ago

I'm on the analytics with my personal email (uses my maiden name so probably not clear that it's me). I'll take a look in there and see if I can figure things out. Thanks!

kjacobsen16 commented 3 years ago

Tag created - we'll need to use the following in the index.html to set it up:

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

  gtag('config', 'UA-61219868-47');
</script>