Table of Contents
Note: The Urban Airship integration is only available on the Enterprise plan.
This integration combines Amplitude's analytics with Urban Airship's customer engagement tools into one unified system. Using this integration will allow you to interact with any user segment or cohort via push notifications, in-app messages, and more to advance your app engagement or conversion goals.
How It Works
To leverage Amplitude behavioral cohorts within Urban Airship:
1. You need to integrate both the Urban Airship and Amplitude SDKs in your app and follow instructions below to link their key identifiers.
- Urban Airship:
2. In the app code, you will need to link identifiers between two services. IMPORTANT NOTE: The recommended solution is to store your Urban Airship Channel ID as a custom User Property in Amplitude, named UAChannelID.
Use this code snippet for iOS:
AMPIdentify *identify = [[AMPIdentify identify] set:@"UAChannelID" value:[UAirship push].channelID]; [[Amplitude instance] identify:identify];
Use this code snippet for Android:
Identify identify = new Identify().set("UAChannelID", UAirship.shared().getPushManager().getChannelId()); Amplitude.getInstance().identify(identify);
When configured properly, you can look up your test user or device in Amplitude and see the UAChannelID property stored the User Properties, as seen below.
3. Next, you will configure the integration in the Amplitude Dashboard. To do so, go navigate to Settings > Projects > Integrations. Click on Urban Airship and a pop-up will appear:
- First, enter your Urban Airship Secret Key and Urban Airship API Key.
- Next, configure the mapping correctly in the Amplitude Dashboard. We recommend following our standard recommendations and mapping “UAChannelID” to Auto Channel ID in Urban Airship for the ease of integration. However, you can map User ID, Device ID, or any user property on Amplitude to any Urban Airship ID.
Note: Auto Channel maps to the channel ID of the correct platform (Android or iOS) in Urban Airship automatically.
4. When your app update is deployed, you are ready to go.
- Create a Behavioral Cohort in Amplitude: In our example below, we are creating one that counts when a device performs 'PurchaseSubscription' at least once in the last 30 days.
- Ensure that your cohort has at least 1 device listed.
- In the Behavioral Cohorts tab, click on the export icon and select "Export to Urban Airship."
- Your Urban Airship Dashboard will begin processing this cohort as a new List.
5. Once the list has successfully been processed, compose your message in Urban Airship’s Message Composer, and you’ll find your Amplitude-defined segments among the uploaded audience lists for targeting.
6. Send messages and watch your engagement results in Amplitude and Urban Airship.