Skip to content
This repository has been archived by the owner on Apr 3, 2019. It is now read-only.

fix(metrics): ensure email sent amplitude events include device id #2763

Merged
merged 1 commit into from Nov 29, 2018

Conversation

philbooth
Copy link
Contributor

Related to mozilla/fxa-activity-metrics#109.

Currently our fxa_email - sent amplitude events do not include the device id, which may be causing problems with the funnels with Amplitude. This change fixes it by passing the device id to the mailer in our sign-in, sign-up and reset flows, and also by setting the property on the correct object when calling the amplitude module.

Here is an example event from before these changes (without device_id):

{"op":"amplitudeEvent","event_type":"fxa_email - sent","time":1543488875186,"user_id":"92edc9c2522745d29c96d99daab0f759","session_id":1543488852908,"app_version":"126","language":"en","event_properties":{"email_type":"reset_password","email_provider":"other","email_sender":"ses","email_service":"fxa-auth-server","email_template":"recoveryEmail","email_version":1},"user_properties":{"flow_id":"ddb4d3455676fc74125b0e90f744b9563c9f855a1501f270028a01d6721e30c7","sync_device_count":0,"sync_active_devices_day":0,"sync_active_devices_week":0,"sync_active_devices_month":0}}

And here is an example event after these changes (with device_id):

{"op":"amplitudeEvent","event_type":"fxa_email - sent","time":1543495408243,"user_id":"0bc26f36d7044a6a94e115eced630b2e","device_id":"593cb512c5284c298bb1c8a9b3c03dd9","session_id":1543495397648,"app_version":"126","language":"en","event_properties":{"email_type":"reset_password","email_provider":"other","email_sender":"ses","email_service":"fxa-auth-server","email_template":"recoveryEmail","email_version":1},"user_properties":{"flow_id":"b03ec6df0e4318eb789038d2d1fa6781b913575168bece58039067e6dfe8f728","sync_device_count":0,"sync_active_devices_day":0,"sync_active_devices_week":0,"sync_active_devices_month":0}}

Opened against train-126 for a patch release as it's affecting metrics.

@mozilla/fxa-devs r?

Copy link
Contributor

@vbudhram vbudhram left a comment

Choose a reason for hiding this comment

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

@philbooth I see device_id in sign-in/sign-up/reset password amplitude events 👍🏽

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

Successfully merging this pull request may close these issues.

None yet

2 participants