mozilla / mozbadging

where we track progress on mozilla-wide badging infrastructure
Mozilla Public License 2.0
2 stars 3 forks source link

Add GA tracking to new badges site #52

Open adamlofting opened 10 years ago

adamlofting commented 10 years ago

Prod:

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

  ga('create', 'UA-49796218-6', 'mozilla.org');
  ga('send', 'pageview');

</script>
adamlofting commented 10 years ago

@andrewhayward @christensenep - do you want to do anything specific with managing .js files included, or shall I just add things into base/static/js and then into base.html?

andrewhayward commented 10 years ago

What would be different about this in the various environments? Just thinking how best to go about configuring the script.

adamlofting commented 10 years ago

This is an optional extra really, but we could set an alternative GA-account-id and GA-domain on staging and prod. That way we can test any changes to GA tracking on staging.

adamlofting commented 10 years ago

I'll open a PR, so we can discuss in relation to actual code :)

adamlofting commented 10 years ago

Here's what I was thinking (re-using the existing process from webmaker): https://github.com/mozilla/mozilla-badges/pull/20/files#diff-31d2b15bbb55166af1f9ee9f958ea6dfR183

andrewhayward commented 10 years ago

I'll ask implementation questions on the issue itself.