Skip to content
This repository has been archived by the owner. It is now read-only.

marketing snippet should be able to log multiple marking links #2338

Closed
shane-tomlinson opened this issue Apr 22, 2015 · 6 comments
Closed

marketing snippet should be able to log multiple marking links #2338

shane-tomlinson opened this issue Apr 22, 2015 · 6 comments
Assignees

Comments

@shane-tomlinson
Copy link
Member

@shane-tomlinson shane-tomlinson commented Apr 22, 2015

Currently we only allow one link to be logged. The 38.1 FxiOS snippet can have 2 links, both of which should be logged.

Ref #2316

@shane-tomlinson
Copy link
Member Author

@shane-tomlinson shane-tomlinson commented Apr 22, 2015

I propose to log something like the following snippet as part of the metrics that are sent to the /metrics endpoint:

...
marketing: [
  {
    id: 'android-sync',
    url: 'https://play.google.com/somebiglongscarylink',
    clicked: false
  },
  {
    id: 'hello',
    url: 'https://hello.firefox.com',
    clicked: true
  }
],
...

This would give us the ability to log an arbitrary number of marketing items, potentially across multiple screens.

@shane-tomlinson
Copy link
Member Author

@shane-tomlinson shane-tomlinson commented Apr 22, 2015

@shane-tomlinson shane-tomlinson modified the milestones: train 37, train 36 Apr 29, 2015
@shane-tomlinson shane-tomlinson modified the milestones: train 38, train 37 May 7, 2015
@shane-tomlinson
Copy link
Member Author

@shane-tomlinson shane-tomlinson commented May 7, 2015

@kparlante's feedback in dev-fxaccount:

That said, your proposal causes some problems, as nested json is harder to consume in any of our tools -- the json blob needs special case code to be parsed (heka) or is basically inaccessible (kibana3). (Datadog and kibana4 probably fall somewhere in the middle: possible but painful).

Suggestion: log a more compact, easy-to-parse-in-tools format. Don't include the url: it is not needed for stats and the id/url mapping can be managed elsewhere.
...
marketing: [android-sync:false,hello:true]
...

@shane-tomlinson
Copy link
Member Author

@shane-tomlinson shane-tomlinson commented May 7, 2015

More feedback from @kparlante in dev-fxaccount:

I'm guessing the growth team would want to ask similar questions either by url or by snippet id (or by the snippet id/url pairing). I'm also guessing they don't want to use kibana for this, but will want a data feed.

Another proposal: create a separate message type for snippet-views, with one message for each snippet entry. Include the id/url/clicked fields. If segmentation data is needed, include those fields as well (or use a common "session id" with the client-metrics message).

The tabular data for snippet-views can then be viewed/processed in kibana (or output to another system) easily, and/or we can write a heka filter to generate a tabular aggregated/rollup output for a bespoke dashboard.

@shane-tomlinson
Copy link
Member Author

@shane-tomlinson shane-tomlinson commented May 7, 2015

Another proposal: create a separate message type for snippet-views, with one message for each snippet entry. Include the id/url/clicked fields. If segmentation data is needed, include those fields as well (or use a common "session id" with the client-metrics message).

@kparlante - I want to dig in here. If I understand your proposal, multiple messages would be logged for marketing data. One message would be the marketing data as is currently formatted. The new message(s) would be individual entries, one for each marketing URL. Each marketing entry would contain each of the three fields mentioned.

e.g.:

{"time":"2015-05-07T13:00:00.000Z","op":"client.metrics","pid":27573,"v":1,"lang":"en",...}
{"campaignId":"spring-2015-android-ios-sync","url":"https://www.mozilla.org/newsletter/ios/","clicked":true,"time":"2015-05-07T13:00:00.000Z","op":"client.marketing","hostname":"Shanes-Retina-MBP.local","pid":30856,"v":1}

The first entry is the marketing entry as we have always had, the second is an individual marketing impression with the extra meta-data added. I specify an op of client.marketing - does that seem reasonable?

Is this along the lines of what you were thinking of?

