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 tags. You’ll need to perform a sync operation to set tags on your audience in the amplitude tag group.
In your Amplitude environment, follow the steps in
Send Cohorts to Airship.
We’ll see you back here shortly.
User Association Client Code
Next, you will associate the Amplitude identifierForVendor with the Airship
Channel IDAn Airship-specific unique identifier used to address a channel instance, e.g., a smartphone, web browser, email address.. If Airship cannot set the Amplitude user ID or
device ID, Airship will not send the event.
If the 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 AAID nor IDFA is present Otherwise, Airship sets the channel ID associated with event as the Amplitude device ID.
If Airship cannot set the Amplitude user ID or device ID, Airship will not send the event.
Important
If IDFA (Apple Advertising ID) was not set to be collected by Airship SDK during configuration, it will not be sent to Amplitude.
The following code examples demonstrate how to add the advertising ID on each supported platform:
iOS
Swift: Add the iOS Advertising ID
// Get the current identifierslet identifiers = Airship.analytics.currentAssociatedDeviceIdentifiers()
// Set the advertising ID infoidentifiers.advertisingID = ASIdentifierManager.sharedManager().advertisingIdentifier.UUIDString;
identifiers.advertisingTrackingEnabled = ASIdentifierManager.sharedManager().advertisingTrackingEnabled;
identifiers.vendorID = UIDevice.currentDevice().identifierForVendor?.UUIDString
// Associate the identifiersAirship.analytics.associateDeviceIdentifiers(identifiers)
Objective C: Add the iOS Advertising ID
// 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];
// 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();
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, either US or EU. If you are unsure which data center you are on please contact our Support team.
In Airship:
Go to Settings » Project Configuration and click Manage for Real-Time Data Streaming.
Under Real-Time Data Streaming, select Amplitude. Previously configured integrations are listed under Enabled Integrations.
Follow the onscreen instructions to configure the integration.
Airship will begin sending events from your Airship app to your Amplitude instance.
Airship Tags in Amplitude
If you select to send Tag Change events from Airship to Amplitude, Airship will use Amplitude’s identify API to apply tags from the current object in tag_change events on your Amplitude audience as user properties.
Airship tags will appear on your Amplitude audience as user_properties: "Airship tag_group": ["tag1", "tag2"].
You can Sync Cohorts to leverage your behavioral cohorts from Amplitude in Airship as tags. To take advantage of Amplitude cohorts in Airship, you must create an amplitude tag group to receive tags.
Tags from Amplitude use the name of your project in Amplitude and the cohort ID for the cohort that you sync to Airship — [Amplitude] Project Name xacjmzs.
In Airship, create an amplitude tag group if it does not already exist.
Go to Settings » Project Configuration and click Manage for Tag Groups.
Click Create Tag Group and configure the fields.
Name: This name appears elsewhere in the dashboard, so choose something easily understandable and that describes the associated database, e.g., “Amplitude Integrations”
Description: The description should supplement the name, giving additional information about the tag group, if necessary. Be descriptive enough that anyone in your company would understand its source and purpose.
Group Key: Enter amplitude. This permanent, unique ID is the text you will use when referring to your tag group in the API.
Click Sync To… and select Airship.Airship will assign a tag representing the cohort to applicable members of your audience in Airship. The tag appears in the amplitude tag group as [Amplitude] <CohortName>:<cohortId>.
Tip
You can target your Amplitude cohort in Airship using the Amplitude tag group and the name of the tag you exported.