Validate consent mode set up for App ads

This article will help you to validate your app's consent mode setup by running it in debug mode and monitoring the logs.

Validate for Android

  1. Enable Analytics debug mode on an Android device (debug mode is automatically enabled for emulators).
    adb shell setprop debug.firebase.analytics.app PACKAGE_NAME
    This behavior persists until you explicitly disable debug mode by executing the following command:
    adb shell setprop debug.firebase.analytics.app .none.
  2. Set Analytics logs to verbose and monitor the logs with logcat.
    1. In a terminal, set the log level to verbose
      adb shell setprop log.tag.FA VERBOSE
      adb shell setprop log.tag.FA-SVC VERBOSE
      Monitor the debug logs with logcat
      adb logcat -v time -s FA FA-SVC
    2. In android studio - set the same filters in the logcat window
      -tag:FA -tag:FA-SVC -level:verbose
  3. Validate that defaults were set in the manifest by looking for the following log lines.
    1. Consent Mode V1 signals are indicated by one line

      FA-SVC: com.google.android.gms [V] Setting consent, package, consent: {app id}
      source=MANIFEST,ad_storage=denied,analytics_storage=denied

    2. Consent Mode V2 signals are indicated by 2 lines
      1. ad_personalization is managed using the non_personalized_ads (npa) property. Learn more about Control data collection for personalized advertising.

        FA-SVC: com.google.android.gms [V] Setting DMA consent. package, consent: {app id} source=MANIFEST, ad_user_data=denied

        Setting user property: non_personalized_ads(_npa), 1

  4. After user consent choices are shared by triggering the consent mode API via a setConsent call in the app, the same log lines will be shown with source=API and the user’s consent choices
    1. Consent Mode V1 signals are indicated by one line

      FA-SVC: com.google.android.gms [V] Setting consent, package, consent: {app id}
      source=API,ad_storage=granted,analytics_storage=granted

    2. Consent Mode V2 signals are indicated by 2 lines
      1. ad_personalization is managed using the non_personalized_ads (npa) property. Learn more about Control data collection for personalized advertising

        FA-SVC: com.google.android.gms [V] Setting DMA consent. package, consent: {app id} source=API, ad_user_data=granted

        Setting user property: non_personalized_ads(_npa), 0

Basic Mode:

In addition to the validations above, you can also confirm the SDK is not enabled until after the consent mode API is called.

  1. Before enabling the SDK, you should view logs such as
    FA: {app id} [D] Event not sent since app measurement is disabled
  2. Confirm that first_open event log is not sent until after user consent choices are sent using consent mode.

Was this helpful?

How can we improve it?
true
Achieve your advertising goals today!

Attend our Performance Max Masterclass, a livestream workshop session bringing together industry and Google ads PMax experts.

Register now

Search
Clear search
Close search
Google apps
Main menu
2177187725439390330
true
Search Help Center
true
true
true
true
true
73067
false
false
false