Amplitude
AIRSHIP MAINTAINED INTEGRATION
This integration is maintained by Airship. Please contact Airship for support.Airship Real-Time Data StreamingA service that delivers engagement events in real time via the Data Streaming API or an Airship partner integration. (RTDS) delivers user-level information about push sends, conversions, and uninstall events. Adding Airship’s unique information to Amplitude gives you a full view of what’s going on in and around your app.
By adding user-level mobile engagement data to your Amplitude data, you can leverage Amplitude Behavioral Cohorts for targeting via Airship.
You can also leverage Amplitude’s behavioral cohorts in Airship as TagsMetadata that you can associate with channels or Named Users for audience segmentation. Generally, they are descriptive terms indicating user preferences or other categorizations, e.g., wine_enthusiast
or weather_alerts_los_angeles
. Tags are case-sensitive..
Amplitude Integration Requirements
- Accounts
- Amplitude — Enterprise Account
- Airship
- Messaging
- Real-Time Data Streaming — Required for outbound integration only
- Airship project
- The Airship SDK must use the same user identity as the Amplitude SDK.
Inbound Integration
The inbound integration applies Amplitude user information to Airship users as TagsMetadata that you can associate with channels or Named Users for audience segmentation. Generally, they are descriptive terms indicating user preferences or other categorizations, e.g., wine_enthusiast
or weather_alerts_los_angeles
. Tags are case-sensitive.. It works by syncing an Amplitude behavioral cohort with Airship. Airship then sets Tags on the applicable users. Once your data is in Airship, you can target users who do or do not have those Tags.
The Tags appear in the amplitude
Tag GroupAn array of tags that you can associate with both channels and Named Users. and contain the name and ID of your synced Amplitude cohort in the format [Amplitude] <cohort name>: <cohortID>
. For example: [Amplitude] Has Sent Notification: y4isxl9
.
See also Identify users with similar behaviors in Amplitude’s documentation.
Configuring the Inbound Integration
In Airship:
- Go to Settings.
- Under Project Configuration, select Manage for Partner Integrations.
- Select Amplitude.
- Select Configure for the inbound integration and follow the onscreen instructions to:
- Create a Tag GroupAn array of tags that you can associate with both channels and Named Users. and an authentication token. Amplitude uses the token to communicate with your project in Airship.
- Set up an Airship audience cohort in Amplitude.
From your new cohort in Amplitude, select Sync, then Airship. Airship will start setting Tags representing your Amplitude data on applicable members of your Airship audience.
You can continue syncing on demand or set up recurring or real-time syncing. See Sync to third-party destinations in Amplitude’s Syncs and integrations documentation.
Targeting Users
In the API, target using the "audience"
object. Specify the amplitude
Tag Group and the Tag in the format [Amplitude] <cohort name>: <cohortID>
.
{
"audience": {
"group": "amplitude",
"tag": "[Amplitude] Has Sent Notification: y4isxl9"
}
}
To target in the dashboard, create a SegmentA grouping of audience members selected by unique or shared identifiers. Multiple identifiers can be combined within a Segment. and add a Tag as a condition. First select the amplitude
Tag Group, then search for a Tag and complete configuring the Segment. For individual messages, you can create a single-use Segment while creating the message. You can also create reusable Segments instead of having to recreate your audience selections.
For In-App AutomationsMessages cached on users’ devices and displayed when users meet certain conditions within your app, such as viewing a particular screen or opening the app a certain number of times. and ScenesA single or multi-screen in-app experience cached on users’ devices and displayed when users meet certain conditions in your app or website, such as viewing a particular screen or when a Custom Event occurs. They can be presented in fullscreen, modal, or embedded format using the default swipe/click mode or as a Story. Scenes can also contain survey questions., you cannot target server-side Tags directly. Instead, create a reusable Segment that includes the tags you added using this integration, then select that Segment in the Audience step in the composer. See Segments in Target Specific Users: In-App Experiences. Required: iOS SDK 14.2+Android SDK 14.1+
For more information, see Targeting users in the Tags documentation.
Outbound Integration
The outbound integration sends your Airship events to Amplitude using Real-Time Data StreamingA service that delivers engagement events in real time via the Data Streaming API or an Airship partner integration..
For those events:
- Airship sets the Named UserA customer-provided identifier used for mapping multiple devices and channels to a specific individual. associated with the event as the Amplitude user ID.
- If Named User is not present, Airship sets the Android Advertising ID (AAID) or Apple Advertising ID (IDFA) associated with the event as the Amplitude device ID.
- If neither the AAID nor IDFA is present, Airship sets the Channel IDAn Airship-specific unique identifier used to address a channel instance, e.g., a smartphone, web browser, email address. associated with the event as the Amplitude device ID. If your app is configured to exclude collecting the IDFA by the Airship SDK, it cannot be sent to Amplitude.
- If Airship cannot set the Amplitude user ID or device ID, Airship will not send the event.
Configuring the Outbound Integration
You will need your Amplitude API key, found in your Amplitude app settings . You will also need to know the region where you have implemented Amplitude so you can select a data center, either US or EU. If you are unsure which region to select, contact Airship Support .
In Airship:
- Go to Settings.
- Under Project Configuration, select Manage for Partner Integrations.
- Select Amplitude.
- Select Configure for the outbound integration and follow the onscreen instructions to:
- Add your Amplitude API key.
- Select a data center location.
- Select the Airship events to send to Amplitude.
After completing setup, Airship will begin sending events from your Airship project to your Amplitude instance.
Setting Advertising IDs
For Airship RTDS events without an associated Named UserA customer-provided identifier used for mapping multiple devices and channels to a specific individual., you can collect advertising IDs to be used as device IDs for events sent to Amplitude. See Custom Identifiers for more information. The following code examples demonstrate how to add the advertising ID on each supported platform.
For iOS, associate the Apple advertisingID
with the Airship Channel IDAn Airship-specific unique identifier used to address a channel instance, e.g., a smartphone, web browser, email address.. If applicable, you can also associate Apple’s identifierForVendor
with the Channel ID. For more information, see identifierForVendor in Apple’s UIKit documentation.
Add the iOS Advertising ID
// Get the current identifiers
let identifiers = Airship.analytics.currentAssociatedDeviceIdentifiers()
// Set the advertising ID info
identifiers.advertisingID = ASIdentifierManager.sharedManager().advertisingIdentifier.UUIDString;
identifiers.advertisingTrackingEnabled = ASIdentifierManager.sharedManager().advertisingTrackingEnabled;
identifiers.vendorID = UIDevice.currentDevice().identifierForVendor?.UUIDString
// Associate the identifiers
Airship.analytics.associateDeviceIdentifiers(identifiers)
// Get the current identifiers
UAAssociatedIdentifiers *identifiers = [UAirship.analytics currentAssociatedDeviceIdentifiers];
// Set the advertising ID info
identifiers.advertisingID = [[ASIdentifierManager sharedManager].advertisingIdentifier] UUIDString];
identifiers.advertisingTrackingEnabled = [ASIdentifierManager sharedManager].advertisingTrackingEnabled;
identifiers.vendorID = [[UIDevice currentDevice].identifierForVendor UUIDString];
// Associate the identifiers
[UAirship.analytics associateDeviceIdentifiers:identifiers];
For Android, associate the Android Advertising ID with the Airship Channel ID.
UAirship.shared().getAnalytics().setAutoTrackAdvertisingIdEnabled(true);
// Get the Android Advertising ID info - This call is blocking and should be done in a
// background thread.
AdvertisingIdClient.Info adInfo = AdvertisingIdClient.getAdvertisingIdInfo(getContext());
UAirship.shared().getAnalytics()
.editAssociatedIdentifiers()
.setAdvertisingId(adInfo.getId(), adInfo.isLimitAdTrackingEnabled())
.apply();
Tag Change Mapping
For tag_change
events in outbound integrations, Airship uses Amplitude’s Identify API to apply Tags on your Amplitude audience.
Tags in an tag_change
event’s current
object appear as user_properties
in an Amplitude identifyEvent
. They appear in the format Airship <Tag Group name>": ["<Tag name>", "<Tag name>"]
. Compare the two in the following code samples.
tag_change
event{
"id": "00000169-4a14-67b2-1ddd-d9e733622c3a",
"occurred": "2019-03-04T19:00:45.106Z",
"offset": "1000001260057",
"processed": "2019-03-04T19:00:47.094Z",
"type": "SEND_REJECTED",
"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"
]
},
"remove": {
"device": [
"shoe_buyer"
]
},
"current": {
"crm": [
"partner",
"active",
"new_user"
],
"loyalty": [
"silver_member",
"special_offers"
],
"device": [
"san_francisco",
"sports"
]
}
},
"type": "TAG_CHANGE"
}
user_properties
{
"user_properties": {
"ios_channel": "1ef235f0-03d5-1384-893e-a19b5cd0d110",
"channel": "1ef235f0-03d5-1384-893e-a19b5cd0d110",
"device_type": "IOS",
"Airship crm": ["partner", "active", "new_user"],
"Airship loyalty": ["silver_member", "special_offers"],
"Airship device": ["san_francisco", "sports"]
}
}
Categories