Implement Google Analytics on openbadges.org and beta.openbadges.org

VERIFIED FIXED

Status

VERIFIED FIXED
6 years ago
6 years ago

People

(Reporter: davida, Assigned: boozeniges)

Tracking

Details

(Reporter)

Description

6 years ago
Full website address:
  openbadges.org and beta.openbadges.org

Explain the goal and use-case of having web analytics on this website.

 - tracking traffic to and from the badges sites, evolution over time, etc. 

Do you have requirements to track user interactions on your website? For example, how many people have clicked a button on a page, filled out a form, or went through a pre-defined funnel?

 - not at this point, but sometime in the future, yes.


Define the people who should have access to the reports.

 - MoFo engagement & webdev
 - Badges team leadership (both product & technical)

ryan@mozillafoundation.org
rebeccah@mozillafoundation.org
ross@mozillafoundation.org
chris@mozillafoundation.org
erin@mozillafoundation.org
dascher@mozilla.com


(note: we just need the snippet/code, MoFo devs will implement).
Should both the root domain and sub domain be tracked separately or can I enable sub-domain tracking on the root domain?
(Reporter)

Comment 2

6 years ago
the latter.  simplicity FTW.
Code to add before closing </head>:

<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-35433268-10']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

</script>
I've enabled Subdomains of openbadges tracking in GA.
This profile should be enabled for premium by Friday. We'll keep this open until it is enabled for premium and data is coming in.
Has this been added to the website?
Ping

Updated

6 years ago
Assignee: nobody → chrismore.bugzilla
(Assignee)

Comment 9

6 years ago
Will be sending in the pull requests tomorrow - sorry for such a delay, I blame Christmas!!
(Assignee)

Comment 10

6 years ago
The PR's are put in - just assigning to myself so that I can help push them through
Assignee: chrismore.bugzilla → ross
Status: NEW → ASSIGNED
(Assignee)

Comment 11

6 years ago
At the moment in the GA dashboard I'm only seeing one domain set up for openbadges.org (should there also be a sub-domain filter for beta.openbadges.org?)
Here is the updated JS as I missed the setDomainName:

<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-35433268-10']);
  _gaq.push(['_setDomainName', 'openbadges.org']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

</script>

There is now two profiles for both the domain and subdomain. Sorry about that!
(Assignee)

Comment 13

6 years ago
Thanks!

I still only see the one but am guessing that's getting over the Google cache! Have updated the snippet in both the pull requests I had opened!
(In reply to Ross Bruniges from comment #13)
> Thanks!
> 
> I still only see the one but am guessing that's getting over the Google
> cache! Have updated the snippet in both the pull requests I had opened!

Please try now.
(Assignee)

Comment 15

6 years ago
Yeah, thanks looking good! Now just waiting on the PR's I sent making them up to live, thanks :cmore
(Assignee)

Comment 16

6 years ago
openbadges.org code is up, just waiting on the beta.openbadges.org stuff to go
(Assignee)

Comment 17

6 years ago
Looking at the GA dashboard is looks like we're getting data for beta.openbadges.org now :)
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Verified that there is data coming in now. Thanks!
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.