iOS SDK - Issue with AdLoader when requesting Fluid and Custom Native

113 views
Skip to first unread message

Alexandre Lision

unread,
Aug 23, 2021, 11:15:27 AM8/23/21
to Google Mobile Ads SDK Developers

Hi,

We are experiencing with fluid type and we are doing some tests in the sample app provided on github:

Currently in our app, we use an AdLoader to request banners and custom native types.
I have revamped the sample app to use the latest GAM SDK, use the AdLoader approach and implement the right callbacks.

Everything works as expected when we use the AdLoader and only request banner type in the AdLoader, with standard and Fluid sizes.

When adding the custom native type in the AdLoader , suddenly we always receive a "No ad to show" error.

I don't understand this issue, adding a new ad type in the loader should not impact ad reception right?

Here is the sample project I have assembled reproducing the issue:

Thanks

Mobile Ads SDK Forum Advisor

unread,
Aug 23, 2021, 12:58:44 PM8/23/21
to google-adm...@googlegroups.com
Hi Alexandre,

Thank you for reaching out to us with your question. While part of your comment is correct, that the adloader does not in essence change based on the type of ad that is being loaded into it. When looking at your implementation. It would seem to make sense that the fluid ads work fine, but that the native are returning "no ads". Looking at the AdManagerFluidAdSizeViewController I see that you are getting the ad type and checking if it is a native ad. But then you are calling the fluid ad params and setting that up. No where in the code do I see you doing that for the native. Plus it looks like you are loading them both into the same adView which could cause a problem.

Regards,
Google Logo
William Pescherine
Mobile Ads SDK Team
 


ref:_00D1U1174p._5004Q2Mi1i6:ref

Alexandre Lision

unread,
Aug 23, 2021, 5:12:41 PM8/23/21
to Google Mobile Ads SDK Developers
Thanks for the quick answer!

Well, the app presents two rows at first:

- First row calls the AdManagerFluidAdSizeViewController and initialize the AdLoader with only the .gamBanner ad type.
- Second row calls the AdManagerFluidAdSizeViewController and initialize the AdLoader with .gamBanner and the .customNative ad type.

Inside the AdManagerFluidAdSizeViewController I'm always requesting the same adunit that contains a demo fluid creative: "/6499/example/APIDemo/Fluid"

From my understanding I can pass an array of ad types to the AdLoader, and based on available inventory I will receive one of them. In my case I know there is only one fluid creative in this ad unit. But requesting both ad types seems to prevent any ad reception.

I have a couple of questions and notes:

I see that you are getting the ad type and checking if it is a native ad
Could you clarify what you mean by that? I'm not sure what code you are referring to. What I do in AdManagerFluidAdSizeViewController's viewDidLoad is requesting one or two adtypes based on a boolean value.

But then you are calling the fluid ad params and setting that up
Are you referring to validBannerSizes implementation?

func validBannerSizes(for adLoader: GADAdLoader) -> [NSValue] {
        let sizes = [CGSize(width: 300, height: 50),
                     CGSize(width: 300, height: 600),
                     CGSize(width: 300, height: 250),
                     CGSize(width: 320, height: 180)]

        var result = sizes.map { size -> NSValue in
            let gadSize = GADAdSizeFromCGSize(size)
            return NSValueFromGADAdSize(gadSize)
        }

        result.append(NSValueFromGADAdSize(kGADAdSizeFluid))
        return result
    }

No where in the code do I see you doing that for the native
I didn't think I needed to do that in this sample, where do you recommend me to do it? I don't see the equivalent of kGADAdSizeFluid

Plus it looks like you are loading them both into the same adView
Not sure I understand, since I'm using an AdLoader, the adView is given to me by the SDK, and I add it to my view hierarchy after that,


Thanks

Google Manager

unread,
Aug 23, 2021, 8:31:28 PM8/23/21
to Google Mobile Ads SDK Developers
On Monday, August 23, 2021 at 2:58:44 PM UTC-2 mobileadssdk wrote:
Hi Alexandre,

Thank you for reachit you are getting the ad type and checking
manager,

Google Manager

