AdMob and pre-launch reports

AdMob and pre-launch reports

Over the past years multiple posts are created to highlight issues with AdMob in combination with the pre-launch reports for the Google Play Console. In the beginning Google just clicked ads during the pre-launch run which were reported as illegal clicks, which could ban Google accounts delivering the adds [1]. Now a days Google is filtering those IP's to prevent false clicks, but is this really a solution? It feels more like a duct tape fix!

Okey, so no more false clicks in Admob, but the pre-launch report also has some failures with AdMob ads. In the pre-launch report it can generate Stability issues like Non-SDK api: makeOptionalFitsSystemWindows()V or Non-SDK api: isTagEnabled(J)Z. Or Accessibility issues like Low contrast or Touch target size.

To prevent that the pre-launch report is filled with noisy AdMob issues, we want to focus on the real issues detected by the pre-launch report!

play console logo

How do pre-launch reports work?

A powerful feature of the Google Play console is the pre-launch reports, the app is automatically tested on several items like stability, Android compatibility, performance, accessibility and security. This is what Google mentions about this feature

After you upload and publish a test APK or app bundle, test 
devices will automatically launch and crawl your app for 
several minutes. The crawl will perform basic actions every 
few seconds on your app, such as typing, tapping, and swiping.
https://support.google.com/googleplay/android-developer/answer/7002270?hl=en
            
Firebase test lab


The tests are executed within the Firebase test lab, this environment contains a cloud-based app-testing infrastructure. To simplify this, its a large server with real devices connected to it. Each device is prepared by Firebase so it can register any issues, create screenshots and readout the logs. With the Firebase test lab its possible to test you're app over different devices, languages and Android SDKs.


During the pre-launch test multiple devices are used and it will crawl across the app for several minutes. Here comes the actual issue, the production app is not used by real users but due the Firebase test lab system. The app shows the adds with AdMob, but the Firebase test lab is not smart enough to detect those apps and ignore those!

How to solve it?

Google is great in how-to's and examples of how to implement features. When you are talking about integration multiple Google products items together this sometimes goes less smooth. Within the AdMob documentation you would expect somewhere a warning that the pre-launch report could detect the AdMob adds also or it could prefer a way to whitelist all Firebase test lab devices, but no.

The solutions is simple as effective but still feels like a quick fix, just don't show the AdMob adds when being executed on a Firebase Test lab device.

In a small page, hidden in the Firebase test lab docs it mentions Modify instrumented test behavior for Test Lab, here they explain that a system variable "firebase.test.lab" is set when running on a Firebase test lab.

Test Lab provides a system variable that you can add to 
your instrumented testsso that you can cause them to behave
differently when you run them in Test Lab than when you run
them on your own test device or emulator.
            

With above method we can detect when the app is running in a Firebase test lab. Based on this information we can decide yes/no to show any adds inside the app.

Links

With this guideline everybody can use both AdMob and the pre-launch report with any issues!

Thank you for reading this article, If you like this article, help others find this article by sharing it.

Reacties

Populaire posts van deze blog

Android-x86 virtual machine configuration tips

Android and SonarQube with code coverage

Road to App Bundle and Bundletool