Global Settings


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

Publisher first-party ID, formerly known as same app key

The Google Mobile Ads C++ SDK uses Publisher first-party ID to help you deliver more relevant and personalized ads by using data collected from the app the user is using.

Publisher first-party ID 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. See the Consent for cookies section of the Android Global Settings guide for more information.