Compliant with GDPR, CCPA, COPPA, LGPD, PECR, PDPA, PIPEDA, and more.
Firebase Analytics is a certified Google Mobile Measurement Partner (MMP) and App Attribution Partner (AAP). This guide outlines how to integrate the UniConsent Consent Management Platform (CMP) with Firebase Analytics to ensure that user consent signals are properly passed for attribution and analytics purposes.
UniConsent CMP automatically detects the presence of Firebase Analytics and transmits consent signals using the Firebase Analytics SDK API.
Refer to the Firebase Android SDK Initialization Guide for full setup details.
handle(Event event)
CallbackMake sure to start using Firebase within the CMP callback, once user consent is available:
override fun handle(event: Event?) {
// Example: send Firebase event or other analytics metrics
Bundle bundle = new Bundle();
bundle.putString(FirebaseAnalytics.Param.ITEM_ID, "id");
bundle.putString(FirebaseAnalytics.Param.ITEM_NAME, "name");
bundle.putString(FirebaseAnalytics.Param.CONTENT_TYPE, "image");
mFirebaseAnalytics.logEvent(FirebaseAnalytics.Event.SELECT_CONTENT, bundle);
}
If integration is successful, you will see debug log entries like:
Sending consent signal to FirebaseAnalytics
Additionally, when filtering logs from com.uniconsent.sdk.aap, you should see confirmation messages such as:
Successfully set consent signal to FirebaseAnalytics: {AD_USER_DATA=GRANTED, AD_STORAGE=GRANTED, AD_PERSONALIZATION=GRANTED, ANALYTICS_STORAGE=GRANTED}
These logs confirm that UniConsent has successfully passed user consent choices to Firebase Analytics for proper attribution handling.
On iOS, UniConsent CMP also automatically detects Firebase Analytics and sends consent signals using the corresponding SDK API.
When correctly integrated, debug logs will include:
Sending consent signal to FirebaseAnalytics
When filtering logs from com.uniconsent.sdk.aap, you should observe:
Successfully set consent signal to FirebaseAnalytics: {AD_USER_DATA=GRANTED, AD_STORAGE=GRANTED, AD_PERSONALIZATION=GRANTED, ANALYTICS_STORAGE=GRANTED}
These logs confirm that UniConsent has transmitted the appropriate consent signals to Firebase Analytics for attribution compliance.
To verify that consent settings are being correctly passed to Firebase, you can enable verbose logging and inspect the log output.
Run the following command to enable verbose logging for Firebase Analytics:
adb shell setprop log.tag.FA VERBOSE
Filter log output for entries that begin with Setting consent
. You should see logs similar to the following, indicating that consent has been successfully applied:
Setting consent, ... AD_STORAGE=granted
To ensure that user consent is available, make sure to call your MMP/AAP API within the override fun handle(event: Event?)
(Android) or public func onDismiss()
(iOS) callback of the CMP.
Learn more about the UniConsent SDK API in the following guides:
By integrating UniConsent CMP with Firebase Analytics, you ensure that your app remains compliant with consent regulations while continuing to benefit from Firebase’s AAP and MMP capabilities.
If you need further assistance, refer to the official UniConsent SDK documentation or contact our support team.