Implement Google Analytics on https://phonebook.mozilla.org/

RESOLVED FIXED

Status

Websites
Web Analytics
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: williamr, Assigned: cmore)

Tracking

Details

(URL)

(Reporter)

Description

6 years ago
> Full website address

https://phonebook.mozilla.org/

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

We do not currently have any web analytics on this site, so there is no easy way to compare it's usage to the mozillians.org Phonebook. Having web analytics on this website will help us understand usage going forward, and it will inform product decisions for improving the mozillians.org Phonebook. 

> Do you have requirements to track user interactions on your website?

Not at this time.

> Define the people who should have access to the reports.

* wreynolds@mozilla.com
* jcrawford@mozilla.com
* mcolvig@mozilla.com
(Assignee)

Comment 1

6 years ago
Add this code to the phonebook before the closing </head> tag:

<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-35433268-20']);
  _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 has been emailed to enable for premium.
Assignee: nobody → chrismore.bugzilla
(Assignee)

Comment 3

6 years ago
All users added to account. Mary's email was mary@mozilla.com.
(Assignee)

Comment 4

6 years ago
I've opened bug 829326 to get the previous log files so we are not starting with nothing.
(Assignee)

Comment 5

6 years ago
rtucker: Can you help us get this code added to the phonebook's base template?
Absolutely. I'll get that going this morning.
Committed revision 112125.

This will get auto deployed to our development server. As long as it is good to go there, I'll see that it gets deployed into production.
(Assignee)

Comment 8

6 years ago
(In reply to Rob Tucker [:rtucker] from comment #7)
> Committed revision 112125.
> 
> This will get auto deployed to our development server. As long as it is good
> to go there, I'll see that it gets deployed into production.

Great! What is the URL of the dev server so I can verify it?

Comment 10

6 years ago
Since this app contains privacy-data (even potentially just encoded in URLs), I'll need an ack from OpSec or WebAppSec before pushing this to production.
(Assignee)

Comment 11

6 years ago
(In reply to Justin Dow [:jabba] from comment #10)
> Since this app contains privacy-data (even potentially just encoded in
> URLs), I'll need an ack from OpSec or WebAppSec before pushing this to
> production.

Even though the Google Analytics implementation spent a year going through legal and privacy before being implemented on our sites? Do you just need to confirm with OpSec or do you need a bug?
(Assignee)

Comment 12

6 years ago
GA Premium is enabled.

Comment 13

6 years ago
I just need someone in that team to put an ack in the bug. Since phonebook.mozilla.org isn't a regular website, as much as it is a view into our LDAP database, it seems like a high risk, so I just want to be safe before moving forward. I'm hoping someone from the security team can take a quick look today and we can push this asap.
(Assignee)

Comment 14

6 years ago
Totally understand and works for me. Thanks!
Flags: needinfo?(tom)
I talked with mcoates about this on IRC. We're fine with this.

r+
We'll work on getting this deployed tomorrow. Thanks for the input everyone.
(Assignee)

Comment 17

6 years ago
Thanks for the prompt help!

Updated

6 years ago
Depends on: 831230

Comment 18

6 years ago
I have a few questions; could you find half an hour to talk with me about this?
Flags: needinfo?(tom)
(Assignee)

Comment 19

6 years ago
(In reply to Tom Lowenthal [:StrangeCharm] from comment #18)
> I have a few questions; could you find half an hour to talk with me about
> this?

Questions about what part? How to use GA on the phonebook or technical questions?
(Assignee)

Comment 20

6 years ago
rtucker: We will probably only see a subset of the traffic to the phonebook because direct searches (i.e. https://phonebook.mozilla.org/search.php?format=html&query=cmore) don't contain the full HTML which miss the GA code. Seems like it would be an easy PHP fix to make the template render when accessing search directly.
(In reply to Chris More [:cmore] from comment #20)
> rtucker: We will probably only see a subset of the traffic to the phonebook
> because direct searches (i.e.
> https://phonebook.mozilla.org/search.php?format=html&query=cmore) don't
> contain the full HTML which miss the GA code. Seems like it would be an easy
> PHP fix to make the template render when accessing search directly.

I've added the GA code to the output-html renderer. This should solve the issue, but I'm not sure if anything else is accessing this in a way which might mess with your analytical numbers.

It will be live on https://phonebook-dev.allizom.org/ shortly. Can you please test and confirm?
(Assignee)

Comment 22

6 years ago
(In reply to Rob Tucker [:rtucker] from comment #21)
> (In reply to Chris More [:cmore] from comment #20)
> > rtucker: We will probably only see a subset of the traffic to the phonebook
> > because direct searches (i.e.
> > https://phonebook.mozilla.org/search.php?format=html&query=cmore) don't
> > contain the full HTML which miss the GA code. Seems like it would be an easy
> > PHP fix to make the template render when accessing search directly.
> 
> I've added the GA code to the output-html renderer. This should solve the
> issue, but I'm not sure if anything else is accessing this in a way which
> might mess with your analytical numbers.
> 
> It will be live on https://phonebook-dev.allizom.org/ shortly. Can you
> please test and confirm?

Looks like that should work! Thanks
(Assignee)

Comment 23

6 years ago
The way I access the phonebook is that I added a Firefox keyword shortcut to the search at the top of the screen as "pb". Then in my awesome bar I type in "pb [name]" and it pulls up their entry. This much quicker than going to the phonebook, loading it all, and searching on a name.

Comment 24

6 years ago
(In reply to Chris More [:cmore] from comment #19)
> (In reply to Tom Lowenthal [:StrangeCharm] from comment #18)
> > I have a few questions; could you find half an hour to talk with me about
> > this?
> 
> Questions about what part? How to use GA on the phonebook or technical
> questions?

Questions about the possible impact of this change on employees' privacy WRT Google.
(In reply to Chris More [:cmore] from comment #23)
> The way I access the phonebook is that I added a Firefox keyword shortcut to
> the search at the top of the screen as "pb". Then in my awesome bar I type
> in "pb [name]" and it pulls up their entry. This much quicker than going to
> the phonebook, loading it all, and searching on a name.

So your specific use case is the reason for the last change I made to phonebook? Where I added the js direct to the template renderer for search?

Doesn't this skew the analytics reporting, as this is not a standard use case?

Comment 26

6 years ago
Chris and I had a chat, but we didn't identify any novel issues. Thanks for getting back to me so quickly, Chris!

* * * * *

(In reply to Rob Tucker [:rtucker] from comment #25)
> Doesn't this skew the analytics reporting, as this is not a standard use
> case?

I assumed that everybody did this?
(In reply to Tom Lowenthal [:StrangeCharm] from comment #26)
> Chris and I had a chat, but we didn't identify any novel issues. Thanks for
> getting back to me so quickly, Chris!
> 
> * * * * *
> 
> (In reply to Rob Tucker [:rtucker] from comment #25)
> > Doesn't this skew the analytics reporting, as this is not a standard use
> > case?
> 
> I assumed that everybody did this?

HAHA
(Assignee)

Comment 28

6 years ago
Analytics look fine and no query strings are being passed with search queries. Thanks everyone!
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.