Send Mobile In-App Messages

Mixpanel allows you to create and send richer messages that appear while your iOS app is running. If you are using our in-app messages product, follow these steps:

  1. Include the latest version of the Mixpanel iOS library or Android library in your app.
  2. Make sure you are identifying your users in the app.
  3. Create an in-app message on the Messages tab of the Mixpanel website.

Mixpanel can also send web in-app messages.

Integration 

The Mixpanel iOS and Android libraries automatically check for a message when your app loads or resumes from the background.
 
If an unseen message is available for the current user, it displays immediately in an overlay view.
 

Creating a Mobile In-App Message

In Mixpanel you can contact your users directly through your app with in-app messages.

Select Mobile from the pop-up window to see this form:

Screen_Shot_2018-08-22_at_11.05.45_AM.png

Select the size of your message, either "Fullscreen" or "Mini", and the color of the message, either "Light", "Dark", or "Custom".

Insert an image into your message and write your message directly into the preview image.

You can also choose to add an A/B test to your push notification by selecting ADD AN A/B TEST.

Save a draft of your message at any time in this process by clicking the Save and Exit button at the bottom of the page.

Screen_Shot_2019-03-20_at_12.55.51_PM.png

You can view all of your saved drafts by clicking on the Drafts tab of the main Messages page.

Screen_Shot_2019-03-20_at_12.59.26_PM.png

Using Profile Properties

Similar to emails, in-app messages replace content wrapped in {{}}.

For example, if you add a Location property to your user profiles, you can send messages like this:

Come and visit us at our {{ ${Location} }} office.

A user with a profile property Location: Asheville will get this message:

Come and visit us at our Asheville office.
If some of your profiles have a value, but others don't, you can use a fallback value:
Come and visit us at our {{ ${Location} | fallback:"nearest" }} office!

Profiles without a Location property will receive this message:

Come and visit us at our nearest office!

Targeting Users

After submitting the form for your message design and content, you will then need to define the targeting criteria for the users who will receive the message.

A message's targeting criteria can contain one or more filters. Each filter can contain one or more conditions.

First, select an event, people property, or cohort from the first drop-down list.

MessagesTargetCriteria.png

You can add as many of these targeting filters as you like, which creates groups to target. Add more filters by clicking the + button.

You can then select whether you want to target customers that match all or only some of the filters you chose.

MessagesGroupUngroup.gif

Note

Mixpanel evaluates cohorts every 5-30 minutes based on the size of the cohort, and updates in-app message deliveries as needed.

For example: At 7:15pm, when Mixpanel evaluates the targeting criteria, a user meets the criteria and the message is set to be delivered to them. At 7:16pm, the user does something that makes them ineligible for the cohort. Mixpanel won't update the cohort until the next time it evaluates the cohort. At that time, the user will no longer receive the in-app message. There is, however, a risk that the user may see the in-app message between time 7:16-7:30pm.

Filtering by Events

If you select an event, you will be able to choose when or how frequently that event was performed or not performed by the users you are targeting.

MessagesTargetEvent.gif

You can filter deeper by event or people property by clicking the + Filter button.

You can also choose to add conditions to this targeting event by clicking the + Condition button in the top right of the group. This will serve as a second event target.

MessagesTargetEventCondition.png

You can then select whether you want your targeting users to do both the targeting event and the condition, either or, or to perform the targeting event and then the condition.

MessagesTargetConditionOrAndAll.png

Filtering by Property

If you select a people property, you will be able to choose the specifics of that property depending on the property type (date, string, list, etc.). For example, “First App Open” is a date property, so you will be able to choose when “First App Open” occurred.

MessagesTargetProperty.gif

You can select people property filters by clicking the + Filter button.

You can also choose to add one or more conditions to the property filter by clicking the + Condition button at the top right of the group. This will serve as a second property filter.

MessagesTargetPropertyCondition.png

You can then select whether you want your targeted users to have both the targeting property and the condition, or one or the other.

Filtering by Cohort

If you select a cohort, you will be able to select whether you want to target users in or not in the cohort.

MessagesTargetCohort.gif

You can select people property filters for that cohort by clicking the + Filter button.

Event-Triggered In-App Messages

Install the latest SDKs

You will need to install the following versions or higher to access this functionality:

If you would prefer to keep the old functionality, refer to the Scheduling section below.

After submitting the form for your message design and content, as well as your targeting criteria, you can choose the event trigger option on the delivery settings page to send an in-app message when a user triggers a specific event.

For example, you can send a message saying “Congratulations” when a user triggers an event such as a “level-up” in a game.

This feature is only compatible with events captured by Mixpanel’s client-side SDKs (Android, iOS - Objective-C, and iOS - Swift). The event-triggering event must be from the same SDK as the message for the message to be sent. For example, if you're sending a mobile in-app message on Android, the triggering event can't come from a Javascript event. An in-app message won't show on any mobile device since the event is exclusive to the Javascript SDK. 

Check the box beside Display messages when users perform… and then select the trigger event.

MessagesInAppEvenntTrigger.png

You can filter the message by an event property. This will cause the in-app message to send when the trigger event is performed and the trigger event has a particular property tied to it.

MessagesInAppEventTrigger2.png

Note that:

  • In-app messages cannot be triggered by custom events.
  • The in-app message only sends the first time the event is triggered (no recurrence).
  • You can only use one event and one event property.

Schedule an In-App Message

By default, mobile in-app messages shows immediately when your app loads. Note that users will receive an in-app message more than once if they use multiple devices.

However, it is possible to customize this behavior and control exactly when an in-app message appears.

If, for example, you have a game and would like to show a message when a user accomplishes a goal, you must turn off the automatic showing of messages by setting showNotificationOnActive to NO and call showNotificationWithID at the appropriate point in your app.

// In application:didFinishLaunchingWithOptions:
Mixpanel *mixpanel = [Mixpanel sharedInstanceWithToken:
    YOUR_MIXPANEL_TOKEN];
// Turn this off so the message doesn't pop up automatically.
mixpanel.showNotificationOnActive = NO;

- (void)playerFinishedLevel
{
    [mixpanel showNotificationWithID:INAPP_NOTIFICATION_ID];
}

If you don't want to specify the message ID, you can use showNotification, which shows the first available in-app message targeted at the identified user, if there is one.

Messages are never shown twice to the same user, so you don't have to check if the user already saw the message before calling showNotificationWithID.

If you don't want Mixpanel to check for new in-app messages when your app becomes active, you can turn it off by setting checkForNotificationsOnActive to NO.

This action sets in-app messages not to show automatically, and that the network request to retrieve the messages will occur only when you call showNotification or showNotificationWithID.

Is this article helpful?
2 out of 15 found this helpful

Comments

0 comments

Article is closed for comments.