Skip to content

Commit

Permalink
add utm_ params to fxa_rp - engage ping
Browse files Browse the repository at this point in the history
  • Loading branch information
groovecoder committed Nov 23, 2019
1 parent 5d117e9 commit f7b47f7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,10 @@ async function recordVisitFromEmail (req, res, next) {
next();
return;
}
const fxaMetricsFlowPath = `metrics-flow?entrypoint=breach-alert-email&event_type=engage&uid=${subscriber.fxa_uid}&service=${AppConstants.OAUTH_CLIENT_ID}`;
const breachDetailsRE = /breach-details\/(\w*)$/;
const capturedMatch = req.path.match(breachDetailsRE);
const utmContent = (capturedMatch) ? `&utm_content=${capturedMatch[1]}` : "";
const fxaMetricsFlowPath = `metrics-flow?utm_source=${req.query.utm_source}&utm_medium=${req.query.utm_medium}${utmContent}&event_type=engage&uid=${subscriber.fxa_uid}&service=${AppConstants.OAUTH_CLIENT_ID}`;
const fxaResult = await FXA.sendMetricsFlowPing(fxaMetricsFlowPath);
log.info(`fxaResult: ${fxaResult}`);
next();
Expand Down

0 comments on commit f7b47f7

Please sign in to comment.