The linked auth server PR did not have the impact that I was hoping for in Amplitude, so this change is now my best/last/only hope (unless anyone else has a better idea).
You can see the effect it has in the logs. Here is the event flow before the change, where the second two events have a different device_id to the first two.
{"op":"amplitudeEvent","event_type":"fxa_login - forgot_pwd","time":1544448338531,"device_id":"7a9b7fc56f1e4ead9efc311cc7f1ab9a","session_id":1544448317264,"app_version":"126","language":"en","os_name":"Mac OS X","os_version":"10.13","event_properties":{},"user_properties":{"flow_id":"738677b02b5a903888a4ed0692c35f16cc58a3d84c24198dcb27de2f10a58199","ua_browser":"Firefox","ua_version":"65.0","utm_campaign":"fx-welcome","utm_content":"fx-activate","utm_medium":"email"}}
{"op":"amplitudeEvent","event_type":"fxa_login - forgot_submit","time":1544448341670,"device_id":"7a9b7fc56f1e4ead9efc311cc7f1ab9a","session_id":1544448317264,"app_version":"126","language":"en","os_name":"Mac OS X","os_version":"10.13","event_properties":{},"user_properties":{"flow_id":"738677b02b5a903888a4ed0692c35f16cc58a3d84c24198dcb27de2f10a58199","ua_browser":"Firefox","ua_version":"65.0","utm_campaign":"fx-welcome","utm_content":"fx-activate","utm_medium":"email"}}
{"op":"amplitudeEvent","event_type":"fxa_email - click","time":1544448348951,"device_id":"539a35bc1a6b4bb58a9b9f1a717c4ec6","session_id":1544448317264,"app_version":"126","language":"en","os_name":"Mac OS X","os_version":"10.13","event_properties":{"email_type":"reset_password","email_provider":"other"},"user_properties":{"flow_id":"738677b02b5a903888a4ed0692c35f16cc58a3d84c24198dcb27de2f10a58199","ua_browser":"Firefox","ua_version":"65.0","utm_campaign":"fx-forgot-password","utm_content":"fx-reset-password","utm_medium":"email"}}
{"op":"amplitudeEvent","event_type":"fxa_pref - view","time":1544448357871,"user_id":"80e4360ac5c742d9a04b1272a959b844","device_id":"539a35bc1a6b4bb58a9b9f1a717c4ec6","session_id":1544448317264,"app_version":"126","language":"en","os_name":"Mac OS X","os_version":"10.13","event_properties":{},"user_properties":{"flow_id":"738677b02b5a903888a4ed0692c35f16cc58a3d84c24198dcb27de2f10a58199","ua_browser":"Firefox","ua_version":"65.0","utm_campaign":"fx-forgot-password","utm_content":"fx-reset-password","utm_medium":"email"}}
And this is the event flow after the change, where the device_id is consistent for all events:
{"op":"amplitudeEvent","event_type":"fxa_login - forgot_pwd","time":1544448607381,"device_id":"88ded259951949b8835479a6fe0697eb","session_id":1544448592251,"app_version":"126","language":"en","os_name":"Mac OS X","os_version":"10.13","event_properties":{},"user_properties":{"flow_id":"75061fe847f5f6d0e6600007b387e24b8114aa7aceb96efa68895dad60fc2ea5","ua_browser":"Firefox","ua_version":"65.0","utm_campaign":"fx-welcome","utm_content":"fx-activate","utm_medium":"email"}}
{"op":"amplitudeEvent","event_type":"fxa_login - forgot_submit","time":1544448611075,"device_id":"88ded259951949b8835479a6fe0697eb","session_id":1544448592251,"app_version":"126","language":"en","os_name":"Mac OS X","os_version":"10.13","event_properties":{},"user_properties":{"flow_id":"75061fe847f5f6d0e6600007b387e24b8114aa7aceb96efa68895dad60fc2ea5","ua_browser":"Firefox","ua_version":"65.0","utm_campaign":"fx-welcome","utm_content":"fx-activate","utm_medium":"email"}}
{"op":"amplitudeEvent","event_type":"fxa_email - click","time":1544448617901,"user_id":"5907dfb0a5ed478eaaa10c9c936f6460","device_id":"88ded259951949b8835479a6fe0697eb","session_id":1544448592251,"app_version":"126","language":"en","os_name":"Mac OS X","os_version":"10.13","event_properties":{"email_type":"reset_password","email_provider":"other"},"user_properties":{"flow_id":"75061fe847f5f6d0e6600007b387e24b8114aa7aceb96efa68895dad60fc2ea5","ua_browser":"Firefox","ua_version":"65.0","utm_campaign":"fx-forgot-password","utm_content":"fx-reset-password","utm_medium":"email"}}
{"op":"amplitudeEvent","event_type":"fxa_pref - view","time":1544448623974,"user_id":"5907dfb0a5ed478eaaa10c9c936f6460","device_id":"88ded259951949b8835479a6fe0697eb","session_id":1544448592251,"app_version":"126","language":"en","os_name":"Mac OS X","os_version":"10.13","event_properties":{},"user_properties":{"flow_id":"75061fe847f5f6d0e6600007b387e24b8114aa7aceb96efa68895dad60fc2ea5","ua_browser":"Firefox","ua_version":"65.0","utm_campaign":"fx-forgot-password","utm_content":"fx-reset-password","utm_medium":"email"}}
Of course, it's a lie because in many cases the events won't really be from the same device. But this device_id is only used to tie the flow together in Amplitude, we're not using it for anything else. Given that it is randomly generated on every page view, we know that it can't be trusted as a true "device" identifier even before this change and the intention already exists to replace it with a canonical ecosystem id when such a thing is available. In the meantime, this solves the real, current problem that exists with funnel analysis for the reset flow in Amplitude.
@mozilla/fxa-devs r?