Overview
Singular supports integration with Google Analytics 4 (GA4) as a third-party analytics partner.
This guide explains how to configure GA4 measurement for your mobile app using Singular and ensure required parameters are passed correctly.
Singular forwards campaign attribution data automatically to GA4, while specific credentials and identifiers must be configured in the Singular UI and SDK.
Info: Singular forwards attribution data to GA4 for measurement and reporting. Product analytics such as funnels and user behavior analysis should continue to be handled directly within GA4 or Firebase.
Parameters Sent from Singular to GA4
Singular automatically forwards the following parameters to Google Analytics 4:
Campaign Name
Campaign ID
Source
Medium
Timestamp
Info: These parameters are populated automatically based on Singular attribution data. No additional SDK configuration is required.
Required Configuration in the Singular partner configuration UI
The following values must be configured directly in the Singular dashboard to enable GA4 measurement.
1. API Secret (api_secret)
The GA4 Measurement Protocol API Secret.
Where to find it:
GA4 Admin → Data Streams → Select your stream → Measurement Protocol → Create API Secret Important: The API Secret is required for Singular to send events to GA4 via the Measurement Protocol. Without this value, GA4 events will not be recorded.
2. Firebase App ID (firebase_app_id)
The Firebase App ID associated with your mobile app.
Where to find it:
Firebase Console → Project Settings → General → Your Apps → App ID Note: Ensure the firebase_app_id configured in Singular exactly matches the Firebase app used in your production build. A mismatch will prevent GA4 from associating events with your app.
Required Configuration in the Singular SDK
3. App Instance ID (app_instance_id)
The app_instance_id is a unique identifier for a specific installation of your Firebase app.
Requirements:
Retrieve the value from the Firebase SDK
-
Pass it to the Singular SDK using GLOBAL_PROPERTIES as mentioned in this guide
-
Use the exact property name:
app_instance_id
Note: The app_instance_id must be set before initializing the Singular SDK. Setting this value after initialization may result in GA4 events being dropped or incorrectly attributed.
SDK Implementation Example (Android – Kotlin)
Use global properties to track app-level and user-specific identifiers across the application lifecycle.
// Initialize the Singular SDK with app-level global properties val config = SingularConfig("SDK_KEY", "SDK_SECRET") .withGlobalProperty("app_instance_id", firebaseAppInstanceId, true) Singular.init(applicationContext, config)
// Set a third-party identifier on user login
fun onUserLogin(thirdPartyUserId: String) {
val success = Singular.setGlobalProperty(
"third_party_identifier",
thirdPartyUserId,
true
)
if (success) {
Log.d("Singular", "Third-party identifier set successfully")
}
}
// Clear the third-party identifier on user logout
fun onUserLogout() {
Singular.unsetGlobalProperty("third_party_identifier")
Log.d("Singular", "Third-party identifier cleared")
}
Tip: Use setGlobalProperty for identifiers that should persist across sessions. Always call unsetGlobalProperty when the identifier is no longer valid, such as on user logout.
Validation & Troubleshooting
After completing the setup, validate your integration:
-
Confirm
api_secretandfirebase_app_idare saved correctly in the Singular UI -
Verify
app_instance_idis set before SDK initialization -
Use GA4 DebugView or Realtime reports to confirm events are received
-
Review app logs for Singular SDK initialization errors
Info: GA4 may take several minutes to display new events. Use DebugView for near real-time validation during testing.
Comments
Please sign in to leave a comment.