Displaying a DMA consent banner
Effective March 6, 2024, in response to the mandatory DMA regulations within the EU and EEA regions, Google requires explicit user consent when advertising/measurement data is transmitted to Google through Firebase or marketing attribution tools in these regions.
Gatekeepers such as Alphabet, Amazon, Apple, ByteDance, Meta, and Microsoft must obtain explicit consent from users when collecting personal information to provide personalized advertising.
To address this, the Hive SDK provides the DMA consent banner exposure feature to support Google's 'EU User Consent Policy' compliance.
When the DMA consent banner exposure feature is applied, you can display a banner that checks user consent for personal information collection for advertising and measurement purposes.
Basic operation flow¶
When personal information collection consent is applied to your app, it operates starting from step 3 of the following SDK operation flow.
- Display terms of service consent during SDK initialization and login
- Display CMP consent popup such as ADIZ
- Call
Analytics.showConsentModeIfRequire()to conditionally display personal information collection consent UI- If the user has already consented, the consent banner UI is not displayed. It only appears when the consent has expired or additional consent is required.
- When the
[ConsentMode]object parameter is set to null, consent list is automatically generated based on whether third-party marketing tracking tools are added to the Hive SDK
- Call
Analytics.showConsentMode()to always display personal information collection consent UI- If there is a previous consent record, the UI is displayed with consent set according to that value
- In-app settings button can be configured so users can consent again or check consent status at any time
- When the
[ConsentMode]object parameter is set to null, consent list is automatically generated based on whether third-party marketing tracking tools are added to the Hive SDK
Displaying consent banner UI¶
The Hive SDK provides consent banner UI display functionality through the ContentMode class object of Hive Analytics.
Consent banner UI configuration is broadly divided into 'default consent banner UI' and 'custom consent banner UI' according to the function parameter settings of the ContentMode object.
- Default consent banner UI: Includes UI and text provided by the SDK by default
- Custom consent banner UI: Includes UI and text that can be modified to suit your app's characteristics
Default consent banner UI configuration¶
When the [ConsentMode] object parameter is set to null, the following 'default consent list' is automatically generated based on whether third-party marketing tracking tools are added to the SDK.
When the user completes personal information collection consent in the app, the Hive SDK delivers consent results for each item through a callback.
Values delivered through the callback are provided as a list of ConsentStatus objects.
id: Unique identifier for consent item- Purposes
ad_user_data,ad_personalization,analytics_storage - Each MMP vendor for
ad_personalizationpurpose:google,adjust,appsflyer,singular,airbridge
- Purposes
granted: Consent status for the consent itemAnalytics.CONSENT_GRANTEDwhen consented,Analytics.CONSENT_DENIEDwhen denied
consentDate: Time when user made the consent decision (in milliseconds)expiredDate: Time when the consent expires (in milliseconds)
Custom consent banner UI configuration¶
Unlike the default consent banner UI provided by Hive SDK, this includes UI and text that can be customized to match your app's characteristics. Enter the modified text that maps to each parameter provided by the [ContentMode] object as shown below.
ConsentMode.title: Text displayed at the top of the consent banner.ConsentMode.companyName: When displaying basic information, company name is required and set in the title and content of ConsentForm along with the title.ConsentMode.privacyPolicy: URL that operates when the 'Privacy Policy' button at the bottom of the consent banner is pressed.ConsentMode.adUserData: Consent item for advertising user data usage (ad_user_data).ConsentMode.adPersonalization: Consent item for personalized advertising usage (ad_personalized).ConsentMode.analyticsStorage: Consent item for analytics and statistics data collection (analytics_storage). (Currently supports "Google" only)ConsentForm.id: Unique identifier for consent item. Can include purposes (ad_user_data, ad_personalization, analytics_storage) and each MMP vendor for ad_personalization purpose ("google", "adjust", "appsflyer", "singular", "airbridge").ConsentForm.title: Title text for the consent item.ConsentForm.content: Description text for the consent item.ConsentStatus.id: Unique identifier for consent item. Refer to ConsentForm.id content.ConsentStatus.granted: Consent status value for the consent item. Analytics.CONSENT_GRANTED when consented, Analytics.CONSENT_DENIED when denied.
Integrating with third-party consent management platforms (CMP)¶
When displaying consent banner popups, you can configure to avoid displaying duplicate consent banner UIs with third-party consent management platforms (CMP) by utilizing files that comply with TCF standards.
When calling Analytics.showConsentModeIfRequire() with the checkCmp parameter set to true, if there is a file stored according to TCF standards, the file is read and considered as having consent configured. The default value for the checkCmp parameter is true.
For example, when using ADIZ, you can access the Google AdMob console to create GDPR messages and then initialize ADIZ. For detailed configuration information, refer to Hive ADIZ > Creating GDPR messages.
Configuring consent banner exposure¶
This section explains how to configure consent banner exposure in the development environment for each Hive SDK engine.
Hive SDK Unity¶
- Open the Hive Dependencies window from the Unity project's top menu Hive > Hive Dependencies.
- Check and save the Analytics Consent-Mode option as shown below to activate it.

Hive SDK Android¶
Declare the 'Analytics Consent-Mode' library in the app-level build.gradle.
implementation "com.com2us.android.hive:hive-analytics-consent-mode:${HIVE_SDK_VERSION}" // Enter Hive SDK version when not using BoM
Hive SDK iOS¶
Declare the 'Analytics Consent-Mode' framework in the Podfile.
pod 'HiveAnalyticsConsentMode', '${HIVE_SDK_VERSION}' # Enter SDK version
