Closed Bug 1030046 Opened 10 years ago Closed 10 years ago

Adding Google Analytics to existing badges.m.o

Categories

(Websites :: Web Analytics, task)

x86
macOS
task
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: adam, Assigned: cmore)

Details

Attachments

(1 file)

Hi Chris,

As we're doing some work on http://badges.mozilla.org I'd love to get some GA tracking into the existing site so we have some baseline data to compare with any new version of the site.

What's the best way to get a new GA tag added to the existing production site and get this published?

We have a GA tag ready (via Bug 1024429):

<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>

---
This is where it needs to change in production:
https://badges.mozilla.org/static/js/base.js

I think this is the corresponding file in github:
https://github.com/mozilla/badges.mozilla.org/blob/master/badgus/base/static/js/base.js

But I got a bit confused working out which bit applies to badges.m.o and which bit applies to badge.us
(In reply to Adam Lofting (:adamlofting) from comment #0)

> But I got a bit confused working out which bit applies to badges.m.o and
> which bit applies to badge.us

badges.m.o was originally started from badg.us code. But, changes to mozilla/madges.mozilla.org in github do not apply to badg.us.

Does that help?
(Also, FWIW, there's a mozilla/badg.us that's totally separate from badges.mozilla.org. Where badges.m.o is intended for Mozillians only, badg.us was built for everyone in the world.)
Hi Adam.

I've CC'd Les, the previous dev on the site and can give us some advice on updates to the website. The good news is that the site used Chief for code deployments, so we don't really need IT. Can you do a pull request on the github repo for badges? Once you do a pull request (PR), Les could review it, merge to master, verify on dev, and then deploy to stage and production. Since badges is not Les' direct responsibility, we may consider putting in a request to allow another vetted developer to be able to deploy using chief if Les is busy with other responsibilities. 

I am also CC'ing Andrew and Erik from the foundation as they are also working on badges and may be able to help with the pull request.

Les/Andrew/Erik: ^^
Re. "we may consider putting in a request to allow another vetted developer to be able to deploy using chief", it's something I've already discussed with David, and something I need to get on top of, probably for both myself and Erik.

Re. "there's a mozilla/badg.us that's totally separate from badges.mozilla.org", that's very good to know. I didn't realise there was a separate repo for the original. Makes me less worried about messing around with the badges.mozilla.org codebase.
(In reply to Les Orchard [:lorchard] from comment #2)
> (Also, FWIW, there's a mozilla/badg.us that's totally separate from
> badges.mozilla.org. Where badges.m.o is intended for Mozillians only,
> badg.us was built for everyone in the world.)

Thanks, I'd missed the separate repo which is where I was worrying about the codebase having implications for both sites. I'll add the PR for review now.
Comment on attachment 8445945 [details] [review]
https://github.com/mozilla/badges.mozilla.org/pull/71

Looks like this is all set
Attachment #8445945 - Flags: review?(lorchard) → review+
Yes, thank you! :)
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: