is it possible to add a new property and assign it a default value for each event, I'm attempting to consideration all page actions as one event by using the same name, but for easy interpretation of feature accessed without knowing seeing the screen for the actual URL
Yes, you can add a new property with a default value to your events in Mixpanel. This is commonly done using Super Properties, which are global event properties that you define once and are automatically applied to all subsequent events.
Using Super Properties
Super properties are perfect for your use case where you want to add consistent properties across all events. Here's how you can implement this:
In JavaScript:
mixpanel.register({
feature_name: 'default_feature'
});LBKS// later when a user accesses a specific feature, you can update it
mixpanel.register({
feature_name: 'pricing_page'
});LBKS// track your standardized event
mixpanel.track('page_action');LBKS```LBKSLBKSThe event will include the `feature_name` property with whatever value was most recently set [Setting Super Properties](https://docs.mixpanel.com/docs/tracking-methods/sdks/javascript#setting-super-properties).
In React Native:
Similarly, in React Native you can use: LBKSmixpanel.registerSuperProperties({ feature_name: 'default_feature' });LBKS
And update it as needed when users navigate to different features Setting Super Properties in React Native.
Best Practices
This approach aligns with Mixpanel's best practices: 1. Keep events as actions: Instead of creating different events for each page/feature, you're using a single event name with properties to differentiate, which is recommended Best Practices.2. Use properties for context: You're using properties to provide context about where the action occurred rather than creating separate events.3. Avoid dynamic event names: By using a consistent event name with varying properties, you're following the recommendation to avoid dynamically named events.You can later use Lexicon to give your property a more user-friendly display name if needed, making it easier for your team to understand the data in reports.
kapa.ai is still learning and improving, please let me know how I did by reacting below.
ℹ️ Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.
Let me check the knowledge base for you again. One moment! 📚
Yes, you can solve the issue of dynamically named events directly in Mixpanel without requiring additional development work. Mixpanel offers several data governance features that help you clean up and organize your event data:
Merging Events in Lexicon
You can use Mixpanel's Lexicon feature to merge your dynamically named events into a single, standardized event: 1. Navigate to Lexicon (your data dictionary in Mixpanel) 2. Select the dynamically named events you want to consolidate 3. Click the "Merge" button 4. Choose which event name should be the standard one going forwardThis allows you to combine events like "Purchase (11-01-2019)" and "Purchase (11-02-2019)" into a single "Purchase" event without changing your implementation Merging Data.
Custom Events
Another option is to create Custom Events, which allow you to: - Combine multiple events into a single virtual event - Create filtered versions of existing eventsFor example, if you have multiple variations of a "Purchase" event, you can create a custom event that includes all of them Custom Events: Combine multiple events for analyses.
Data Views
If you have many dynamically named events across different features or teams, you might also benefit from creating Data Views to organize your data: - Create specific views that only show relevant events for particular teams or analyses - Hide irrelevant or poorly named events from specific views - Maintain cleaner, more focused analytics environments Data Views: A cornerstone of data governance across teams and projectsThese solutions allow you to improve your event structure without requiring development resources to modify your tracking implementation. They're particularly useful when dealing with legacy implementations or when you need quick solutions before a more permanent fix can be implemented.Would you like more specific guidance on which approach might work best for your particular situation?
kapa.ai is still learning and improving, please let me know how I did by reacting below.
ℹ️ Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.