Google Analytics

AIRSHIP MAINTAINED INTEGRATION

This integration is maintained by Airship. Please contact Airship for support.

Our Google Analytics integration sends user-level mobile engagement data from Airship to Google using a Real-Time Data StreamingA service that delivers engagement events in real time via the Data Streaming API or an Airship partner integration. (RTDS) connector.

 Note

This integration does not support all the event types and properties available in the Real-Time Data Stream. If you would like to combine non-supported Airship events with Google Analytics data, we recommend using Airship’s Google Cloud Storage integration and building reports in Looker Studio.

Google Analytics Integration Requirements

  • Accounts

    1. Google Analytics
    2. Airship — Must include both:
  • Mobile App

    • The Google Analytics Firebase SDK must be added to your mobile app.
    • The Firebase App Instance ID must be shared.

Associating the App Instance ID with a Channel ID

You must create custom identifiers that associate a Google Analytics App Instance ID with the user’s Airship Channel IDAn Airship-specific unique identifier used to address a channel instance, e.g., a smartphone, web browser, email address.. See: Custom Identifiers.

Setting custom identifiers

UAirship.shared().analytics
  .editAssociatedIdentifiers()
  .addIdentifier("ga4_instance_id", Analytics.appInstanceID())
  .apply()
FirebaseAnalytics.getInstance(this).getAppInstanceId().addOnCompleteListener(new OnCompleteListener<String>() {
@Override
public void onComplete(@NonNull Task<String> task) {
  if (task.isSuccessful()) {
      String appInstanceId = task.getResult();
      UAirship.shared().getAnalytics()
        .editAssociatedIdentifiers()
        .addIdentifier("ga4_instance_id", appInstanceId)
        .apply();
    }
  }
});
FirebaseAnalytics.getInstance(this).appInstanceId
    .addOnCompleteListener { task ->
        if (task.isSuccessful) {
            val appInstanceId = task.result
            UAirship.shared().analytics
                .editAssociatedIdentifiers()
                .addIdentifier("ga4_instance_id", appInstanceId)
                .apply()
        }
    }

Once set, all associated identifiers are returned in RTDS under the "identifiers" key:

 {
   "ios_channel": "a6b392d6-3b0d-4c00-98ef-5cb91d51268a",
   "named_user_id": "albert",
   "identifiers": {
     "foo": "bar",
     "verycustomid": "123554"
   },
   "attributes": {
     "package_name": "com.company_name.app_name",
     "version": "1.0.0",
     "ua_library": "7.0.2"
   }
 }

See also: RTDS API: Device Information.

RTDS will report events about those users directly to Google Analytics through the Google Analytics Measurement Protocol API. From there, you can create segments within Google Analytics to track mobile engagement behavior.

Configuring the Google Analytics Integration

In Airship:

  1. Go to Settings.
  2. Under Project Configuration, select Manage for Partner Integrations.
  3. Select Google Analytics.
  4. Select Configure for the outbound integration and follow the onscreen instructions to:
    • Provide your Firebase App ID
    • Create an API secret in GA4
    • Select the Airship events to send to GA4
    • (Optional) Populate the GA4 user ID

Defining Custom Dimensions in Google Analytics

Airship includes some additional event parameters in the events sent to GA4. To use these properties in GA4 reports you must first define them as custom dimensions. Use the information in GA4: Custom dimensions and metrics and the event-mapping table below to create custom dimensions in your GA4 property.

Populating the GA4 User ID

The User-ID feature in GA4 allows you to count distinct users accurately and enables measuring their activity across different sessions, devices, and platforms. If your user ID in GA4 is the same value that you use for named users in Airship, you can optionally include that value in events. By default, the user ID is not populated. For more information, see: GA4: Measure activity across platforms with User-ID.

Airship-Google Analytics Event Mapping

 Important

Because Google Analytics does not recommend high-cardinality dimensions, Airship does not include push IDs in events. If you would like to group push-related events, include Campaign CategoriesAn optional delivery feature used to group messages of similar types or messaging strategies for aggregate reporting. Campaigns help you track the efficacy of both your individual messages and a messaging campaign as a whole.when creating your messages. See also: Data Formats: Campaigns Object.

Use the following table for reference when mapping Airship events to Google Analytics events.

EventDescriptionGA Custom DimensionsNotes
airship_sendOccurs whenever a push notification is sent to a device.
  • The campaign categories.
  • Variant ID, if included.
Not sent if a campaign category is not included
airship_direct_openOccurs when a user opens your app directly from a push notification.
  • The campaign categories.
  • Variant ID, if included.
Not sent if a campaign category is not included.
airship_uninstallOccurs when a user uninstalls an Airship-integrated app in response to a push.
airship_controlOccurs when a device is excluded from a push because it was arbitrarily selected as a member of a control group. Membership in a control group indicates what would have happened if you did not send a message to a user at all. This occurs for A/B Test-related pushes only.The campaign categories.Not sent if a campaign category is not included.