shane-tomlinson pushed a commit that referenced this issue May 7, 2015
* Extract the marketing link handling code into its own mixin module.
* The call to POST /metrics contains a `marketing` field.
  * `marketing` contains `campaignId`, `url`, and `clicked`.
* Marketing impressions are reported to Heka separately from the rest of the metrics.

An example marketing entry:
{"campaignId":"spring-2015-android-ios-sync","url":"https://www.mozilla.org/newsletter/ios/","clicked":true,"time":"2015-05-07T13:00:00.000Z","op":"client.marketing","hostname":"Shanes-Retina-MBP.local","pid":30856,"v":1}

fixes #2338
@kparlante
Copy link

@kparlante kparlante commented May 7, 2015

@shane-tomlinson : yes, that was what I was thinking. You may want to add a few segmentation fields to the "client.marketing" entry, in particular lang, service, and the user_agent fields

shane-tomlinson pushed a commit that referenced this issue May 11, 2015
* Extract the marketing link handling code into its own mixin module.
* The call to POST /metrics contains a `marketing` field.
  * `marketing` contains `campaignId`, `url`, and `clicked`.
* Marketing impressions are reported to Heka separately from the rest of the metrics.

An example marketing entry:
{"campaignId":"spring-2015-android-ios-sync","url":"https://www.mozilla.org/newsletter/ios/","clicked":true,"time":"2015-05-07T13:00:00.000Z","op":"client.marketing","hostname":"Shanes-Retina-MBP.local","pid":30856,"v":1}

fixes #2338
shane-tomlinson pushed a commit that referenced this issue May 11, 2015
* Extract the marketing link handling code into its own mixin module.
* The call to POST /metrics contains a `marketing` field.
  * `marketing` contains `campaignId`, `url`, and `clicked`.
* Marketing impressions are reported to Heka separately from the rest of the metrics.

An example marketing entry:
{"campaignId":"spring-2015-android-ios-sync","url":"https://www.mozilla.org/newsletter/ios/","clicked":false,"time":"2015-05-11T13:00:00.000Z","op":"client.marketing","hostname":"Shanes-Retina-MBP.local","pid":64280,"v":1,"lang":"en","agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:40.0) Gecko/20100101 Firefox/40.0","context":"web","entrypoint":"none","service":"sync","migration":"none"}

fixes #2338
shane-tomlinson pushed a commit that referenced this issue May 13, 2015
* Extract the marketing link handling code into its own mixin module.
* The call to POST /metrics contains a `marketing` field.
  * `marketing` contains `campaignId`, `url`, and `clicked`.
* Marketing impressions are reported to Heka separately from the rest of the metrics.

An example marketing entry:
{"campaignId":"spring-2015-android-ios-sync","url":"https://www.mozilla.org/newsletter/ios/","clicked":false,"time":"2015-05-11T13:00:00.000Z","op":"client.marketing","hostname":"Shanes-Retina-MBP.local","pid":64280,"v":1,"lang":"en","agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:40.0) Gecko/20100101 Firefox/40.0","context":"web","entrypoint":"none","service":"sync","migration":"none"}

fixes #2338
shane-tomlinson pushed a commit that referenced this issue May 17, 2015
* Extract the marketing link handling code into its own mixin module.
* The call to POST /metrics contains a `marketing` field.
  * a `marketing` entry contains `campaignId`, `url`, and `clicked`.
* Marketing impressions are reported to Heka separately from the rest of the metrics.

An example marketing entry for Heka:
{"campaignId":"spring-2015-android-ios-sync","url":"https://www.mozilla.org/newsletter/ios/","clicked":false,"time":"2015-05-11T13:00:00.000Z","op":"client.marketing","hostname":"Shanes-Retina-MBP.local","pid":64280,"v":1,"lang":"en","agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:40.0) Gecko/20100101 Firefox/40.0","context":"web","entrypoint":"none","service":"sync","migration":"none"}

* Marketing impressions are reported to StatsD using the `marketing.impression` counter. An impression's tags contain 3 additional fields: `campaignId`, `url` and `clicked`.

