Skip to content
Permalink
Browse files

fix(metrics): reinstate entrypoint to the metrics context schema

  • Loading branch information...
philbooth committed Mar 5, 2019
1 parent 5201617 commit 94345bf1b24db4740b4ca39d6941f91ca923c993
Showing with 78 additions and 100 deletions.
  1. +9 −8 app/scripts/lib/metrics.js
  2. +1 −0 app/tests/spec/lib/metrics.js
  3. +67 −91 npm-shrinkwrap.json
  4. +1 −1 package.json
@@ -91,9 +91,9 @@ define(function (require, exports, module) {
return `flow.${viewName.replace(/^oauth\./, '')}.${eventName}`;
}

function marshallUtmParam (utmParam) {
if (utmParam && utmParam !== NOT_REPORTED_VALUE) {
return utmParam;
function marshallProperty (property) {
if (property && property !== NOT_REPORTED_VALUE) {
return property;
}
}

@@ -657,13 +657,14 @@ define(function (require, exports, module) {
const metadata = (this._flowModel && this._flowModel.attributes) || {};
return {
deviceId: metadata.deviceId,
entrypoint: marshallProperty(this._entrypoint),
flowBeginTime: metadata.flowBegin,
flowId: metadata.flowId,
utmCampaign: marshallUtmParam(this._utmCampaign),
utmContent: marshallUtmParam(this._utmContent),
utmMedium: marshallUtmParam(this._utmMedium),
utmSource: marshallUtmParam(this._utmSource),
utmTerm: marshallUtmParam(this._utmTerm)
utmCampaign: marshallProperty(this._utmCampaign),
utmContent: marshallProperty(this._utmContent),
utmMedium: marshallProperty(this._utmMedium),
utmSource: marshallProperty(this._utmSource),
utmTerm: marshallProperty(this._utmTerm)
};
},

@@ -88,6 +88,7 @@ define(function (require, exports, module) {
assert.isUndefined(metrics.getFlowModel());
assert.deepEqual(metrics.getFlowEventMetadata(), {
deviceId: undefined,
entrypoint: 'menupanel',
flowBeginTime: undefined,
flowId: undefined,
utmCampaign: 'utm_campaign',
Oops, something went wrong.

0 comments on commit 94345bf

Please sign in to comment.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.