Closed Bug 829264 Opened 11 years ago Closed 11 years ago

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

Categories

(Websites :: Web Analytics, task)

task
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: williamr, Assigned: cmore)

References

()

Details

> 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
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>
Google has been emailed to enable for premium.
Assignee: nobody → chrismore.bugzilla
All users added to account. Mary's email was mary@mozilla.com.
I've opened bug 829326 to get the previous log files so we are not starting with nothing.
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.
(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?
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.
(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?
GA Premium is enabled.
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.
Totally understand and works for me. Thanks!
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.
Thanks for the prompt help!
Depends on: 831230
I have a few questions; could you find half an hour to talk with me about this?
Flags: needinfo?(tom)
(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?
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?
(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
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.
(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?
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
Analytics look fine and no query strings are being passed with search queries. Thanks everyone!
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.