* An example marketing entry for StatsD:
fxa.content.marketing.impression:1|c|#campaign:none,context:web,broker:fx-desktop-v1,entrypoint:none,migration:none,lang:en,service:none,screen_client_width:819,screen_client_height:955,screen_device_pixel_ratio:2,screen_width:1680,screen_height:1050,agent_ua_name:Chrome 42.0.2311,agent_ua_family:Chrome,agent_ua_version:42.0.2311,agent_ua_version_major:42,agent_os_name:Mac OS X 10.10.3,agent_os_version:10.10.3,agent_os_family:Mac OS X,agent_os_major:10,agent_device:Other,marketing_campaignId:spring_2015,marketing_url:https://play.google.com/fx_for_android,marketing_clicked:true

fixes #2338
shane-tomlinson pushed a commit that referenced this issue May 19, 2015
* Extract the marketing link handling code into its own mixin module.
* The call to POST /metrics contains a `marketing` field.
  * a `marketing` entry contains `campaignId`, `url`, and `clicked`.
* Marketing impressions are reported to Heka separately from the rest of the metrics.

An example marketing entry for Heka:
{"campaignId":"spring-2015-android-ios-sync","url":"https://www.mozilla.org/newsletter/ios/","clicked":false,"time":"2015-05-11T13:00:00.000Z","op":"client.marketing","hostname":"Shanes-Retina-MBP.local","pid":64280,"v":1,"lang":"en","agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:40.0) Gecko/20100101 Firefox/40.0","context":"web","entrypoint":"none","service":"sync","migration":"none"}

* Marketing impressions are reported to StatsD using the `marketing.impression` counter. An impression's tags contain 3 additional fields: `marketing_campaign_id`, `marketing_url` and `marketing_clicked`.

* An example marketing entry for StatsD:
fxa.content.marketing.impression:1|c|#campaign:none,context:web,broker:fx-desktop-v1,entrypoint:none,migration:none,lang:en,service:none,screen_client_width:819,screen_client_height:955,screen_device_pixel_ratio:2,screen_width:1680,screen_height:1050,agent_ua_name:Chrome 42.0.2311,agent_ua_family:Chrome,agent_ua_version:42.0.2311,agent_ua_version_major:42,agent_os_name:Mac OS X 10.10.3,agent_os_version:10.10.3,agent_os_family:Mac OS X,agent_os_major:10,agent_device:Other,marketing_campaign_id:spring_2015,marketing_url:https://play.google.com/fx_for_android,marketing_clicked:true

fixes #2338
shane-tomlinson pushed a commit that referenced this issue May 21, 2015
* Extract the marketing link handling code into its own mixin module.
* The call to POST /metrics contains a `marketing` field.
  * a `marketing` entry contains `campaignId`, `url`, and `clicked`.
* Marketing impressions are reported to Heka separately from the rest of the metrics.

An example marketing entry for Heka:
{"campaignId":"spring-2015-android-ios-sync","url":"https://www.mozilla.org/newsletter/ios/","clicked":false,"time":"2015-05-11T13:00:00.000Z","op":"client.marketing","hostname":"Shanes-Retina-MBP.local","pid":64280,"v":1,"lang":"en","agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:40.0) Gecko/20100101 Firefox/40.0","context":"web","entrypoint":"none","service":"sync","migration":"none"}

* Marketing impressions are reported to StatsD using the `marketing.impression` counter. An impression's tags contain 3 additional fields: `marketing_campaign_id`, `marketing_url` and `marketing_clicked`.

* An example marketing entry for StatsD:
fxa.content.marketing.impression:1|c|#campaign:none,context:web,broker:fx-desktop-v1,entrypoint:none,migration:none,lang:en,service:none,screen_client_width:819,screen_client_height:955,screen_device_pixel_ratio:2,screen_width:1680,screen_height:1050,agent_ua_name:Chrome 42.0.2311,agent_ua_family:Chrome,agent_ua_version:42.0.2311,agent_ua_version_major:42,agent_os_name:Mac OS X 10.10.3,agent_os_version:10.10.3,agent_os_family:Mac OS X,agent_os_major:10,agent_device:Other,marketing_campaign_id:spring_2015,marketing_url:https://play.google.com/fx_for_android,marketing_clicked:true

fixes #2338
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

3 participants