Learn how to integrate OneSignal with Mixpanel to sync cohorts, trigger personalized messaging, and track real-time user engagement.
OneSignal + Mixpanel integration overview
Integrate OneSignal with Mixpanel to send detailed message engagement events and import behavioral user cohorts. This enables real-time targeting based on user behavior to improve onboarding, re-engagement, and conversion.
Key benefits
- Send message events to Mixpanel: Track delivery, clicks, failures, and more across push, in-app, email, and SMS.
- Real-time insights – Unify Mixpanel product analytics with OneSignal engagement metrics.
- Data-driven campaigns – Run smarter re-engagement using Mixpanel’s behavioral segmentation.
- Import cohorts from Mixpanel: Automatically sync behavior-based cohorts into OneSignal as filters for targeting.
- Personalized messaging – Trigger contextual OneSignal messages when users enter or exit Mixpanel cohorts.
Requirements
- Mixpanel Account
- OneSignal Paid Plan
- OneSignal app with Users and External ID set.
This integration does not create users. It maps the users in Mixpanel to those in OneSignal.
Setup
Add Mixpanel to OneSignal
In OneSignal, navigate to Data > Integrations > Mixpanel and click Activate.
Enable Mixpanel integration in OneSignal
In Mixpanel:
- Find your Project Token then copy-paste it into OneSignal.
- Check your Data Residency. If using Mixpanel’s EU servers, check the Send events exclusively to Mixpanel’s EU Residency Server box.
Select message events
Select which OneSignal message events you want to send to Mixpanel. When finished, click Activate.
Mixpanel settings in OneSignal
Add OneSignal to Mixpanel
In your Mixpanel Integrations, add OneSignal.
Add OneSignal Integration in Mixpanel
Set the Connector Name as something identifiable like OneSignal - APP_NAME
where APP_NAME
is the name of the app in OneSignal.
You will need the following data available in OneSignal Settings > Keys & IDs :
- App ID
- API Key
USER ID mapping
This step is essential for cohort syncing and event tracking to work properly.
To match users across both systems:
- Use a shared identifier: The External ID in OneSignal must match an Mixpanel User ID Property selected (like user_id).
- Verify that the selected user property exists across your Mixpanel and OneSignal User Profiles.
Mixpanel's dashboard for setting the OneSignal properties.
Verify the User ID Property you selected is available in your Mixpanel user profile properties.
Mixpanel > Users > User Profile Properties
The same value in Mixpanel for the user profile property must match the External ID in OneSignal.
OneSignal > Audience > Users > External ID
If you match users to OneSignal based on the Mixpanel $distinct_id
then it will only match with the top value.
In below example, only 890ea9b1-9024-4fb9-a92f-152ba67dd21a
will work. It cannot match 109768518080488203109
or $device:1880c06821f1b3-052354675cde95-1d525634-1fa400-1880c06821f1b3
.
Use caution when setting Distinct ID if used for the User ID Property mapping.
Click Continue when finished.
You should now be able to export cohorts from Mixpanel to OneSignal and collect message events from OneSignal to Mixpanel.
Export Mixpanel cohorts to OneSignal
You can sync the users within your Mixpanel cohorts to the users within OneSignal as long as they have the matching User ID/External ID property discussed in the previous step.
Exporting user data from Mixpanel does not create the user in OneSignal, the user must already exist and have the matching External ID.
To export users from Mixpanel to OneSignal:
- In Mixpanel, create a cohort.
- Click Options > Export to… > The OneSignal Connection name.
How to export a Mixpanel cohort to OneSignal.
- Choose sync frequency and press Begin Sync.
Mixpanel frequency options.
OneSignal Segment creation
- The synced cohort appears in OneSignal as an Mixpanel Segment filter.
- A Segment for the cohort will automatically be created if the following conditions are met:
- The users in the Mixpanel Cohort also exist in OneSignal with matching External ID.
- You must not exceed your Segment limit in OneSignal.
If both conditions are met, OneSignal will automatically generate a Segment using the Mixpanel Cohort filter and name of the Cohort.
How to create a Segment from a Mixpanel Cohort
Track message events in Mixpanel
Once connected, OneSignal will send message events to Mixpanel in real time.
To test this, send yourself a message from OneSignal, then navigate to your user profile page in Mixpanel.
Within the Activity Feed, you should see the events populate:
Example of Mixpanel activity feed with OneSignal message events.
Message events
These are the message event kinds that OneSignal sends to Mixpanel. You can select which of these events you want to send to your Mixpanel project within the OneSignal Integrations Settings.
Message Event Kind (OneSignal) | Message Event Name (Mixpanel) | Event Description |
---|---|---|
Push Sent | Message Sent | Push notification successfully sent. |
Push Received | Message Received | Push notification successfully received. |
Push Clicked | App Opened from Push | Push notification touched on device. |
Push Failed | Push Failed | Push failed to be sent. Check the failed message report in OneSignal. |
Push Unsubscribed | Push Unsubscribed | The Subscription unsubscribed from push. |
In-App Impression | Message Sent | In-App Message successfully displayed on device. |
In-App Clicked | Message Opened | In-App Message clicked on device. |
In-App Page Displayed | In-App Page Displayed | In-App Message page is displayed. |
Email Sent | Message Sent | Email successfully sent. |
Email Received | Message Received | Email received by recipient. |
Email Opened | Message Opened | Email opened by recipient. |
Email Link Clicked | App Opened from Push | Email link clicked on. |
Email Unsubscribed | Email Unsubscribed | Email unsubscribed by recipient. |
Email Reported As Spam | Email Reported As Spam | Email reported as spam by recipient. |
Email Bounced | Email Bounced | Email returned to sender due to permanent error. |
Email Failed | Email Failed | Could not deliver the email to the recipient’s inbox. |
Email Suppressed | Email Suppressed | The email address is on your suppression list. Either it bounced or marked your emails as spam. |
SMS Sent | App Opened from Push | SMS sent to recipient. |
SMS Failed | SMS Failed | SMS failed to send. |
SMS Delivered | SMS Received | SMS successfully delivered. |
SMS Undelivered | SMS Undelivered | The SMS could not be sent. |
Event properties
These are the properties that are present on any events sent from OneSignal to Mixpanel
PROPERTY NAME | DESCRIPTION |
---|---|
Distinct ID | The external_id associated with the message. |
Message ID | The identifier of the discrete message. |
Message Name | The message name. |
Message Title | The message title. |
Message Contents | The message contents. |
message_type | The type of message sent, push, in-app, email, SMS. |
template_id | The message template used (API and Journey Messages). |
subscription_id | The OneSignal set device/email/sms identifier. |
device_type | The device type that received the message. |
language | The two character language code of the device. |
source | onesignal (is indicated as the source for all events) |
FAQ
Why don’t my cohort & segment counts match?
-
Missing or mismatched External IDs Only users with a matching OneSignal External ID and Mixpanel User ID are included. This integration doesn’t create users or subscriptions.
-
Unsubscribed users OneSignal segments only display the count for subscribed Subscriptions. Unsubscribed Subscriptions are available for Journeys or In-App Messages.
For example, if an Mixpanel cohort has 10 users but the OneSignal segment shows 8 Subscriptions, the 2 missing users may:
- Not exist in OneSignal or have an incorrect External ID.
- Have unsubscribed subscriptions.
To verify, check the Audience > Users tab in OneSignal to see if the users exist and have active subscriptions.
Do unsubscribed users sync from Mixpanel?
Yes, but they are excluded from the OneSignal segment counts at this time. You can still message them via Journeys or In-app messsages if they have other Subscriptions or their Subscription type supports it.
Why doesn’t delivery data match?
A single user may have multiple Subscriptions (push devices, email addresses, phone numbers). Each Subscription generates its own delivery event. For example:
- 1 user = 2 Android + 1 iOS + 2 Web = 5 push Subscriptions
- 1 push message = up to 5 sent/received/clicked events
Use the subscription_id
in event properties to trace the exact source.
To troubleshoot missing events:
- Ensure
OneSignal.login
is called whenever a user is identified to set the External ID. - Verify that
OneSignal.logout
isn’t removing the External ID. - Check API requests or CSV uploads that may alter the External ID.
How can we send user/subscription events?
User and subscription-level events (e.g., permission granted, user login/logout) are not automatically sent.
The OneSignal SDK has event listeners that can be used to track these events for you to send to Mixpanel:
- User State Observer: Mobile SDK , Web SDK
- Permission Observer: Mobile SDK , Web SDK