Skip to content
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

FFS-2291 - Implement Mixpanel events #412

Merged
merged 49 commits into from
Jan 22, 2025
Merged

FFS-2291 - Implement Mixpanel events #412

merged 49 commits into from
Jan 22, 2025

Conversation

millerti
Copy link
Contributor

@millerti millerti commented Jan 8, 2025

FFS-2291

Changes

  1. Events now file to Mixpanel
  2. Events still file to NewRelic
  3. Some events have new names in Mixpanel per this map

Testing

  1. Add the MIXPANEL_TOKEN from 1Password into your env.development.local file
  2. Satisfy yourself that going through the workflow logs events to both Mixpanel and NewRelic
  3. Convince yourself that only the new Mixpanel event names are being logged to Mixpanel
  4. Convince yourself that only the old NewRelic event names are being logged to NewRelic
  5. Verify that the NewRelic dashboards still appear to work
  6. Convince yourself that, when a new invitation_id is present, Mixpanel identifies events for that as being done by a new user

Acceptance testing

  • No acceptance testing needed
    • This change will not affect the user experience (bugfix, dependency updates, etc.)
  • Acceptance testing prior to merge
    • This change can be verified visually via screenshots attached below or by sending a link to a local development environment to the acceptance tester
    • Acceptance testing should be done by design for visual changes, product for behavior/logic changes, or both for changes that impact both.
  • Acceptance testing after merge
    • This change is hard to test locally, so we'll test it in the demo environment (deployed automatically after merge.)
    • Make sure to notify the team once this PR is merged so we don't inadvertently deploy the unaccepted change to production. (e.g. :alert: Deploy block! @ffs-eng I just merged PR [#123] and will be doing acceptance testing in demo - please don't deploy until I'm finished!)

tdooner and others added 30 commits December 17, 2024 10:57
This adds a simple MixpanelEventTracker module, comparable to the
NewRelic one.
Snyk has created this PR to upgrade @uswds/uswds from 3.9.0 to 3.10.0.

See this package in npm:
@uswds/uswds

See this project in Snyk:
https://app.snyk.io/org/ospo/project/a94f26c7-ed40-4004-a636-d3b13c37de47?utm_source=github&utm_medium=referral&page=upgrade-pr

Co-authored-by: snyk-bot <[email protected]>
Snyk has created this PR to upgrade sass from 1.80.6 to 1.81.0.

See this package in npm:
sass

See this project in Snyk:
https://app.snyk.io/org/ospo/project/a94f26c7-ed40-4004-a636-d3b13c37de47?utm_source=github&utm_medium=referral&page=upgrade-pr

Co-authored-by: snyk-bot <[email protected]>
* Bump vulnerabilities

* Version bump nanoid

* Bump as transient

* Revert "Bump vulnerabilities"

This reverts commit 983020d.

# Conflicts:
#	app/package-lock.json
* Redirect if portal is disabled

* Default staff protal to true

* Add test

* Revert schema

* Disable and move copy to dictionary

* Move to base controller

* Update tests to reflect disabled portal

* Enable portals for their respective test suites

* Avoid should

* Update app/spec/controllers/caseworker/entries_controller_spec.rb

Co-authored-by: Tom Dooner <[email protected]>

* Better assertion

---------

Co-authored-by: Tom Dooner <[email protected]>
* Make the /api/pinwheel/user_action endpoint generic so it can receive
  an "eventName" and arbitrary "attributes" for an event. This will be
  used in subsequent commits for Pinwheel modal events.
* Create new event, `ApplicantSelectedEmployerOrPlatformItem`, to
  replace events `ApplicantSelectedPopularPayrollPlatform` and
  `ApplicantSelectedPopularAppEmployer`. A unified event prevents the
  javascript from having to know which event to send, and will also make
  funnel analysis and future maintenance easier.
* Add an attribute `is_default_option` to the new event so we can tell
  apart clicks on the 12 default items from clicks on search results.
* Add the `name` attribute to also be present on search results (as it
  was previously only present on the default options)
* Add tests for user action API
These events cover most of what we're hoping to instrument for future
Pinwheel sessions. In the order a user may experience them:

1. `PinwheelShowProviderConfirmationPage` - sent when a provider
   confirmation screen is shown (e.g. "Amazon" showing multiple
   platforms like A to Z and ADP)
2. `PinwheelShowLoginPage` - sent when the first screen of a login is
   shown (whether it's employer disambiguation, username/password, or
   other input required by user)
3. `PinwheelAttemptLogin` - sent when the user attempts login (sent only
   once on the first screen even if there are subsequent screens for MFA
   or other employer-specific questions). Unfortunately, there are no
   Pinwheel events on the subsequent login pages.
4. `PinwheelError` - sent when an error occurs, likely an incorrect
   login or MFA code, but also a system error.
5. `PinwheelSuccess` - sent when the login completes.

If the user doesn't follow the intended path through the modal, they may
trigger:
6. `PinwheelShowDefaultProviderSearch` - sent when the user deselects
   the employer or platform and returns to the beginning of the pinwheel
   modal
7. `PinwheelAttemptClose` - shown when the user clicks the "X" in the
   modal, before confirming the closure
8. `PinwheelCloseModal` - shown when the modal actually closes
@millerti millerti changed the title Timo/2291 FFS-2291 - Implement Mixpanel events Jan 17, 2025
@millerti millerti marked this pull request as ready for review January 17, 2025 21:39
Copy link
Contributor

@tdooner tdooner left a comment

Choose a reason for hiding this comment

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

No blockers but some suggestions for future work that maybe we could add as tech debt tickets later.

@millerti millerti merged commit 64654c5 into main Jan 22, 2025
20 checks passed
Comment on lines +90 to +94
event_logger.track("CbvPageView", request, {
cbv_flow_id: @cbv_flow.id,
invitation_id: @cbv_flow.cbv_flow_invitation_id,
site_id: @cbv_flow.site_id,
path: request.path
Copy link
Contributor

Choose a reason for hiding this comment

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

Note, I believe this is breaking some views, specifically expired links.

The error message is being swallowed and the user is redirected to a flash error message, which is why we didn't catch it.

@millerti millerti deleted the TIMO/2291 branch February 21, 2025 22:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants