Mixpanel
AIRSHIP MAINTAINED INTEGRATION
This integration is maintained by Airship. Please contact Airship for support.Feed Airship RTDS events into Mixpanel and target cohorts using Airship tags.
The Mixpanel integration supports two major functions:
Feed Real-Time Data StreamingA service that delivers engagement events in real time via the Data Streaming API or an Airship partner integration. events into Mixpanel. Adding Airship events to Mixpanel provides another behavioral dimension to analyze: audience engagement.
Export Mixpanel cohorts to Airship as tags. You can export cohorts one time or set up dynamic sync, which updates the
mixpanel
tag group every two hours. You can then target Mixpanel tags when creating messages:Segmentation: Create a SegmentA grouping of audience members selected by unique or shared identifiers. Multiple identifiers can be combined within a segment. using a combination of Airship tags and Mixpanel cohorts. Use these segments to send targeted In-AppA message that appears inside of your app. You can send in-app messages to your entire app audience, not just users who have opted-in to push notifications. or Message CenterA place in your app where you can display persistent rich messages, including HTML, video, etc. Similar to email, Message Center represents both the medium (the in-app inbox) and the message type (the messages you send to the inbox). messages.
Automation: If you set the Mixpanel cohort to be dynamic, you can also set up Automation rulesA set of conditions that your audience must meet before they receive a message. or JourneysA series of messages that is initiated by a single automation trigger. Airship sends messages in the series based on your timing settings, and you can also set conditions that determine the continuation of the series. based on the addition or removal of a cohort tag. See: Configure Triggers: Tag Change.
Read more about data export and user matching in Mixpanel’s Airship Set Up Guide.
Mixpanel Integration Prerequisites
To support a Mixpanel integration, you must have a Mixpanel account and integrated your app with both the Airship and Mixpanel SDKs.
Send Mixpanel Cohorts to Airship as Tags
You can use your cohorts in Mixpanel to set tags on your audience, helping you organize and retarget your audience based on analytics information from Mixpanel.
You must set up a tag group called mixpanel
to take advantage of Mixpanel cohorts in Airship.
Follow setup steps in Mixpanel’s Airship Set Up Guide to complete the configuration and send Mixpanel cohorts to Airship.
Mixpanel RTDS Integration
Mixpanel library initialization requires a Mixpanel project token. See Find Project Token to locate your token.
To set up this integration, you must:
- Configure your app to set the
mixpanel_distinct_id
on Airship events. See the Android and iOS setup sections below for more information. - Set up the RTDS integration in the Airship dashboard.
When you set up a Mixpanel RTDS integration, your events will contain a mixpanel_distinct_id
key. This is the identifier Mixpanel uses to differentiate between unique events. As a fallback, you may want to set your Airship Named User value set as to the mixpanel_distinct_id
to ensure that events are matched within Mixpanel.
Android RTDS Setup
// Initialize the Mixpanel library with your project token
MixpanelAPI mixpanel = MixpanelAPI.getInstance(context, "MIXPANEL_PROJECT_TOKEN");
// Get the Mixpanel distinct ID
String distinctId = mixpanel.getDistinctId();
// Add the distinct ID to the current associated identifiers
UAirship.shared().getAnalytics()
.editAssociatedIdentifiers()
.addIdentifier("mixpanel_distinct_id", distinctId)
.apply();
iOS Swift RTDS Setup
// Initialize the Mixpanel library with your project token
Mixpanel.initialize(token: "MIXPANEL_PROJECT_TOKEN")
let mixpanel = Mixpanel.mainInstance()
// Get the Mixpanel distinct ID
let distinctId = mixpanel.distinctId
// Add the distinct ID to the current associated identifiers
let identifiers = UAirship.shared().analytics.currentAssociatedDeviceIdentifiers()
identifiers.setIdentifier(distinctId, forKey:"mixpanel_distinct_id")
UAirship.shared().analytics.associateDeviceIdentifiers(identifiers)
iOS Objective-C RTDS Setup
// Initialize the Mixpanel library with your project token
Mixpanel *mixpanel = [Mixpanel sharedInstanceWithToken:@"MIXPANEL_PROJECT_TOKEN"];
// Get the Mixpanel distinct ID
NSString *distinctId = mixpanel.distinctId;
// Add the distinct ID to the current associated identifiers
UAAssociatedIdentifiers *identifiers = [[UAirship shared].analytics currentAssociatedDeviceIdentifiers];
[identifiers setIdentifier:distinctId forKey:@"mixpanel_distinct_id"];
[[UAirship shared].analytics associateDeviceIdentifiers:identifiers];
Set Up a Mixpanel RTDS Integration in Airship
You will need your Mixpanel token to set up the integration in Airship.
Begin by navigating to Settings » Real-time Data Streaming, and selecting Mixpanel.
Enter a Name and Description for this integration. This helps you identify the integration later.
Enter your Mixpanel Project Token.
Select Yes if you are implemented in Mixpanel’s European Data Center; otherwise leave No checked. If you are unsure which data center you are on please contact our support team.
Choose the event types you’d like to send to Mixpanel. See the next section for a reference table mapping Airship events to Mixpanel events.
Click Activate.
Mapping Airship Event Types to Mixpanel
In Mixpanel, you can find your events by type, prefixed with Airship — e.g., Airship First Opt-in for the "type": "FIRST_OPT_IN"
event. Because the custom
event type differentiates between events by name
, Mixpanel uses the event name
for custom events (if the event has a name), in the format Airship body.name
.
Airship Event | Mixpanel Event |
---|---|
CLOSE | Airship Close |
CONTROL | Airship Control |
CUSTOM | Airship + custom.name (Example: Airship Add To Cart )Defaults to Airship Custom if body.name is absent. |
Email Bounce1 | Airship Bounce |
Email Click1 | Airship Click |
Email Delay1 | Airship Delay |
Email Delivery1 | Airship Delivery |
Email Injection1 | Airship Injection |
Email Open1 | Airship Open |
Email Unsubscribe1 | Airship Unsubscribe |
FIRST_OPEN | Airship First Open |
FIRST_OPT_IN | Airship First Opt-in |
IN_APP_MESSAGE_DISPLAY | Airship In-App Message Display |
IN_APP_MESSAGE_EXPIRATION | Airship In-App Message Expiration |
IN_APP_MESSAGE_RESOLUTION | Airship In-App Message Resolution |
LOCATION | Airship Location |
MOBILE_ORIGINATED | Airship Mobile Originated |
OPEN | Airship Open |
REGION | Airship Region |
RICH_DELETE | Airship Rich Delete |
RICH_DELIVERY | Airship Rich Delivery |
RICH_READ | Airship Rich Read |
SCREEN_VIEWED | Airship Screen Viewed |
SEND | Airship Send |
SEND_REJECTED | Airship Send Rejected |
SHORT_LINK_CLICKED | Airship Short Link Click |
SMS Delivery Report — Aborted2 | Airship SMS Delivery Aborted |
SMS Delivery Report — Delivered2 | Airship SMS Delivered |
SMS Delivery Report — Dispatched2 | Airship SMS Delivery Dispatched |
SMS Delivery Report — Expired2 | Airship SMS Delivery Expired |
SMS Delivery Report — Failed2 | Airship SMS Delivery Failed |
SMS Delivery Report — Rejected2 | Airship SMS Delivery Rejected |
SMS Delivery Report — Undeliverable2 | Airship SMS Delivery Undeliverable |
SMS Delivery Report — Unknown2 | Airship SMS Delivery Unknown |
SUBSCRIPTION | Airship Subscription — indicates change in email subscription status or values |
WEB_CLICK | Airship Web Click |
WEB_SESSION | Airship Web Session |
UNINSTALL | Airship Uninstall |
1Email delivery report events are CUSTOM
type events with a body.name
property indicating the delivery status of an email. Mixpanel uses the body.name
key rather than the type
key to better represent the event.
2SMS Delivery reports are CUSTOM
type events that use the body.name
property to represent the status of your SMS delivery (as reported by the last-mile provider).
Mapping Airship Event Properties to Mixpanel
Airship Event Property | Mixpanel Event Property |
---|---|
body.event_type | Specific Event Type (The event type property is already called Event Type .) |
body.identifiers.msisdn | MSISDN |
body.identifiers.sender | Sender |
body.properties.inbound_message | Inbound Message |
body.properties.keyword | Keyword |
body.properties.outbound_message | Outbound Message |
device.amazon_channel | Amazon Channel ID |
device.android_channel | Android Channel ID |
device.attributes.app_package_name | App Package Name |
device.attributes.app_version | App Version |
device.attributes.background_push_enabled | Background Push Notifications Enabled |
device.attributes.carrier | Carrier |
device.attributes.connection_type | Connection Type |
device.attributes.device_model | Model |
device.attributes.device_os | OS Version |
device.attributes.iana_timezone | Timezone |
device.attributes.locale_country_code | Country Code |
device.attributes.locale_language_code | Language Code |
device.attributes.locale_timezone | Timezone Offset |
device.attributes.locale_variant | Language Variant |
device.attributes.location_enabled | Location Services Enabled |
device.attributes.location_permission | Location Permission |
device.attributes.push_opt_in | Opted Into Push Notifications |
device.attributes.ua_sdk_version | Airship SDK Version |
device.attributes.web_browser_name | Browser |
device.attributes.web_browser_type | Web Browser Type |
device.attributes.web_browser_version | Web Browser Version |
device.attributes.web_user_agent_string | Web User Agent String |
device.channel | Channel ID |
device.delivery_address | Delivery Address |
device.device_type | Device Type |
device.identifiers.AA_visitorID | Adobe Visitor ID |
device.identifiers.address | Email Address |
device.identifiers.com.urbanairship.aaid | Android/Amazon Ad ID |
device.identifiers.com.urbanairship.gimbal.aii | Gimbal App Instance ID |
device.identifiers.com.urbanairship.limited_ad_tracking_enabled | Limited Ad Tracking Enabled |
device.identifiers.com.urbanairship.vendor | Apple Vendor ID |
device.identifiers.GA_CID | Google Analytics Client ID |
device.identifiers.IDFA | IDFA |
device.ios_channel | iOS Channel ID |
device.named_user_id | Named User ID |
id | Event ID |
offset | Event Offset |
occurred | Time |
type | Event Type |
Mapping Airship Tag Change Event Properties to Mixpanel
When Airship sends a tag change event to Mixpanel, Mixpanel reflects the current
tags as event properties. Mixpanel uses the tag group as the property and the tags in the group as the value.
{
"id": "00000169-4a14-67b2-1ddd-d9e733622c3a",
"occurred": "2020-06-23T19:00:45.106Z",
"offset": "1000001260057",
"processed": "2020-06-23T19:00:47.094Z",
"type": "TAG_CHANGE",
"device": {
"ios_channel": "1ef235f0-03d5-1384-893e-a19b5cd0d110",
"channel": "1ef235f0-03d5-1384-893e-a19b5cd0d110",
"device_type": "IOS",
},
"body":{
"add": {
"crm": [
"partner",
"active"
],
"loyalty": [
"silver_member"
]
},
"current": {
"crm": [
"partner",
"active",
"new_user"
],
"loyalty": [
"silver_member",
"special_offers"
],
"device": [
"san_francisco",
"sports"
]
}
},
"type": "TAG_CHANGE"
}
From the example above, Mixpanel maps tag groups and tags as follows:
Airship Event Property | Mixpanel User Property | Value |
---|---|---|
body.current.crm | Airship crm | ["partner", "active", "new_user"] |
body.current.loyalty | Airship loyalty | ["silver_member", "special_offers"] |
body.current.device | Airship device | ["san_francisco", "sports"] |
Categories