Can I use the WebView API for Ads in a cordova app (WebView)?

335 views
Skip to first unread message

Oleguer Llopart

unread,
Sep 30, 2022, 12:30:54 PM9/30/22
to Google Mobile Ads SDK Developers
Hello.

I have a website where I use AdSense to show ads, I also have an Android app made with cordova (WebView) that currently shows ads through AdMob, but being an app that uses a WebView I can't integrate the ads inside the interface, can only be added in another WebView above or below the WebView of the app.

I've been looking at the WebView API for Ads documentation and was able to implement it in my cordova app, but I don't know if this implementation breaks AdSense/AdMob policies.

https://developers.google.com/admob/android/webview

What I have done, apart from registering the WebView of my application, is to use a custom hostname in the WebView, so that the ads are displayed correctly, I have changed it from https://localhost/index.html to the one of my domain (https://example.com/index.html).

Can I do this to show AdSense ads in my app or is it against AdSense/AdMob policies?

Thanks.

Mobile Ads SDK Forum Advisor

unread,
Oct 2, 2022, 10:26:03 PM10/2/22
to oleguer.ll...@gmail.com, google-adm...@googlegroups.com

Hi Oleguer,

Thank you for reaching out to us.

Upon reviewing your concern for WebView API in android Cordova, if you display web content that implements ads with AdSense code or Google Publisher Tag in your app through WebView, you should use this API to enable ads monetization. Then with regard to policies, as per checking on this article for AdMob policies, it never mentioned that using custom hostname may violate the policy. To know more about policies, you may also check this article for AdSense policies.

Regards,

Google Logo
Princess Pamela
Mobile Ads SDK Team
 


ref:_00D1U1174p._5004Q2evRQ8:ref

Oleguer Llopart

unread,
Oct 3, 2022, 4:32:24 AM10/3/22
to Google Mobile Ads SDK Developers
Thanks for your reply.
Reply all
Reply to author
Forward
0 new messages