Modified ad code: Resizing Ad Frames

111 views
Skip to first unread message

netl...@gmail.com

unread,
Sep 6, 2021, 7:09:02 AM9/6/21
to Google Mobile Ads SDK Developers
Hi, could someone please help me out with this? I'm not sure what they mean with this, I have not altered Google ads in any way!

Modified ad code: Resizing Ad Frames
MODIFIED ADS: Publishers are not permitted to alter the behavior of Google ads in any way. This includes resizing ad frames to cut off parts of ads or hiding the Ads by Google moniker.

Thanks a lot!

netl...@gmail.com

unread,
Sep 6, 2021, 7:48:54 AM9/6/21
to Google Mobile Ads SDK Developers
Would be great to know if they are talking about the banner, app open, or interstitial ads?

Thanks!

netl...@gmail.com

unread,
Sep 6, 2021, 8:22:46 AM9/6/21
to Google Mobile Ads SDK Developers
Also another weird thing is that test ads no longer work? I keep getting "No ad config" error or "Ad failed to load : 3" even though I am using test ads.

netl...@gmail.com

unread,
Sep 6, 2021, 9:56:04 AM9/6/21
to Google Mobile Ads SDK Developers
Hey guys, this seems to be an issue with the banner ad creative appearing cut off in the app, I have seen this before in other apps too (and just saw it now in another app), it seems to be a bug when advertisers create the banner ad. Policy team thinks this is an issue with the ad implementation in the app. If you could report this to them it would mean a lot!

Thanks!

ss.png
ss2.png

netl...@gmail.com

unread,
Sep 6, 2021, 10:41:43 AM9/6/21
to Google Mobile Ads SDK Developers
This my code for the adaptive banner if you want to check, I don't think this can ever cause the banner ad to get cut off, right?

RelativeLayout adContainer = activity.findViewById(R.id.adContainer);

AdRequest.Builder adRequestBuilder = new AdRequest.Builder();
SharedPreferences settings = activity.getSharedPreferences("settings", MODE_PRIVATE);
if (settings.getInt("consent", 0) == 0) {
    Bundle bundle = new Bundle();
    bundle.putString("npa", "1");
    adRequestBuilder.addNetworkExtrasBundle(AdMobAdapter.class, bundle);
}
AdRequest adRequest = adRequestBuilder.build();
AdView adView = new AdView(activity);

Display display = activity.getWindowManager().getDefaultDisplay();
DisplayMetrics displayMetrics = new DisplayMetrics();
display.getMetrics(displayMetrics);
float widthPixels = displayMetrics.widthPixels;
float density = displayMetrics.density;
int adWidth = (int) (widthPixels / density);
adView.setAdSize(AdSize.getCurrentOrientationAnchoredAdaptiveBannerAdSize(activity, adWidth));
float adHeight = Objects.requireNonNull(adView.getAdSize()).getHeight();
adContainer.getLayoutParams().height = (int) (adHeight * density);

adView.setAdUnitId("ca-app-pub-3940256099942544/6300978111");
adContainer.addView(adView);


Again, test ads do not seem to work at all now!

Thanks!

Mobile Ads SDK Forum Advisor

unread,
Sep 7, 2021, 3:27:57 AM9/7/21
to netl...@gmail.com, google-adm...@googlegroups.com
Hi Netlinkd,

Thank you for reaching out to us.

I've tried our sample app, and test ads show successfully on my end (please see attached screenshot). Could you please confirm if you're using our sample ad unit id on an actual device? Also, could you try requesting ads with an enable test device instead?

On the other hand, I wasn't able to replicate the issue reported here with our banner sample app (kindly refer to the same screenshot attached). Could you confirm if the behavior is reliably reproducible on your end? If so, could you share a Charles log (see instructions here) capturing the ad request (via Reply to author option. If the option does not work, kindly reply to mobileadstesting99@gmail.com, then let us know here once sent) so that I can further investigate?

Regards,
Google Logo
Teejay Wennie Pimentel
Mobile Ads SDK Team
 




 

ref:_00D1U1174p._5004Q2NRnps:ref
Screen Shot 2021-09-07 at 1.20.16 PM.png

netl...@gmail.com

unread,
Sep 7, 2021, 9:00:15 AM9/7/21
to Google Mobile Ads SDK Developers
Hey Teejay,

Thanks for your reply! Test ads seem to work now after my restriction was lifted (I didn't change anything), it seems that they do not work when you have restrictions on your account, but how would you fix any policy issue if you cannot test the ads? That's pretty odd. And yes it was both on the emulator and on my real device. I've only tried with the sample ad unit id.

I was lucky to replicate the issue last night, it happens very rarely with some live test ads like this one attached. All the other ads are fine, including the standard test ads. Would it be possible for you to please verify if there's an issue with just that ad creative? It seems the SDK does not render it correctly when it is resized I think.. It's impossible for it to display to the right like that because of my implementation, I have my ad container's gravity set to center_horizontal but I also changed it to start and it looks exactly the same, looks like the SDK decides the position of the ad itself, and my container is set to the full width of the device. I tried both SDK (ads-lite) 20.0.0 and the latest 20.3.0 and the results are the same with that specific ad.

Please let me know if you need more info, thanks!

On Tuesday, September 7, 2021 at 10:27:57 AM UTC+3 mobileadssdk wrote:
Hi Netlinkd,

Thank you for reaching out to us.

I've tried our sample app, and test ads show successfully on my end (please see attached screenshot). Could you please confirm if you're using our sample ad unit id on an actual device? Also, could you try requesting ads with an enable test device instead?

On the other hand, I wasn't able to replicate the issue reported here with our banner sample app (kindly refer to the same screenshot attached). Could you confirm if the behavior is reliably reproducible on your end? If so, could you share a Charles log (see instructions here) capturing the ad request (via Reply to author option. If the option does not work, kindly reply to mobileads...@gmail.com, then let us know here once sent) so that I can further investigate?
ss2.png

Mobile Ads SDK Forum Advisor

unread,
Sep 7, 2021, 2:28:10 PM9/7/21
to netl...@gmail.com, google-adm...@googlegroups.com
Hi Netlinkd,

Thank you for reaching back to us. It seems that the issue has resolved itself and that you are able to get the ads to show. As for what could cause this or why the violation? This we are not fully able to answer, as we do not handle the policy violations. So we are unsure why this could have been triggered. The one thing that I see that could have some effect on this is the fact that you are using the SDK Lite, which might have some functionality removed to keep it small. And thus could be missing also some of the abilities it needs to avoid this from happening. At the same time it could also be bad creatives, which happens often.

Regards,
Google Logo
William Pescherine
Mobile Ads SDK Team
 


ref:_00D1U1174p._5004Q2NRnps:ref

netl...@gmail.com

unread,
Sep 7, 2021, 3:21:49 PM9/7/21
to Google Mobile Ads SDK Developers
Hey William,

Hope you are doing well over there!

I have seen that ad today as well and it looks the same (cut off). Would have been to good to know if it's an issue with just a bad creative and not something else, so I know if I need to do any changes on my end or if you need to fix a bug in the SDK.

Thanks

Mobile Ads SDK Forum Advisor

unread,
Sep 8, 2021, 2:56:18 AM9/8/21
to netl...@gmail.com, google-adm...@googlegroups.com
Hi Netlinkd,

I've checked the code snippet that you provided on this thread, and can confirm that it is aligned with our implementation document, so it's safe to assume that you SDK implementation is fine. Since the behavior only occurs on a specific creative, then we could say that the issue here is on the creative itself. However, if you could provide a Charles log (see instructions here) capturing the specific ad, that would greatly help us in our investigation as this will enable us to replicate the behavior in our test app environment (by trafficking the creative in the test network).

Regards,
Google Logo
Teejay Wennie Pimentel
Mobile Ads SDK Team
 


ref:_00D1U1174p._5004Q2NRnps:ref

netl...@gmail.com

unread,
Sep 8, 2021, 8:01:29 AM9/8/21
to Google Mobile Ads SDK Developers
Hi Teejay,

Thanks for your reply. I'll try to provide a Charles log but please note that I may not be lucky to get that specific ad again, but I was thinking you could maybe search for a "WorldRemit" ad in the system or maybe ask someone who has access, it would be a lot easier than me trying to "fish" for it. And then please maybe check if there's a bug in the Google Ads UI when an advertiser adds that ad creative.

Thanks!

Mobile Ads SDK Forum Advisor

unread,
Sep 8, 2021, 5:03:10 PM9/8/21
to netl...@gmail.com, google-adm...@googlegroups.com
Hi Netlinkd,

Thank you for the response. I have looked over this and the fact that this seems to be a very uncommon case. It would be very tough for us to be able to find the ad also. The fact that it is not happening constantly would tend to point more to a bad creative, especially since it also appears to be just one ad. Once you are able to get the Charles log we will definitely bring it to our team to look at more.

Regards,
Google Logo
William Pescherine
Mobile Ads SDK Team
 


ref:_00D1U1174p._5004Q2NRnps:ref
Reply all
Reply to author
Forward
0 new messages