Send Custom Campaign Details to Google Analytics 4

Google Analytics 4 (GA4) app+web allows you to bring back Google Analytics metrics for your MobilePush apps.

This document outlines the steps required to log Marketing Cloud-specific custom campaign details to GA4 using the Firebase SDK. With this, Marketing Cloud surfaces GA4 app metrics for your mobile data streams.

Prerequisites

  1. Implement the MobilePush SDK in your app.
  2. Implement the Firebase SDK in your app and configure based on your app platform:
    1. iOS
    2. Android

Logging the AnalyticsEventCampaignDetails Event

  1. When a MobilePush message payload is received from the Marketing Cloud, extract the following parameters:
    • sfmc_journey_id
    • sfmc_journey_name
    • sfmc_activity_id
    • sfmc_activity_name
    • sfmc_channel
    • sfmc_asset_id
    • sfmc_id
  2. Log an AnalyticsEventCampaignDetails event.

The campaign_details event is the first event sent to Google Analytics after receiving the push notification from Marketing Cloud. Sending this event first ensures that all subsequent events sent to Google Analytics are associated with the Marketing Cloud-specific campaign details.

Swift (iOS) Example

Parameter Management

Configure Google Analytics App Tracking