diff --git a/app/app/controllers/cbv/base_controller.rb b/app/app/controllers/cbv/base_controller.rb index 0eaf756c..6229756d 100644 --- a/app/app/controllers/cbv/base_controller.rb +++ b/app/app/controllers/cbv/base_controller.rb @@ -90,6 +90,7 @@ def capture_page_view event_logger.track("CbvPageView", request, { cbv_flow_id: @cbv_flow.id, invitation_id: @cbv_flow.cbv_flow_invitation_id, + cbv_applicant_id: @cbv_flow.cbv_applicant_id, client_agency_id: @cbv_flow.client_agency_id, path: request.path }) diff --git a/app/lib/mixpanel_event_tracker.rb b/app/lib/mixpanel_event_tracker.rb index be83c98e..35974354 100644 --- a/app/lib/mixpanel_event_tracker.rb +++ b/app/lib/mixpanel_event_tracker.rb @@ -8,12 +8,12 @@ def initialize end def track(event_type, request, attributes = {}) - # Use the "invitation_id" attribute as the distinct_id as it currently best + # Use the "cbv_applicant_id" attribute as the distinct_id as it currently best # represents the concept of a unique user. - invitation_id = attributes.fetch(:invitation_id, "") + applicant_id = attributes.fetch(:cbv_applicant_id, "") distinct_id = "" - if invitation_id.present? - distinct_id = "applicant-#{invitation_id}" + if applicant_id.present? + distinct_id = "applicant-#{applicant_id}" # This creates a profile for a distinct user flow_id = attributes.fetch(:cbv_flow_id, "")