how can I flag an event if it’s the first event ever for a user (either identified or unidentified)?
Hi Elena M., Please stand by as I search the Mixpanel knowledge base for an AI-powered answer. I normally take about 15 seconds or so. In case AI cannot answer your question, feel free to reach out to Mixpanel support at mixpanel.com/get-support. If you have follow-up questions for this thread, please tag me again with your question: @kapa.ai <follow-up question> đź‘‹
Feel free to ask a follow-up question once I've answered by mentioning me with @kapa.ai
To flag an event if it's the first event ever for a user in Mixpanel, you can use the First Time Filter feature. This feature allows you to filter events to only show the first instance of that event performed by a user.
Using First Time Filter
Mixpanel computes this on-the-fly by scanning each user's history to determine if this was the first instance of the event performed by the user, based on timestamp. This works for both identified and unidentified users since Mixpanel tracks users based on their distinct_id (which could be either a device ID for anonymous users or a user ID for identified users).You can add a First Time Filter to any event in Mixpanel reports. This will filter the event down to only the first instance of the event performed by each user, which helps answer questions like: - How many users sign up or perform another key event for the first time each week? - Which referrers do most first-time users come from? - How quickly do users make a purchase after their first time engaging with the app?Mixpanel Advanced Features provides more details on this functionality.Note that when there's a tie in the timestamps of the first event (e.g., if a user performs multiple instances of the same event in the same second), all of those events will be considered the "first time" and will match the filter.This approach works regardless of whether the user is identified or unidentified, as Mixpanel's identity management system will properly track users across both states if you've implemented proper user identification.
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! 📚
You can create a custom property in Mixpanel that flags events if they are the first event ever for a user. This can be accomplished using Mixpanel's Custom Properties feature.
Creating a Custom Property for First Events
To create a custom property that flags first events: 1. Click the plus button to the right of the search bar in your Mixpanel report
2. Select "Event Property" to open the property builder
3. Give your property a name (e.g., "Is First Event")
4. Use the formula functionality to define the logic for identifying first eventsCustom Properties allows you to calculate new properties on the fly using a simple Excel-like formula language.For your specific use case, you could leverage the $mp_first_event_time
property which Mixpanel automatically calculates. This is a profile property that represents the time of the user's very first event in Mixpanel.You can create a custom property that compares the event's timestamp with the user's first event time to determine if they match, which would indicate it's the user's first event.Note that custom properties can be:
- Created locally within a report (available to all plan users)
- Saved globally for reuse across reports (available to Growth and Enterprise plan users)This approach gives you the flexibility to flag first events and use this flag in various analyses across your Mixpanel project.If you need more complex logic or want this property to be available directly in your raw event data, you might need to implement this at the tracking level by adding a property when sending events to Mixpanel.Would you like more specific guidance on the formula to use for this custom property?
Limitations
Keep in mind that the formula used to compose your custom property can't be longer than 20,000 characters, though for this use case your formula would be much simpler.Also note that when there's a tie in the timestamps of first events (e.g., if multiple events occur in the same second), all of those events might be flagged as "first events."
Saving and Sharing
Once you've created your custom property, you can: 1. Apply it locally to your current report 2. Save it for future use 3. Share it with colleagues if neededCustom Properties Documentation provides more details on these options.
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! 📚
You're right to be confused. I made a mistake in my previous response. The $mp_first_event_time
is actually a user profile property, not an event property. According to the documentation: > "$mp_first_event_time" is a "Mixpanel calculated property that represents the time of the user's (or group's) very first event in Mixpanel. This can be used to filter/segment reports by users (or groups) who were 'new' in a particular timeframe."Reserved Properties lists this as a reserved profile property, not an event property.To flag an event as the first event for a user, you have a few options: 1. Use Mixpanel's built-in "First Time" filter in reports, which filters events to only the first instance of that event performed by a user based on timestamp.2. If you need this as an actual property on your events, you would need to implement this at the tracking level in your code. You would need to track whether a user has performed any events before and set a custom property (like "is_first_event") when sending the event to Mixpanel.3. For analysis purposes, you can use Mixpanel's First Time Filter feature as mentioned in Analyzing First Time Users.I apologize for the confusion in my previous response.
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.