-
Notifications
You must be signed in to change notification settings - Fork 83
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: add support of custom page event name in mixpanel #1622
Conversation
Important Auto Review SkippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the To trigger a single review, invoke the WalkthroughThe update introduces a method for users to generate custom event names for page views in the Mixpanel analytics integration. This is facilitated by a new function that creates these names based on user-defined templates. The Mixpanel class has been enhanced to support this customization, incorporating Handlebars for flexible event name definition. Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
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.
Review Status
Actionable comments generated: 3
Configuration used: CodeRabbit UI
Files ignored due to path filters (2)
package-lock.json
is excluded by:!**/*.json
package.json
is excluded by:!**/*.json
Files selected for processing (3)
- packages/analytics-js-integrations/tests/integrations/Mixpanel/util.test.js (17 hunks)
- packages/analytics-js-integrations/src/integrations/Mixpanel/browser.js (3 hunks)
- packages/analytics-js-integrations/src/integrations/Mixpanel/util.js (6 hunks)
Additional comments: 4
packages/analytics-js-integrations/src/integrations/Mixpanel/util.js (1)
- 6-6: The import of
Handlebars
is correctly added to support the template processing required for generating custom event names. Ensure thatHandlebars
is listed as a dependency in the project'spackage.json
to avoid runtime errors.Verification successful
The import of
Handlebars
inMixpanel/util.js
and its listing as a dependency in the project'spackage.json
file has been successfully verified. This ensures that the necessary support for template processing required for generating custom event names is correctly integrated into the project.Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Check if Handlebars is listed as a dependency in package.json rg '"handlebars":' package.jsonLength of output: 61
packages/analytics-js-integrations/src/integrations/Mixpanel/browser.js (2)
- 18-18: The import of
generatePageOrScreenCustomEventName
is correctly added to support the generation of custom event names within theMixpanel
class. This is necessary for the feature being introduced.- 67-68: The addition of
useUserDefinedPageEventName
anduserDefinedPageEventTemplate
properties to theMixpanel
class is correctly implemented. These properties are essential for toggling the custom event name feature and defining the template for event names, respectively. Ensure that these properties are documented in the integration's configuration guide for users.packages/analytics-js-integrations/__tests__/integrations/Mixpanel/util.test.js (1)
- 11-11: The import statement for
generatePageOrScreenCustomEventName
correctly adds the new utility function to the test file, ensuring it can be tested.
packages/analytics-js-integrations/__tests__/integrations/Mixpanel/util.test.js
Outdated
Show resolved
Hide resolved
packages/analytics-js-integrations/src/integrations/Mixpanel/util.js
Outdated
Show resolved
Hide resolved
packages/analytics-js-integrations/src/integrations/Mixpanel/browser.js
Outdated
Show resolved
Hide resolved
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.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (3)
- packages/analytics-js-integrations/tests/integrations/Mixpanel/util.test.js (17 hunks)
- packages/analytics-js-integrations/src/integrations/Mixpanel/browser.js (3 hunks)
- packages/analytics-js-integrations/src/integrations/Mixpanel/util.js (6 hunks)
Files skipped from review as they are similar to previous changes (3)
- packages/analytics-js-integrations/tests/integrations/Mixpanel/util.test.js
- packages/analytics-js-integrations/src/integrations/Mixpanel/browser.js
- packages/analytics-js-integrations/src/integrations/Mixpanel/util.js
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #1622 +/- ##
===========================================
+ Coverage 52.35% 52.41% +0.05%
===========================================
Files 586 586
Lines 16653 16673 +20
Branches 3238 3236 -2
===========================================
+ Hits 8719 8739 +20
- Misses 6517 6523 +6
+ Partials 1417 1411 -6 ☔ View full report in Codecov by Sentry. |
size-limit report 📦
|
packages/analytics-js-integrations/src/integrations/Mixpanel/browser.js
Outdated
Show resolved
Hide resolved
packages/analytics-js-integrations/__tests__/integrations/Mixpanel/util.test.js
Outdated
Show resolved
Hide resolved
packages/analytics-js-integrations/__tests__/integrations/Mixpanel/util.test.js
Show resolved
Hide resolved
You should not need handlebars to crete event templates, nor any templating engine of that sorts. Just write a method yourself |
…rowser.js Co-authored-by: Sai Kumar Battinoju <[email protected]>
packages/analytics-js-integrations/src/integrations/Mixpanel/util.js
Outdated
Show resolved
Hide resolved
packages/analytics-js-integrations/src/integrations/Mixpanel/util.js
Outdated
Show resolved
Hide resolved
packages/analytics-js-integrations/src/integrations/Mixpanel/util.js
Outdated
Show resolved
Hide resolved
…til.js Co-authored-by: Sai Kumar Battinoju <[email protected]>
packages/analytics-js-integrations/src/integrations/Mixpanel/util.js
Outdated
Show resolved
Hide resolved
packages/analytics-js-integrations/src/integrations/Mixpanel/util.js
Outdated
Show resolved
Hide resolved
Quality Gate passedIssues Measures |
PR Description
Resolves INT-1553
handlebars.js
library for dynamic event template.Linear task (optional)
https://linear.app/rudderstack/issue/INT-1553/mixpanel-cloud-mode-make-page-and-screen-calls-naming-configurable
Cross Browser Tests
Please confirm you have tested for the following browsers:
Sanity Suite
Security
Summary by CodeRabbit