Android SDK: Supported ads and networks
Ad views found automatically
Section titled “Ad views found automatically”The SDK looks through the windows of your resumed activities and finds:
| View | Notes |
|---|---|
AdMob banners: AdView (any BaseAdView) | Fixed and adaptive banners. Network and AdMob response id come from the view’s public ResponseInfo. |
Ad Manager banners: AdManagerAdView | A BaseAdView, handled like an AdMob banner. |
Native ads: NativeAdView | Captured once the native ad is bound (media content present, headline not empty). The SDK cannot reach the NativeAd from the view, so the network is reported as unknown unless you register the view with its metadata (below). |
Ad content drawn in a WebView, a SurfaceView or a TextureView inside these views is captured.
Not captured:
- Full-screen formats (interstitial, rewarded, rewarded interstitial, app open) are not found by themselves. They are captured only when your app opts in for each show, see Full-screen ads (opt-in).
- Ads in a window with
FLAG_SECURE: reported asUNSUPPORTED_SECURE_WINDOW, never captured. - Devices on API 24 and 25: reported as
UNSUPPORTED_API_LEVEL. - Views in dialogs and pop-ups are not in an activity window, so they are not found automatically; register them.
- Any other view, unless you register it.
Placement ids
Section titled “Placement ids”Each ad view gets a placement id, shown as Placement in the dashboard:
<Activity>/<viewIdName>when the view has an id, for exampleMainActivity/banner_top;- otherwise
<Activity>/adunit:<adUnitId>for banners; - otherwise
<Activity>/anon:<n>.
Two views in one activity that would get the same id get #2, #3 and so on. Give your ad views ids so their
placements are stable and readable.
Networks
Section titled “Networks”For AdMob mediation, the SDK reads the adapter that actually served the ad
(ResponseInfo.getLoadedAdapterResponseInfo()) and maps it to a network id. These ids are recognized:
google, meta, applovin, unity, ironsource, liftoff, inmobi, mintegral, pangle, chartboost,
dt_exchange, moloco, line, maio, mytarget, imobile, bigo, bidmachine, pubmatic, snap, verve.
Ads from AdMob’s own sources are refined by ad source: google for the AdMob Network (bidding and waterfall),
admob_reservation for reservation campaigns and admob_house for mediated house ads.
An adapter that is not in the table is reported as adapter:<class name>, and an ad without any attribution as
unknown. The raw values (adapter class, ad source name and id, instance name and id) are sent as they are, never
guessed.
Full-screen ads (opt-in)
Section titled “Full-screen ads (opt-in)”Interstitial, rewarded, rewarded interstitial and app open ads of Google Mobile Ads open in Google’s own ad window, not
in a view of your layout, so the SDK does not find them by itself. Since SDK 0.3.0 (Android) it captures one only when
your app opts in: call Ad80.trackFullScreenAd immediately before show, and Ad80.untrackFullScreenAd if the show
fails.
import dev.ad80.sdk.Ad80
// Right before the show. The second argument (a placement id) is optional.Ad80.trackFullScreenAd(interstitialAd, "Level/interstitial")interstitialAd.show(activity)
// If the ad fails to show (for example in onAdFailedToShowFullScreenContent):Ad80.untrackFullScreenAd(interstitialAd)import dev.ad80.sdk.Ad80;
// Right before the show. The second argument (a placement id) is optional.Ad80.trackFullScreenAd(interstitialAd, "Level/interstitial");interstitialAd.show(activity);
// If the ad fails to show (for example in onAdFailedToShowFullScreenContent):Ad80.untrackFullScreenAd(interstitialAd);- Which objects:
InterstitialAd(includingAdManagerInterstitialAd),RewardedAd,RewardedInterstitialAdandAppOpenAd. Any other object is ignored. Without a placement id, the placement is<Activity>/fullscreen:<adUnitId>. - What you assert: by calling it you state that the next Google ad activity
(
com.google.android.gms.ads.AdActivity) shows this ad, and that your app and its libraries draw nothing into that activity. The call is valid for 5 seconds; after that, or afteruntrackFullScreenAd, the ad is untracked. - What is captured: only Google’s ad window, never your own activities, dialogs, other windows or the screen. One image per show, taken once the opening animation has settled. It needs API 26 or higher.
- An untracked full-screen ad produces a diagnostic and no image. The SDK reports
SKIPPED_FULLSCREEN_NOT_TRACKEDand uploads nothing.Ad80.registernever uploads a full-screen image. - The switch: capture also needs the app’s Full-screen ad capture switch to be on (see
Remote configuration). Without it the
SDK reports
SKIPPED_FULLSCREEN_DISABLED.
Full-screen ads that were not captured are explained in Troubleshooting.
Register views the SDK cannot find
Section titled “Register views the SDK cannot find”Use Ad80.register for banners in dialogs or pop-ups, for native ads whose network you know, or for your own ad
views. A registered view is captured like a discovered one, under the placement id you give. Unregister it when it
goes away.
import dev.ad80.sdk.Ad80import dev.ad80.sdk.Ad80AdMetadata
// A banner in a dialog: its ResponseInfo is read automatically.Ad80.register(dialogBanner, "Checkout/dialog_banner")
// A native ad: pass what you know about it. The provider is called off the main thread.Ad80.register(nativeAdView, "Feed/native_1") { val info = nativeAd?.responseInfo ?: return@register null // null while not known yet val loaded = info.loadedAdapterResponseInfo Ad80AdMetadata( mediationPlatform = "admob", adapterClassName = loaded?.adapterClassName, adSourceName = loaded?.adSourceName, adSourceId = loaded?.adSourceId, adSourceInstanceName = loaded?.adSourceInstanceName, adSourceInstanceId = loaded?.adSourceInstanceId, mediationAdapterClassName = info.mediationAdapterClassName, responseId = info.responseId, )}
// When the view goes away:Ad80.unregister(nativeAdView)import com.google.android.gms.ads.AdapterResponseInfo;import com.google.android.gms.ads.ResponseInfo;import com.google.android.gms.ads.nativead.NativeAd;import dev.ad80.sdk.Ad80;import dev.ad80.sdk.Ad80AdMetadata;
// A banner in a dialog: its ResponseInfo is read automatically.Ad80.register(dialogBanner, "Checkout/dialog_banner");
// A native ad: pass what you know about it. The provider is called off the main thread.Ad80.register(nativeAdView, "Feed/native_1", () -> { NativeAd ad = currentNativeAd; // your field if (ad == null || ad.getResponseInfo() == null) return null; // null while not known yet ResponseInfo info = ad.getResponseInfo(); AdapterResponseInfo loaded = info.getLoadedAdapterResponseInfo(); return new Ad80AdMetadata( "admob", loaded != null ? loaded.getAdapterClassName() : null, loaded != null ? loaded.getAdSourceName() : null, loaded != null ? loaded.getAdSourceId() : null, loaded != null ? loaded.getAdSourceInstanceName() : null, loaded != null ? loaded.getAdSourceInstanceId() : null, info.getMediationAdapterClassName(), info.getResponseId());});
// When the view goes away:Ad80.unregister(nativeAdView);Ad80AdMetadata fields, in order: mediationPlatform (required, for example "admob"), adapterClassName,
adSourceName, adSourceId, adSourceInstanceName, adSourceInstanceId, mediationAdapterClassName,
responseId. All but the first may be null.
- For a registered
BaseAdView(a banner), the view’s ownResponseInfowins over your provider. - A blank placement id is ignored.
- Registering a view that fills the whole window is refused:
Ad80.registernever uploads a full-screen image. For full-screen ads useAd80.trackFullScreenAd(above). - Metadata from a provider is reported with the provenance
EXPLICIT_REGISTRATION.