Closed jaredhirsch closed 7 years ago
Some experiments (min-vid for example) send extra fields to metrics. We should add another parameter to handle this data. example data
in progress branch to integrate testpilot-metrics on min-vid
Some experiments (min-vid for example) send extra fields to metrics. We should add another parameter to handle this data.
Good point. The simplest solution here seems to be: let experiments pass extra key/value pairs in the object. This works fine for Firefox client metrics, but GA doesn't support random extra named parameters.
GA does support custom dimensions, though they are just named cd1
up to cd200
. This seems like a rather fancy use case, compared with "does event/object demonstrate DAU growth".
Maybe the best thing is to let fancy experiment authors solve their own problems: I'll add support for a transform
function parameter that is called to transform the ping object into a set of GA parameters ready to be encoded and sent. Adding transform
would solve a related issue where testpilot-metrics
, currently, only uses the GA event
type, while some experiments might want to use other GA hit types. I'll add that tonight.
@6a68 That sounds like a good compromise, thanks Jared
I'll add support for a transform function parameter that is called to transform the ping object into a set of GA parameters ready to be encoded and sent.
Does that mean, conversely, that whatever object gets passed in to sendEvent()
will be sent as-is to Telemetry? (i.e. rather than stripped down to id
, event
, & object
?) If so then :+1:
(Also guessing a transform function would resolve my confusion about the GA params too, if I'm assembling them in my own code.)
FWIW, I've got a hacky start at integrating this into Snooze Tabs. The parameters seem a little confusing to me, but I was able to get some data flowing to GA in the realtime view:
Does that mean, conversely, that whatever object gets passed in to sendEvent() will be sent as-is to Telemetry?
Yup! That's the idea...excluding the transform function, of course ;-)
Made some changes, just about to squash, push, and merge. Just FYI for those who reviewed:
transform
sendEvent parameter, and documented its use.%20
, not +
, to encode spaces, even though the Measurement Protocol uses the x-www-form
urlencodedcontent-type, so, switched back to using
%20` for spaces.
I've added the whole team as admins on this repo. Comments and questions very welcome.
Take a look at my branch to see the formatted README and API docs: https://github.com/6a68/testpilot-metrics/tree/test
I'll plan to land this EOD Tuesday, unless there are major concerns :-)