DevProgress / debate-bingo

Bingo game for presidential & vice presidential debates
MIT License
9 stars 7 forks source link

Add analytics #33

Closed dglazkov closed 7 years ago

dglazkov commented 8 years ago

... So that we can track how popular the app is.

jillh510 commented 8 years ago

Assigning to decause for now to get us a GA key

jillh510 commented 8 years ago

Assuming we're going with GA, here's what I propose for custom events:

eventCategory: bingoCard possible eventActions: create, bingo possible eventLabels: hillary, trump

eventCategory: share (NB this will record clicks on a share button, not whether the user actually posted) possible eventActions: share possible eventLabels: twitter, facebook, google_plus, linked_in

Comments welcome (9/24/2016: changed the event from "win" to "bingo" because I couldn't stand the idea of analytics events that said "win trump")

decause commented 8 years ago
<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-83595614-4', 'auto');
  ga('send', 'pageview');

</script>
jillh510 commented 8 years ago

Reopening to assign to myself.

jillh510 commented 7 years ago

Update: events for card creation and bingo are in, pending merge of bug fix. Events for Share icons are harder and not blocking for v1.0. Taking the 1.0 label off of this issue.