Global Settings

Stay organized with collections Save and categorize content based on your preferences.

The following global functions may be used to control certain information collected by the Mobile Ads SDK.

Same app key

The Google Mobile Ads C++ SDK uses the same app key to help you deliver more relevant and personalized ads by using data collected from the app the user is using.

The same app key is enabled by default, but you can disable it with the following code prior to initialization:

  #include "firebase/gma.h"

  firebase::gma::SetIsSameAppKeyEnabled(/*is_enabled=*/false);

Crash reporting (iOS Only)

The Google Mobile Ads C++ SDK inspects exceptions that occur in an iOS app and records them if they are caused by the SDK. These exceptions are collected so we can prevent them in future SDK versions.

Crash reporting is enabled by default. If you don't want SDK-related exceptions to be recorded, you can disable this feature by calling the DisableSDKCrashReporting() function. The best time to call this method is when the app launches:

  #include “firebase/gma.h”

  firebase::gma::DisableSDKCrashReporting();

Crash reporting is not supported on Android devices.

If your app has special requirements on Android, you can set the optional SharedPreferences gad_has_consent_for_cookies. Please see the Consent for cookies section of the Android Global Settings guide for more information.