Implement Google Analytics on air.mozilla.org

RESOLVED FIXED

Status

RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: cmore, Assigned: cmore)

Tracking

Details

Attachments

(1 attachment)

(Assignee)

Description

6 years ago
URL: https://air.mozilla.org/

Purpose: basic reports and trends

Users: rmilewski@mozilla.com
(Assignee)

Comment 1

6 years ago
Code to be added before the closing </head>:

<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-35433268-30']);
  _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>
(Assignee)

Comment 2

6 years ago
Google emailed to enable premium.
Assignee: nobody → chrismore.bugzilla
(Assignee)

Comment 3

6 years ago
:peterbe: Can you do a PR and add this code to the template (head) of Air Mozilla? I can review the PR on github and verify the data is coming in from a dev or stage instance. Thanks!
(Assignee)

Comment 4

6 years ago
Added rmilewski@mozilla.com to access the data after it is implemented.
Landed on dev 

What I'm going to do is test it once on air-dev.allizom.org (once jenkins upgrades it) and then ask IT to set::

  INCLUDE_ANALYTICS = False

On the dev instance. That way, it'll only be enabled on stage and prod.
(Assignee)

Comment 7

6 years ago
(In reply to Peter Bengtsson [:peterbe] from comment #6)
> Landed on dev 
> 
> What I'm going to do is test it once on air-dev.allizom.org (once jenkins
> upgrades it) and then ask IT to set::
> 
>   INCLUDE_ANALYTICS = False
> 
> On the dev instance. That way, it'll only be enabled on stage and prod.

Cool. When I am verifying non-prod instances I created a separate web property with the different domain since the domain in GA has to match the referring domain for GA to decide to track it. If people visit the dev/stage instance, it won't go into the production GA account.
I can set it up so that the tracker ID is a configurable instead. Then we can put it in settings/local.py on each instance. 

If you prefer that, can you provide tracker IDs for:

* air-dev.allizom.org
* air.allizom.org
* air.mozilla.org
(Assignee)

Comment 9

6 years ago
Created attachment 717957 [details]
Verified dev.
(Assignee)

Comment 10

6 years ago
(In reply to Peter Bengtsson [:peterbe] from comment #8)
> I can set it up so that the tracker ID is a configurable instead. Then we
> can put it in settings/local.py on each instance. 
> 
> If you prefer that, can you provide tracker IDs for:
> 
> * air-dev.allizom.org
> * air.allizom.org
> * air.mozilla.org

That's how mkelly and pmac have done it on other websites. They put the account ID in local.py via an IT push and then reference that variable from the template.
(Assignee)

Comment 11

6 years ago
Property has been enabled for premium service.
This has now been released on production. 

Can you make pbengtsson@mozilla, richard@mozilla.com, lthomson@mozilla.com and zandr@mozilla.com have access to this one?


Laura, Richard, Zandr:
These need to be your Google Apps email addresses. If I got it wrong, please update this bug.
(Assignee)

Comment 13

6 years ago
Great! Real-time stats are coming in now on production. I also added all users in comment 12. I used their real LDAP emails since Google Apps is tied to first initial+last name and not alias. I looked them up on the phonebook and used the right emails for Google.
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.