Skip to content
This repository has been archived by the owner on Jan 17, 2023. It is now read-only.

add metrics overview #1662

Merged
merged 2 commits into from Feb 10, 2017
Merged

add metrics overview #1662

merged 2 commits into from Feb 10, 2017

Conversation

clouserw
Copy link
Member

PR for discussion. All comments/edits are welcome.

  • There is a TODO in it looking for sample code. I saw several experiments doing it in different ways. What is the right way?
  • There are several files in docs/metrics/ which I think can be cleaned up after this lands
  • My hope was to be able to have the Test Pilot add-on be a broker for metrics and be able to choose what to send to Telemetry, but I couldn't figure out a good way to do that and keep engineering costs low. I think making sure Telemetry is focused on the big questions should keep the reporting code relatively simple (vs instrumenting every event and button which we'll do more of in GA).

@clouserw clouserw self-assigned this Oct 21, 2016
Running included JavaScript from the net is asking for trouble (and is actually
not allowed at all on addons.mozilla.org).

Google [provides documentation for logging
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may want to use an example from the add-on code to highlight the Measurement Protocol instead of from the website (which actually does use the GA library).

@chuckharmston
Copy link

There is a TODO in it looking for sample code. I saw several experiments doing it in different ways. What is the right way?

Different experiments use different frameworks, which have their own interfaces (or none at all) to nsIObserverService:

# Overview

Test Pilot loves metrics. Our whole purpose is to ask questions, measure and
analyaze responses, and make recommendations. To that end, we have a few tools

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

analyze

is just gravy. We use GA for all basic measuring, funnel tracking,
click-through rates, and simple A/B testing.

## Telemetry

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably add some context about what capital-T Telemetry means.


Google Analytics does a lot of great things generically, but comes up short
when trying to do deep analysis on data, which is usually where those big
defining questions lay.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two other thing Telemetry does well:

  • Correcting things we measure with other behaviors or attributes that we don't or can't measure
  • Correcting for bias in our population. Test Pilot users are demonstrably power users, and Telemetry gives us data that can help us understand and correct for that.

to [clone these two bugs](https://bugzilla.mozilla.org/buglist.cgi?quicksearch=1297199%2C+1297200).

The Measurement Team will be looking at the Metrics Plan you wrote to
understand what is needed so it's important it includes the schema you'll be

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needed, so it's important that it includes

```javascript
app.sendToGA('event', {
eventCategory: 'Menu Interactions',
eventAction: 'drop-down menu',

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The increasing tab size here is probably not what you intended.

## Google Analytics
To use Google Analytics we recommend you use your own Google Analytics account
to record data. This makes the transition easy when your experiment graduates
from the Test Pilot program.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because this is the case, should we mention permissions? I'd think we want to make sure that the Test Pilot team has at least read access to each of these accounts.


We're all here to help. This document exists as documentation for us as much
as anyone -- don't feel like you have to go at this alone, it just needs to be
written down so we don't forget steps. :)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An emoticon and no emoji? What is this, 2013?

@ghost
Copy link

ghost commented Oct 27, 2016

I pushed a new version of the proposal. The "Sending Data" section is new so please check that out.

TODO: code here
```

The testpilot.sendEvent() function accepts these parameters:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These fields are shared across the three systems with slightly different names so I think it will be easy to remap and send to all three as a base. We'll still need to add specific fields for additional experiment meta-data.

This doesn't get us every measurement we could want, but it gets us a lot of data quickly

## Sending Data

The actual function to report event based data is called `testpilot.sendEvent()` and is
provided by the `test-pilot-metrics` node module. To use it:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

testpilot-metrics? As I recall, some engineering manager somewhere insisted that we don't hyphenate.


We're all here to help. This document exists as documentation for us as much
as anyone -- don't feel like you have to go at this alone, it just needs to be
written down so we don't forget steps. 😺

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👌


## Google Analytics
To use Google Analytics you'll need to have your Google Analytics credentials
to record data. Using your own account here instead of a generic Test Pilot
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that Mozilla has a special GA account that is extra privacy-preserving.

I think we either need to ask experiment authors to use the special non-tracking Mozilla instance of GA, or, if authors will use their own, regular GA accounts, we may need to talk to legal about revising our terms of service.

the appropriate endpoints.

> TODO:
> * need to specify what "system information" is, if for no other reason than we
Copy link
Contributor

@lmorchard lmorchard Nov 15, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We get a lot of system information "for free" on Telemetry thanks to the environment data added to the ping.

I think a lot of that will be inaccessible to library code running in webextension-based experiments - assuming we wanted to gather & send some of it as context to GA or the Tiles Pipeline. Need to inventory what we can actually gather in that scenario. (Could be more than I think off the top of my head)

* `variant` (optional): An identifying string if you're running different
variants. eg. `cohort-A`

These paramters will be combined with other data (like a timestamp and system
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: parameters

variants. eg. `cohort-A`

These paramters will be combined with other data (like a timestamp and system
information) in the sentEvent() function and the broker will send the data to
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: sendEvent

@jaredhirsch
Copy link
Member

@clouserw Based on our discussion from a few weeks back, looks like this doc to be updated to remove references to the testpilot npm module. I think we were just going to provide good docs on how to send messages from different addon types. For reference, discussion notes are here.

@ghost ghost closed this Dec 21, 2016
@ghost ghost reopened this Dec 21, 2016
@ghost ghost added the status: in progress label Dec 21, 2016
@ckprice
Copy link

ckprice commented Jan 25, 2017

Are these docs deprecated by mozilla/testpilot-metrics#4?

@jaredhirsch
Copy link
Member

@ckprice I made some edits to this PR, I'll push them up in a bit

@jaredhirsch
Copy link
Member

@ckprice @clouserw updated the PR with another commit's worth of testpilot-metrics stuff. Mind taking a look?

@jaredhirsch
Copy link
Member

Looks like 'event' needs to be replaced with 'method', per the Event Telemetry doc. I'm also changing the testpilot-metrics API to not have any required keys in the sendEvent method, for better backwards compatibility with existing experiments.

Once I've made those changes, I'll plan to land this PR.

@jaredhirsch
Copy link
Member

planning to land this later today

@jaredhirsch
Copy link
Member

OK, let's land this!

@jaredhirsch jaredhirsch merged commit df44bd0 into mozilla:master Feb 10, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants