question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Native Ad - Image Responsiveness Issues

See original GitHub issue

Plugin Version

google_mobile_ads: ^1.2.0

Steps to Reproduce

  1. Create a Native Ad
  2. Create a listview with cards
  3. Try to make the native ad look like the cards like this example: https://lh3.googleusercontent.com/KtEoccHt7kwMVm4GdhwA-DyEcd2DEQCqWZuiQi0z2OoBQOUkD0OUIgnb75iGqHSPCHmsoPjTvVS3LprzHGGDlR2S2YUrIt7fPJZ9=w0
  4. First issue - I was only able to find 2 templates?! Small and medium sizes? The Flutter version of the official documentation is not really clear about it.
  5. I used the medium size template, and just tried to move the image banner to the top of the ad to look more like a card using the xml template file.
  6. Seems easy but to my surprise I was not able to make the banner image fit the card, the image is not using the full size horizontally or vertically properly. And since phone screens are different, the image banner always looks weird on different screens. Screenshot example here: https://drive.google.com/file/d/1AI-hXibMXlQv8_DYQaICfE6XrRdk3RUL/view?usp=sharing
  7. Tried to change the xml file, and tried different sizes in the AdWidget without any success. I’m sure I’m missing something probably simple, but I was not able to find anything about it in the official documentation or examples.

Expected results:

Trying to make the Native Ad to look like a card. Example: https://lh3.googleusercontent.com/KtEoccHt7kwMVm4GdhwA-DyEcd2DEQCqWZuiQi0z2OoBQOUkD0OUIgnb75iGqHSPCHmsoPjTvVS3LprzHGGDlR2S2YUrIt7fPJZ9=w0

Actual results:

The image inside the Native does not fit the card properly, and always looks out of place on different mobile screens: Screenshot example here: https://drive.google.com/file/d/1AI-hXibMXlQv8_DYQaICfE6XrRdk3RUL/view?usp=sharing

I changed the xml template file several times, and tried different sizes in the AdWidget without any success. I’m sure I’m missing something probably simple, but I was not able to find anything about it in the official documentation or examples.

Logs

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
timothyhoang-googlecommented, Aug 1, 2022

The standard size for medium rectangle ads is 300x250. This size tends to have more ad inventory available from advertisers. The fixed sizes that tend to have more ad inventory available (and are therefore more likely to serve) follow IAB standard ad size specifications.

Since native ads can be of arbitrary size, there will be whitespace around the ad image whenever the native ad image container is larger than the image asset. For Fluid native assets, whitespace can still occur around the image if the native ad image container has an aspect ratio that doesn’t match the image asset aspect ratio.

@ldobreira - since you’re using AdMob, I suspect this issue is occurring because the native image asset doesn’t match the image container precisely. Unfortunately this is working as intended as not all advertisers campaigns are capable for supporting fluid.

I’ll close this issue but feel free to reopen if you think there is a problem with native rendering (e.g. image asset in ad response should actually fit the native ad image container).

0reactions
ldobreiracommented, Jul 27, 2022

@ldobreira - Can you confirm whether you are using AdMob or Ad Manager?

* For Ad Manager, you can request fluid size native ads, which contain assets that expand into the available inventory space.

* For AdMob, there is only support for the small and medium templates, which can receive fixed size assets which may create whitespace when inflated into the available inventory space. This occurs because the aspect ratio of the advertiser provided images must be preserved.

I’m just using Admob… what should be the standard size for the medium templates?

Read more comments on GitHub >

github_iconTop Results From Across the Web

About advanced format options for responsive display ads
Do not overlay text, logos, or buttons. Native ad formats images should have the product be the main focus of the image ;...
Read more >
Native Advertising: A Guide for Businesses
Of course, this Guide can't cover every issue associated with native advertising. Nor does it provide a safe harbor from potential liability ...
Read more >
Native Ads | Real-time Bidding - Google Developers
Native ads are ads formatted to fit the surrounding content and visual design, making them more likely to be viewed and clicked by...
Read more >
The pros and cons of Responsive Display Ads - Bannerwise
What exactly are Responsive Display Ads? · What are the benefits of using Responsive Display Ads? · Responsive Display Ads are quick to...
Read more >
Create Native Ads with Images - Yahoo Developer Network
Know if Your Native Ads are Working¶ ... Yahoo Native recommends that you continuously test and rework your image strategy and update your...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found