In-app browser for google banners in native iOS app

76 views
Skip to first unread message

Bulut Öztemur

unread,
Aug 6, 2024, 5:30:11 AM (4 days ago) Aug 6
to Google Mobile Ads SDK Developers
Hello,

I have a native iOS app. I would like to open google ads inside in-app browser (SFSafariViewController). I couldn't find a way to do it. Since I couldn't get the url of the ad. This document (https://developers.google.com/admob/ios/browser/webview/api-for-ads)
didn't help me. Is there anyone to have experience about this topic?

Thanks.

Mobile Ads SDK Forum Advisor

unread,
Aug 6, 2024, 9:09:12 AM (4 days ago) Aug 6
to buluto...@gmail.com, google-adm...@googlegroups.com

Hi,

Please be informed that communication with the Google Mobile Ads SDK occurs in response to ad events triggered by any of the following:

  • AdSense Code:
    • The AdSense code refers to the HTML snippet that you place on your site to enable Auto ads and a variety of other AdSense features. To maximize the benefits of AdSense, ensure you place the AdSense code on every page of your site. Learn how to get the AdSense code.
  • Google Publisher Tag (GPT):  
    • The Google Publisher Tag is used to define available ad slots within your network. By placing GPT on a page, you create a communication path between the ad server and the user’s browser. When a page containing GPT is requested, the following sequence of events occurs:
  • IMA for HTML5: 
    • AdSense and Google Ad Manager support HTML5 video advertising. These guidelines provide various resources to assist with HTML5 video monetization.

The SDK adds message handlers to the registered WKWebView to listen for these ad events. For a better sense of how this works, view the source code of the test page.

Follow this Optimize WKWebView click behavior documentation to optimize the click behavior in your WKWebView instance.

Feel free to reach out to us if you need more help!

 
This message is in relation to case "ref:!00D1U01174p.!5004Q02vEbMl:ref" (ADR-00261381)

Thanks,
 
Google Logo Mobile Ads SDK Team


Bulut Öztemur

unread,
Aug 6, 2024, 10:24:13 AM (4 days ago) Aug 6
to Google Mobile Ads SDK Developers
Hi, thanks for the reply. 

Our app is a native iOS app. I feel like this document is a kind of web app inside WKWebView. Even if this is the correct documentation for native iOS app, how can I get the url of advertisement from GADBannerView? Since, I have to know the url to open it inside WKWebview.

Mobile Ads SDK Forum Advisor

unread,
Aug 6, 2024, 4:26:37 PM (4 days ago) Aug 6
to buluto...@gmail.com, google-adm...@googlegroups.com
Hi,

You can use any url but before try using the provided test url in the documents. The test URL shows green status bars for a successful integration. Cookies and page URLs are important for web view monetization and only function as expected when load(_:) is used with a network-based URL. For optimized WKWebView performance, we strongly recommend loading web content from a network-based URL.

Bulut Öztemur

unread,
Aug 7, 2024, 2:56:25 PM (3 days ago) Aug 7
to Google Mobile Ads SDK Developers
Hi,

But I need advertiser url to display the advertiser web page inside in-app web browser. My application is native iOS app, it does not use webview to display a web page like a container app. I have GADBannerViews in my app, what I want is that when user clicks banner view on my native iOS app, i don't want him/her to redirect to safari browser. Instead, I would like to open browser inside my app like SFSafariViewController.

Please see attachments. Current behaviour is in this video, which redirect user to the Safari browser. Second video is what I want, it opens Safari browser in the app.

Mobile Ads SDK Forum Advisor

unread,
Aug 7, 2024, 6:05:49 PM (3 days ago) Aug 7
to buluto...@gmail.com, google-adm...@googlegroups.com
Hi,

With regards to your concern, it is not possible to redirect an ad to a web view when clicked as this almost would defeat the purpose of displaying an ad in your app. This is a built in function of the SDK that cannot be modified.

Bulut Öztemur

unread,
Aug 8, 2024, 5:12:42 AM (2 days ago) Aug 8
to Mobile Ads SDK Forum Advisor, google-adm...@googlegroups.com
Hi,

Thanks for your reply.
Reply all
Reply to author
Forward
0 new messages