-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Mixpanel Event Tracking β SSI/Action Plan (M2-7698) #543
Conversation
This pull request is automatically being deployed by Amplify Hosting (learn more). |
79f56fc
to
d1c69a8
Compare
Create Mixpanel utilities for conveniently adding the `Item Types` and optionally populating the `Feature` property for all events tracked during an assessment. Simplifies some existing tracking code. The the `Feature` property is now an array after discussions with the data team, since it's now used for multiple features that can be present at the same time, and as an array it requires careful handling.
To be able to add "Item Types" to this and other events required of this Jira task, a call to the `applets/{applet_id}/base_info` endpoint is needed to fetch the item types contained in the activity being completed. As anoying as it is to have to make another request because of incomplete data coming from `applets/{applet_id}`, this seems to be the most convenient way forward for now. We can optimize performance if needed down the road; it will likely require fixing the BE to return more consistent data.
Tracks `Report Generated`, `Report Download Clicked` and `Save & Exit Clicked` events.
This should allow tests to pass locally without messing with env vars.
d1c69a8
to
a20e283
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work. Left you a couple comments for consideration.
One thing that gave me pause was the idea of incurring an extra request just to satisfy the Item Types
analytics. I think we should do a follow-up task that adds the containsResponseTypes
property to the useAppletByIdQuery
response
520a61e
to
f9b2c87
Compare
Agreed, I was hoping not to have to make an extra request, but I didn't see a way around it for now. Incorporating |
Update the code to match the new AC provided by the data team.
5a70ff9
to
6add2d1
Compare
π Description
π Jira Ticket M2-7698
This PR adds new event properties to existing Mixpanel events during an assessment in the web app, as well as adds three new events. The events affected are:
Assessment Started
Assessment completed
1Activity Resume Button Pressed
Activity Restart Button Pressed
Response Report Generated
(new) 1Response Report Download Clicked
(new) 1Save & Exit Clicked
(new) 1The new properties added are:
For the new "Response Report β¦" events:
Item ID
: the ID of the Phrase Builder itemTotal Response Reports
: the total number of Phrase Builder items in the activityFor all the above events:
Item Types
: an array of unique item types in use for the current activityFeature
array containingSSI
: when the activity contains the Phrase Builder item type, and when performing actions on an Action Plan item type 2πΈ Screenshots
N/A
πͺ€ Peer Testing
Refer to the ticket description for a table listing what events to expect, how to trigger them, and what properties should be attached to them.
For each event:
Expected outcome: The event matching the Event Name column should have been added to the top of the list.
Expected outcome: The custom properties for that event mentioned in the Details column should be listed.
βοΈ Notes
1: To be able to access the list of item types used for the current activity at these times during an assessment, it was necessary to perform another API call to adequately populate the
SurveyContext
(which is available during these events), basically due to inconsistency in similar API responses. See this commit for details.2: The
Feature
property used to be a scalar string, but sinceFeature
is already used forMulti-informant
(during Take Now) it was agreed that it should now be an array property, containing all active "features".