ActiveView issue for native ads used in an activity shown on top of the lock screen

87 views
Skip to first unread message

Ron K

unread,
Mar 11, 2024, 7:54:32 AM3/11/24
to Google Mobile Ads SDK Developers

TLDR: native ads are not being measured as "visible". 

Details on my implementation:
1. Full-screen native ad is implemented according to the official guide - https://developers.google.com/admob/android/native/full-screen
2. The native ad is shown on an activity that is showing on top of the lock screen (achieved using android:showWhenLocked="true" flag  https://developer.android.com/reference/android/R.attr#showWhenLocked )
3. The ad starts to load when the activity resumes. Once it's loaded successfully, it's displayed using NativeAdView class.
4. The ad is destroyed (com.google.android.gms.ads.nativead.NativeAd#destroy ) when activity stops.

Reproducing steps
1. Starting from when app is stopped (the process is not running), launch the activity.
2. Wait for the ad to load and to display.
3. Ad loads successfully and then an ad is displayed
4. Observe (using logcat) the callback com.google.android.gms.ads.AdListener#onAdImpression has been called
5. Wait for the active view pingback (in about 2 seconds from ad being displayed)
6. Observe the parameter "mtos" within the pingback URL.

7. Press the Power button to turn the device screen off.
8. Observe (using logcat) the activity is stopped and the ad being destroyed.
9. Press the Power button again to turn the screen on.
10. Observe the activity resumes.
11. Wait for the ad to load and to display.
12. Ad loads successfully and then an ad is displayed.
13. Observe (using logcat) the callback com.google.android.gms.ads.AdListener#onAdImpression has been called
14. Wait for the active view pingback (in about 2 seconds from ad being displayed)

Unexpected behavior upon step 14: the ActiveView pingback is being not called.

15. Leave the activity (for example by tapping on Back button or on Home button)
16. Observe (using logcat) the activity is stopped and the ad being destroyed.

Unexpected behavior upon step 16: the ActiveView pingback has been called. In it, the "mtos" parameter has value "mtos=0%2C0%2C0%2C0%2C0" indicating the ad was allegedly not displayed.

Any subsequent attempts to show the ad (repeating steps 7-16) show same behavior. If "force-stopping" the ActiveView behaves correctly as described in steps 1-6.


Notes:
I have been debugging the issue according to this guide pages:
https://support.google.com/google-ads/answer/7029393?hl=en
https://developers.google.com/interactive-media-ads/docs/sdks/html5/client-side/viewability
https://support.google.com/admanager/answer/6123557
Reply all
Reply to author
Forward
0 new messages