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

Apply port adapter pattern to mixpanel analytics #6632

Merged
merged 5 commits into from
Feb 14, 2024

Conversation

rbennettcw
Copy link
Contributor

@rbennettcw rbennettcw commented Feb 7, 2024

Link to Issue

Closes: #6421

Description of Changes

  • Refactors mixpanel as port/adapter pattern to abstract it away

Test Plan

N/A

Deployment Plan

N/A

Other Considerations

N/A

@rbennettcw
Copy link
Contributor Author

Since we need to frequently parse the request context to extract browser info to append to the analytics payload, it's convenient to wrap the analytics().track() call in a function. Currently keeping the analytics controller in place for that.

cc @Rotorsoft

@rbennettcw
Copy link
Contributor Author

I think there may still be some dangling analytics calls that don't use the controller– checking…

Copy link
Contributor

@Rotorsoft Rotorsoft left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

Nice work! ... next step is to inject analytics as middleware in the new framework 😉

@Rotorsoft
Copy link
Contributor

Also, "mixpanel": "^0.14.0" dependency should be move to libs/adapters to keep this clean

@rbennettcw rbennettcw marked this pull request as ready for review February 8, 2024 21:08
@Rotorsoft
Copy link
Contributor

@rbennettcw LGTM, initializing logger inside adapter 👍
@kurtisassad ready for approval

@rbennettcw rbennettcw merged commit be59a0c into master Feb 14, 2024
6 of 7 checks passed
@rbennettcw rbennettcw deleted the ryan/mixpanel-analytics-port-adapter branch February 14, 2024 22:55
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.

Decouple analytics (mixpanel) from the core model
3 participants