Amplitude

Airship Real-Time Data Streaming 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.

Prerequisites

To get started, you must obtain the following:

Once your contract details are in order, the setup is straightforward. Below is a summary checklist, followed by detailed instructions. We will also send you to the Amplitude documentation for the Amplitude-specific steps.

  1. Install Airship and Amplitude SDKs in your project.
  2. Set Airship channel as a custom User Property in Amplitude.
  3. Associate users with IDFA for iOS and AAID for Android, using Airship's ID Matching feature.
  4. Add respective credentials to Airship and Amplitude dashboards to enable segmentation for behavioral cohorts.

Setup

Amplitude

On the Amplitude end, follow the steps in the Airship/Amplitude Integration Guide. We'll see you back here shortly.

Client Code

Associate your Amplitude user’s identifierForVendor (IDFA, for iOS) or Advertising Identifier (AAID, for Android) with the Airship channel ID. See ID Matching for details on this feature.

 Note

If the IDFA or AAID isn’t set on the user, Airship will not send over any data. We will only send events that have the IDFA/AAID associated with them.

iOS

Add the iOS Advertising ID:

// Get the current identifiers
let identifiers = UAirship.shared().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.shared().analytics.associateDeviceIdentifiers(identifiers)
// Get the current identifiers
UAAssociatedIdentifiers *identifiers = [[UAirship shared].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 shared].analytics associateDeviceIdentifiers:identifiers];

Android

Automatically track the Android Advertising ID:

UAirship.shared().getAnalytics().setAutoTrackAdvertisingIdEnabled(true);

Manually track the Android Advertising ID:

// 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();

Dashboard

  1. Open your messaging project and go to Settings » Real-Time Data Streaming.
  2. Under Real-Time Data Streaming, click Amplitude.
     Tip

    Previously configured integrations are listed under Enabled Integrations.

  3. Configure a new Amplitude integration:
    • Enter a user-friendly name and description.
    • Enter your Amplitude API key, found in your Amplitude app settings.
    • Choose one or more event type:

      • Direct opens
      • Sends
      • Uninstalls
  4. Click the Save button.

Now that the setup is complete, Airship will send events from this app to your Amplitude instance, and you can start reporting.