elben / mc-map

Austin Stone MC Map
1 stars 0 forks source link

Add analytics #25

Closed jasontbradshaw closed 11 years ago

jasontbradshaw commented 11 years ago

It would be great to track how people actually use this thing, after all this work.

jossim commented 11 years ago

If you'd like to use Google Analytics, here's the JavaScript.

Since this is all on one page, you may have to do something more fancy than what's below to track things that are interesting, for example http://austinstone.org/next is mostly one page but I setup Google Analytics (in script.js & bottom.js) so that it shows when people click on different menu items.

  (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','//www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-3493264-23', 'mcmap.austinstone.org');
  ga('send', 'pageview');
jasontbradshaw commented 11 years ago

I've added this part, so we'll at least get page views. I'll go through and track some other salient events later.

jasontbradshaw commented 11 years ago

In addition to the code you gave me, @jossim, I added pretty much comprehensive event tracking for all the actions a user might take on the map.

Is there a limit on events tracked? I don't want to over-do it if there is, but I erred on the side of 'track everything' for now.

jossim commented 11 years ago

I added @jasontbradshaw & @eshira to the Google Analytics account for this site.