unread,
Aug 23, 2021, 8:32:00 PM8/23/21
to Google Mobile Ads SDK Developers

Mobile Ads SDK Forum Advisor

unread,
Aug 24, 2021, 3:06:15 AM8/24/21
to google-adm...@googlegroups.com
Hi Alexandre,

I work along with William. Allow me to assist you in this.

I've checked your sample app provided, and it appears your implementation was fine to me. As per testing, I've click the "Fluid Ad size with custom native.." menu, and wasn't able to trigger the No ad to show error. With this, would it be possible for you to provide a screen recording of the behavior you've reported here? This will greatly help us to grasp the scenario.

Regards,
Google Logo
Teejay Wennie Pimentel
Mobile Ads SDK Team
 


ref:_00D1U1174p._5004Q2Mi1i6:ref

Alexandre Lision

unread,
Aug 24, 2021, 11:42:22 AM8/24/21
to Google Mobile Ads SDK Developers
Hi Teejay,

Sure here is the screenshot of the Fluid Ad size with custom native screen:
Simulator Screen Shot - iPhone 12 mini - 2021-08-24 at 11.39.42.png

It seems that when requesting a fluid banner and also a custom native creative, even if there is no custom template there is no fallback to present the fluid creative.

Thanks for your help,

Alexandre

Mobile Ads SDK Forum Advisor

unread,
Aug 24, 2021, 3:16:38 PM8/24/21
to google-adm...@googlegroups.com
Hi Alexandre,

Thank you for responding to us. In looking over what you have sent us as well as the additionional question that you have asked. From what I am seeing and based on what you have said. I want to comment on 2 things. First is that you are able to get the fluid ads to work as intended. Which to us would show that the SDK is properly implemented. The second comment involves your question. You are correct, if you request a native ad there is no fallback for a fluid ad. In fact when looking at the documentation , it is the other way around. When requesting fluid ads, if a non-fluid ad is returned, it is put into the adView. So the fact that you might be calling for a native ad and none are available, should not be giving you a fluid.

Regards,
Google Logo
William Pescherine
Mobile Ads SDK Team
 


ref:_00D1U1174p._5004Q2Mi1i6:ref

Alexandre Lision

unread,
Aug 26, 2021, 8:59:44 AM8/26/21
to Google Mobile Ads SDK Developers
Thanks for your answer. Right now in our app we request standards banners and customNative ad types. In this case, when no customNative is available, we always receive a standard banner. When adding the fluid size to the valid banner AdSizes array we join to the request, this fallback does not work anymore.

Just to make sure I understand correctly. What you are saying is that it's the intended behavior ? Or is there a way around making fluid size and customNative ad format cohabit ?  This is a bit confusing for us, since we want our ad spots to be as generic and flexible as possible, and we would like to support fluid in the same ad spot as custom natives.

Thanks

Alexandre

Mobile Ads SDK Forum Advisor

unread,
Aug 26, 2021, 11:11:33 AM8/26/21
to google-adm...@googlegroups.com
Hi Alexandre,

Thank you for the feedback. Having read over this, I would say that yes it should still be possible for the Fluid and customNative ads to coexist in the same adView space. The issue is how to make them do this. As previously mentioned, I believe that you have the fluid set up fine and nothing wrong there. The real question is to be able to have the fluid and custom switch back and forth as needed. The SDK does not do it from custom to fluid, but will show a custom as a default if no fluid is available. So if you want to have them both exist in the same view and to switch, what I would suggest is to have some logic that switches between which ad you want to call at any given moment. You will need an ad unit for the fluid and one for the custom. And then given whatever logic you want to call them you implement.

Regards,

Alexandre Lision

unread,
Sep 7, 2021, 1:46:05 PM9/7/21
to Google Mobile Ads SDK Developers
Hello,

Sorry for the delay, I have presented this alternative internally. This is not ideal, since this behaviour 'specialize' our ad spots for a certain ad format. I'm still not getting exactly why this fallback between native and fluid is not possible, but we will try to make it work as is.
Thank you for your time, and your swift answers, I will get back to you if needed.
Reply all
Reply to author
Forward
0 new messages