Skip to content

Conversation

muffinresearch
Copy link
Contributor

Fixes mozilla/addons#5626

  • Adds tracking lib
  • Uses async setup as per GA docs
  • Adds CSP config (we might need more than this if beacons go to other hosts).
  • preventDefault added (I was seeing 2 beacons fired) this probably meant installs were kicked off twice too.
  • adds the install and uninstall events.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling f5b040c on muffinresearch:add-tracking-to-disco into c254967 on mozilla:master.

@muffinresearch muffinresearch force-pushed the add-tracking-to-disco branch from f5b040c to 5b439f4 Compare June 2, 2016 20:18
@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 5b439f4 on muffinresearch:add-tracking-to-disco into c254967 on mozilla:master.

@mstriemer
Copy link
Contributor

preventDefault added (I was seeing 2 beacons fired) this probably meant installs were kicked off twice too.

I think installed only happened once since we would change the state and the second time it would do nothing. This is what I noticed with themes though but I didn't dig into it then.

@mstriemer
Copy link
Contributor

I presume GA is smart enough to separate the data based on origin so we only need the one ID for dev, stage and production?


export class Tracking {

constructor({trackingId, trackingEnabled, _log = log} = {}) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think destructuring should have spaces so constructor({ trackingId, trackingEnabled, _log = log } = {}) {

@muffinresearch
Copy link
Contributor Author

I presume GA is smart enough to separate the data based on origin so we only need the one ID for dev, stage and production?

Yep - you can work out stats by host. Addons-server only has one id set directly in JS.

* obj.value Number No Values must be non-negative.
* Useful to pass counts (e.g. 4 times)
*/
sendEvent({category, action, label, value} = {}) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd say destructuring format again here.

@mstriemer
Copy link
Contributor

r+wc

@muffinresearch muffinresearch force-pushed the add-tracking-to-disco branch from 5b439f4 to 229343c Compare June 3, 2016 16:20
@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 229343c on muffinresearch:add-tracking-to-disco into 4a08338 on mozilla:master.

@muffinresearch muffinresearch force-pushed the add-tracking-to-disco branch from 229343c to 7e25dd8 Compare June 3, 2016 16:46
@muffinresearch muffinresearch merged commit c66c1dd into mozilla:master Jun 3, 2016
@muffinresearch muffinresearch deleted the add-tracking-to-disco branch June 3, 2016 17:14
@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 7e25dd8 on muffinresearch:add-tracking-to-disco into 4a08338 on mozilla:master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sticky metrics tracking
3 participants