Skip to main content

Data Privacy for EU Users

AndroidiOS
Supported in: Player Network SDK 1.21.03

To protect the data privacy of users as well as ensure fair competition in the market, the Digital Markets Act (DMA) was legally implemented in November 2022 by the European Union. To comply with the new regulations, Google's Consent Management Platform (CMP) is required to be integrated into Player Network SDK, for EU users covered by the DMA.

Configurations to enable CMP in INTLConfig

The following are the recommended configurations for CMP integration, included in INTLConfig.ini. The values for ANALYTICS_CONSENT_REQUIRED_TYPE and ANALYTICS_CONSENT_DEFAULT_CONFIG should not be changed, but if changes are required, contact the Google representative first to confirm the policies regarding the relevant permissions.

[Analytics]
ANALYTICS_CONSENT_ENABLE = 1
ANALYTICS_CONSENT_CHANNEL = Firebase
ANALYTICS_CONSENT_REQUIRED_TYPE = ad_user_data,ad_personalization
ANALYTICS_CONSENT_DEFAULT_CONFIG = ad_storage:1,analytics_storage:1,ad_user_data:0,ad_personalization:0
  • ANALYTICS_CONSENT_ENABLE: Whether to enable the Consent Mode function.
    • 1: CMP is enabled, Google Consent Mode will be set after determining if the player is an EU user, preliminarily based on their IP.
    • 0: CMP is disabled, permissions for Google Consent Mode is set to granted by default, and the game will have to handle any related logic, such as turning off the function to display the popup for privacy confirmation.
  • ANALYTICS_CONSENT_CHANNEL: Channels where the Consent Mode function takes effect, such as Firebase.
  • ANALYTICS_CONSENT_REQUIRED_TYPE: Types of permissions that the Consent Mode function must handle, supported permission types include:
    • ad_storage: Enables storage, such as cookies (web) or device identifiers (apps), related to advertising.
    • analytics_storage: Enables storage, such as cookies (web) or device identifiers (apps), related to analytics, for example, visit duration.
    • ad_user_data: Sets consent for sending user data to Google for online advertising purposes.
    • ad_personalization: Sets consent for personalized advertising.
  • ANALYTICS_CONSENT_DEFAULT_CONFIG: Default configuration of permissions when Consent Mode is enabled, read when Player Network SDK sets the default settings during app startup.
    • 1: Permission granted for the permission type.
    • 0: Permission denied for the permission type.
caution

When data privacy for EU users is turned on, the SetConsent API will have to be called every time the game is started.

Call the SetConsent API for Unity SDK or Unreal Engine SDK to set consent based on the permissions given by the user.

INTLAPI.SetConsent(kConsentStatusGranted);

Workflow

Image: CMP Logic

  • Logic within the dotted box is to be handled by the game.
  • Set up with default configs: The default values configured in ANALYTICS_CONSENT_DEFAULT_CONFIG are used to set up the game during startup.
  • Set(Granted)/Set(Denied): Call the SetConsent API for Unity SDK or Unreal Engine SDK to set consent for EU users.
    • Set(Granted): Consent granted, passed parameter kConsentStatusGranted
    • Set(Denied): Consent denied, passed parameter kConsentStatusDenied

The Consent Mode function can be verified by inspecting the log files:

  1. Set LOG_LEVEL = 1 (debug) or LOG_LEVEL = 0 (info) in INTLConfig.ini.

  2. Ignoring all but the last found entry, search the log for the following keywords and verify if it matches the configured ANALYTICS_CONSENT_REQUIRED_TYPE:

    1. Android keywords with sample code: FirebaseAnalytics setConsent:

      FirebaseAnalytics setConsent: consentMap = {AD_USER_DATA=GRANTED, AD_PERSONALIZATION=GRANTED}
    2. iOS keywords with sample code: Firebase: set consent:

      Firebase: set consent: {
      "ad_personalization" = granted;
      "ad_user_data" = granted;}

Modify default CMP configurations

note

The configurations for ANALYTICS_CONSENT_DEFAULT_CONFIG should not be changed, but if changes are required, contact the Google representative first to confirm the policies regarding the relevant permissions.

When Player Network SDK initialization is incomplete, Firebase reads the values from the XML(Android)/Plist(iOS) file to set up CMP. Ensure that the corresponding permissions in the XML/Plist file have the same values as set in ANALYTICS_CONSENT_DEFAULT_CONFIG.

Android configurations

<meta-data android:name="google_analytics_default_allow_analytics_storage" android:value="true" />
<meta-data android:name="google_analytics_default_allow_ad_storage" android:value="true" />
<meta-data android:name="google_analytics_default_allow_ad_user_data" android:value="false" />
<meta-data android:name="google_analytics_default_allow_ad_personalization_signals" android:value="false" />

As the above configurations are contained within INTLFirebase.aar and cannot be modified directly, use tools:replace to replace the android:value of the corresponding permission in the AndroidManifest.xml file from the Unity project. The following is an example where the ad_storage permission is denied:

<meta-data android:name="google_analytics_default_allow_ad_storage" android:value="false" tools:replace="android:value"/>

iOS configurations

"GOOGLE_ANALYTICS_DEFAULT_ALLOW_ANALYTICS_STORAGE":true,
"GOOGLE_ANALYTICS_DEFAULT_ALLOW_AD_STORAGE":true,
"GOOGLE_ANALYTICS_DEFAULT_ALLOW_AD_USER_DATA":false,
"GOOGLE_ANALYTICS_DEFAULT_ALLOW_AD_PERSONALIZATION_SIGNALS":false,

Find the Info.plist node and modify the corresponding permission from the INTLFirebaseKit.projmods file. The following is an example where the ad_storage permission is denied:

"GOOGLE_ANALYTICS_DEFAULT_ALLOW_AD_STORAGE":false,