Mixpanel
Integrating OneSignal with Mixpanel

Mixpanel and OneSignal have joined forces to provide:
- Personalized messaging - Boost engagement with more contextualized messaging from OneSignal, triggered when users enter or exit Mixpanel cohorts.
- Real-time insights - Gain a holistic view of customers by combining Mixpanel in-product user actions and OneSignal message engagement metrics.
- Data-driven campaigns - Leverage product-level user insights for re-engaging campaigns through OneSignal.
Requirements
- A Mixpanel Account
- Upgraded OneSignal Account. Not supported on free plans.
- Your OneSignal app needs Users. This integration does not create users. It maps the users in Mixpanel to those in OneSignal. See our Channel setup docs to get started.
- If using push notifications, you need the OneSignal Mobile SDK and/or Web SDK.
- If using Email and/or SMS, you can Import email addresses and phone numbers.
- Set the OneSignal External ID to match a user ID set in Mixpanel. More details below.
Setup
Add Mixpanel to OneSignal
In OneSignal, navigate to Data > Integrations > Mixpanel and click Activate.

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.

Add OneSignal to Mixpanel
In Mixpanel, navigate to your Integrations and connect OneSignal. See Mixpanel Integrations for more details.
Set the Connector Name as something identifiable like OneSignal - APP_NAME
where APP_NAME
is the name of the app in OneSignal. This is important because you can have multiple OneSignal apps connect to the Mixpanel project.
You will need the following data available in OneSignal Settings > Keys & IDs :
- App ID
- API Key
USER ID PROPERTY
The Mixpanel-OneSignal integration does not create users in OneSignal. It only maps users that exist within both platforms.
In order to map the users in OneSignal and Mixpanel, you need to set the OneSignal External ID to match an available user property in Mixpanel.
The User ID Property refers to any Mixpanel user property that has the same value as the OneSignal External ID.

Example shows the Mixpanel integration "User ID" property maps to the OneSignal External ID.
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
Note on Distinct 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 match109768518080488203109
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.
Integration setup complete!
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 setup instructions above. Exporting user data from Mixpanel does not create the user in OneSignal, the user must already exist and have the matching External ID.
In your Mixpanel Cohorts find the cohort you want to sync, then select Options > Export to... > The OneSignal connection name.

Example shows exporting the cohort to the correct OneSignal integration as set in the setup instructions above.
Export to OneSignal options
Under "Export Type" you have 2 options:
- One-time export will send OneSignal the current user data. Best if sending one message only to the current users.
- Recurring sync is where Mixpanel will send us the updated cohort user data around every 15 minutes. Best if sending recurring messages to updated user list.
Select the option and press Begin Sync.

The Mixpanel Cohort will appear as a "Mixpanel Segment filter" in OneSignal, allowing you to combine it with other filters. For a segment to also be created in OneSignal using this filter:
- The users in the Mixpanel Cohort must 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 the Cohort.
See Segments for more details on filters.

Example shows the "(Mixpanel) All Users in Mixpanel" segment created because the users existed within OneSignal with the correct External ID-User ID mapping.
Missing users in OneSignal?
Track Message Events in Mixpanel
Depending on which message events you enabled in the setup, they will be accessible within Mixpanel in real time as they occur.
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:

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) |
Why doesn't my delivery data match between Mixpanel and OneSignal?
See Why doesn't my delivery data match between Mixpanel and OneSignal?
Example Cohorts
Did not click a push or in-app message
With this type of Cohort you can track devices that may not have received your push or in-app message to send them an email or sms text.
Checking the users that did
get a Message Sent
greater than 1
time in the Last Day
, where Message Type equals to push.
AND
Users that Did Not
have the App Opened from Push
(works on web as well) in the Last day
.

Were Shown a Specific Message in the Past Day
Using Message Sent
at least 1 time
, in the Last 7 days
where Message Type
equals in-app
and Message
equals [name of the message]
In this cast the [name of the message]
is pulled from:
- Push Notification Title
- In-App Message Name

FAQ
Why don't my cohort & segment counts match?
There are two main reasons why your Mixpanel Cohort user count may not match the OneSignal Segment user count:
1. Missing Users or Incorrect External ID
For users to sync between Mixpanel and OneSignal, they must exist in OneSignal with the correct External ID matching the Mixpanel User ID. The Mixpanel integration does not create Users or Subscriptions in OneSignal. Users without an External ID or with a mismatched ID won’t sync.
Refer to Channel setup to get started creating users and subscriptions.
2. Segments Count Subscribed Subscriptions
OneSignal segments count only subscribed subscriptions. Users with unsubscribed subscriptions won’t be included in the segment but remain 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 devices within my Mixpanel Cohort sync to OneSignal?
Unsubscribed subscriptions are not counted in the OneSignal segment at this time. However, those users do exist within the segment so they will be counted if used for Journeys and unsubscribed mobile subscriptions can receive In-app messages.
Why doesn't my delivery data match between Mixpanel and OneSignal?
In OneSignal, Users are identified by their External ID, which must match the Mixpanel User ID for event tracking to align across platforms.
Each user can have multiple Subscriptions, for example, lets say a user has 2 Android devices, 1 iOS device, 2 web push subscriptions, 1 email address, and 1 phone number. This means the user has 7 subscriptions.
When sending messages to users, they are being sent to their eligible subscriptions. If you send a push notification to this user, it could potentially generate 5 sent events, 5 received events, and 5 click events.
In the message event properties, you should see the subscription_id
property to know which subscription performed the event.
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.
For more details, see Users.
How can we pass user or subscription events?
User and subscription events like accepting/denying push permissions, user logging in/out, and other events are not currently being sent automatically.
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
Can I change the cohort name and have that reflected in OneSignal?
Changing the name of a synced Mixpanel Cohort will not show in OneSignal.
Upon syncing cohorts into OneSignal Segments, 2 things happen:
- a OneSignal Segment is created with that cohort name
- a Segment Data Filter is created for that cohort
The OneSignal Segment name can be changed, but the Segment Data Filter will always reflect the original name of the Mixpanel Cohort.
If you want to reflect this change, you will need to create a new Cohort in Mixpanel and sync it to OneSignal with the new name.
Updated 11 days ago