FacebookAdapter does support SmartBanner?

1,000 views
Skip to first unread message

Scott

unread,
Feb 5, 2015, 1:30:57 AM2/5/15
to google-adm...@googlegroups.com
Hi, we are currently integrating Facebook Audience Network.
(unity + googleads-mobile-plugin + FacebookAdapter1.0.1)

But we found that request for Smartbanner just says: 
    W/FacebookAdapter(18649): The input ad size is not supported at this moment.
and plain admob banner shows.

Request with Banner(320x50) size works fine.(The Facebook Test AD shows)

facebookAdapter for android seems to working on Smartbanner currently, am i correct?

private com.facebook.ads.AdSize getAdSize(com.google.android.gms.ads.AdSize adSize)
  {
    if ((adSize.getWidth() == com.facebook.ads.AdSize.BANNER_320_50.getWidth()) && 
      (adSize.getHeight() == com.facebook.ads.AdSize.BANNER_320_50.getHeight())) {
      return com.facebook.ads.AdSize.BANNER_320_50;
    }
    if ((adSize.isFullWidth()) && 
      (adSize.getHeight() == com.facebook.ads.AdSize.BANNER_HEIGHT_50.getHeight())) {
      return com.facebook.ads.AdSize.BANNER_HEIGHT_50;
    }
    if ((adSize.isFullWidth()) && 
      (adSize.getHeight() == com.facebook.ads.AdSize.BANNER_HEIGHT_90.getHeight())) {
      return com.facebook.ads.AdSize.BANNER_HEIGHT_90;
    }
    return null;
  }

or, are we missing something? 

thanks.

Andrew Brogdon (Mobile Ads SDK Team)

unread,
Feb 5, 2015, 9:10:40 PM2/5/15
to google-adm...@googlegroups.com
We occasionally see that error come up in response to a smart banner request with a height of 32.  AdMob supports smart banners with that height, but Facebook does not.

What height are you using for your ad placement?

-Andrew

Scott

unread,
Feb 6, 2015, 2:19:49 AM2/6/15
to google-adm...@googlegroups.com
We tested under Nexus7 1st gen and Samsung Galaxy Note2
don't know what exact height. it's a constant value (the SmartBanner, it is combination of AUTO_HEIGHT & FULL_WIDTH)

and height 32dp is for landscape phone only, all tested with portrait orientation.

  • 32 - phones in landscape
  • 50 - phones in portrait
  • 90 - tablets in either orientation
IMHO. android.gms.ads.AdSize.getHeight() returns AUTO_HEIGHT(which is -2), 
so smartBanner is not handled correctly in FacebookAdapter class.

 (adSize.getHeight() == com.facebook.ads.AdSize.BANNER_HEIGHT_50.getHeight())

2015년 2월 6일 금요일 오전 11시 10분 40초 UTC+9, Andrew Brogdon (Mobile Ads SDK Team) 님의 말:

Scott

unread,
Feb 6, 2015, 3:11:48 AM2/6/15
to google-adm...@googlegroups.com
wrote our own code.

    if ((adSize.getWidth() == com.facebook.ads.AdSize.BANNER_320_50.getWidth()) &&
      (adSize.getHeight() == com.facebook.ads.AdSize.BANNER_320_50.getHeight())) {
      return com.facebook.ads.AdSize.BANNER_320_50;
    }
    if (adSize.isFullWidth() && dpHeight <= 720) {
      return com.facebook.ads.AdSize.BANNER_HEIGHT_50;
    }
    if (adSize.isFullWidth() && dpHeight > 720) {
      return com.facebook.ads.AdSize.BANNER_HEIGHT_90;
    }


2015년 2월 6일 금요일 오후 4시 19분 49초 UTC+9, Scott 님의 말:

Ronald Geisler

unread,
Feb 10, 2015, 10:32:42 AM2/10/15
to google-adm...@googlegroups.com
We run into the same issue. Where do you get the sources of the adapter?

Ronald Geisler

unread,
Feb 10, 2015, 10:32:43 AM2/10/15
to google-adm...@googlegroups.com

Ronald Geisler

unread,
Feb 10, 2015, 2:21:24 PM2/10/15
to google-adm...@googlegroups.com
I fix it by comparing the raw pixel sizes:

    private int convertSize(Context context, int s) 
    {
    return (int)TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, s,
    context.getResources().getDisplayMetrics());
    }

    private com.facebook.ads.AdSize getAdSize(Context c, AdSize adSize)
    {
        if (adSize.getWidthInPixels(c) == convertSize(c, com.facebook.ads.AdSize.BANNER_320_50.getWidth()) && 
        adSize.getHeightInPixels(c) == convertSize(c, com.facebook.ads.AdSize.BANNER_320_50.getHeight()))
            return com.facebook.ads.AdSize.BANNER_320_50;
        if (adSize.isFullWidth() && adSize.getHeightInPixels(c) == convertSize(c, com.facebook.ads.AdSize.BANNER_HEIGHT_50.getHeight()))
            return com.facebook.ads.AdSize.BANNER_HEIGHT_50;
        if (adSize.isFullWidth() && adSize.getHeightInPixels(c) == convertSize(c, com.facebook.ads.AdSize.BANNER_HEIGHT_90.getHeight()))
            return com.facebook.ads.AdSize.BANNER_HEIGHT_90;
        else
            return null;
    }


Chen Wei Hsu

unread,
Feb 10, 2015, 9:04:03 PM2/10/15
to google-adm...@googlegroups.com
I am facing the same issue when integrating facebook audience network with dfp sdk.
Do you guys use admob or dfp sdk to integrate facebook audience network?
You cannot use facebook ad size for PublisherAdView or AdMob AdView, so why converting the size is helpful?
Unless you implement your custom event?

Ronald Geisler

unread,
Feb 11, 2015, 1:52:31 AM2/11/15
to google-adm...@googlegroups.com
I use AdMob and Facebook audience Network via  AdMob's Mediation. The code above is from the network adapter provided by google.

Scott explained the issue that android.gms.ads.AdSize.getHeight() returns -2 (AutoHeight).
but his workaround isn't really nice because he use a magic value. Where does the 720 came from and that does it mean on several devices?

Chen Wei Hsu

unread,
Feb 11, 2015, 2:08:06 AM2/11/15
to google-adm...@googlegroups.com
Ok, I now realize you us AdMob instead of dfp for mediation.
But do you use custom event of Admob for facebook audience network?
If not, how could you possibly do adview.setSize(com.facebook.ads.AdSize.BANNER_320_50) while adview is an object of android.gms.ads.AdView?

Ronald Geisler

unread,
Feb 11, 2015, 2:24:03 AM2/11/15
to google-adm...@googlegroups.com
in this case the variable adview is inside the of the network adapter and from type com.facebook.ads.AdView

CustomEvents are only for networks that admob doesn't support out the the box:

주세찬

unread,
Feb 11, 2015, 2:49:06 AM2/11/15
to google-adm...@googlegroups.com

720dp is from adMob's standards by device heights.

------------------------------------------------

Ad height

The height of your ad is based on your device’s height, as the following table indicates:

Device heightAd height
h < 400 dp32 dp
400 dp <= h < 720 dp50 dp
h >= 720 dp90 dp

Height is dependent on the device’s current orientation. In general, you'll see:

  • 50 dp height on portrait phones.
  • 32 dp height on landscape phones.
  • 90 dp height on 10-inch tablets and iPads in both orientations.
  • 90 dp height on portrait for most Android 7-inch tablets.
  • 50 dp height on landscape for most Android 7-inch tablets.

https://support.google.com/dfp_premium/answer/6160924?hl=en


2015년 2월 11일 수요일 오후 3시 52분 31초 UTC+9, Ronald Geisler 님의 말:

google-adm...@googlegroups.com

unread,
Feb 12, 2015, 12:39:24 PM2/12/15
to google-adm...@googlegroups.com
Would either of you be able to get a log of the requests and responses from Facebook, so I can see exactly what's going on with their traffic?  You can use a local proxy like Charles Proxy or Fiddler for this.  We don't have access to Facebook's SDK source code, which makes it difficult for me to get an accurate view of the situation and help.

-Andrew


On 02/10/15 07:32:43 mr.bet...@googlemail.com wrote:
We run into the same issue. Where do you get the sources of the adapter?

--

---
You received this message because you are subscribed to the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ronald Geisler

unread,
Feb 12, 2015, 1:32:18 PM2/12/15
to google-adm...@googlegroups.com, google-adm...@googlegroups.com
there is no facebook log because the fb adview will not be created by the adapter.

private com.facebook.ads.AdSize getAdSize(Context c, AdSize adSize) returns null

com.facebook.ads.AdSize facebookAdSize = getAdSize(context, adSize);       
if(facebookAdSize == null)
{
   Log.w(TAG, "The input ad size is not supported at this moment.");
   mBannerListener.onAdFailedToLoad(this, 3);
   return;
} else
{
....

Chen Wei Hsu

unread,
Feb 12, 2015, 8:02:42 PM2/12/15
to google-adm...@googlegroups.com
Hi Andrew,

The attached files are log from my android app and the session log from Charles Proxy when asking for ads from adomb. In my understanding, the app never gets a chance to get ad content from facebook because it thinks the ad size won't fit when receiving ad info from admob. I could be wrong, but I don't anything helpful from session log. The think I really don't understand is that why we would have to convert ad size ourselves. Shouldn't the sdk or adapter take care of that? By the way, my adsize is SmartBanner in the app.


--

---
You received this message because you are subscribed to a topic in the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-admob-ads-sdk/MWoBWBR0FQM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-admob-ads...@googlegroups.com.
dfp.mediation.facebook.session.chls
app.log

Andrew Brogdon (Mobile Ads SDK Team)

unread,
Feb 12, 2015, 8:34:27 PM2/12/15
to google-adm...@googlegroups.com
Thanks for posting your logs.  I spoke with one of the engineers on the Android SDK team, and he's going to dig into the code and see what's going on in both the adapter and our SDK.  This issue is clearly affecting a number of people, so it's important to get it right.

I'll reply here once I have more info.

-Andrew


On Thursday, February 12, 2015 at 5:02:42 PM UTC-8, Chen Wei Hsu wrote:
Hi Andrew,

The attached files are log from my android app and the session log from Charles Proxy when asking for ads from adomb. In my understanding, the app never gets a chance to get ad content from facebook because it thinks the ad size won't fit when receiving ad info from admob. I could be wrong, but I don't anything helpful from session log. The think I really don't understand is that why we would have to convert ad size ourselves. Shouldn't the sdk or adapter take care of that? By the way, my adsize is SmartBanner in the app.

2015-02-11 1:59 GMT+08:00 <google-admob-ads-sdk@googlegroups.com>:
Would either of you be able to get a log of the requests and responses from Facebook, so I can see exactly what's going on with their traffic?  You can use a local proxy like Charles Proxy or Fiddler for this.  We don't have access to Facebook's SDK source code, which makes it difficult for me to get an accurate view of the situation and help.

-Andrew


On 02/10/15 07:32:43 mr.bet...@googlemail.com wrote:
We run into the same issue. Where do you get the sources of the adapter?

--

---
You received this message because you are subscribed to the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-admob-ads-sdk+unsubscrib...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to a topic in the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-admob-ads-sdk/MWoBWBR0FQM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.

Chen Wei Hsu

unread,
Feb 12, 2015, 8:48:24 PM2/12/15
to google-adm...@googlegroups.com
I also want to point out that by chaning the ad size from SMART_BANNER to BANNER, I could receive the facebook audience network ads. However, it would be perfect if I could just use the SMART_BANNER size and let the sdk or adapter to do the conversion for me.

To unsubscribe from this group and all its topics, send an email to google-admob-ads...@googlegroups.com.

Andrew Brogdon (Mobile Ads SDK Team)

unread,
Feb 18, 2015, 1:20:29 PM2/18/15
to google-adm...@googlegroups.com
I just wanted to let you guys know that we have a new version of the Facebook adapter that's being staged for release, and it should fix this problem.  I'll post here again when it's made public.

-Andrew

Chen Wei Hsu

unread,
Feb 18, 2015, 9:24:20 PM2/18/15
to google-adm...@googlegroups.com
so glad to hear that!

--

Max Obrazok

unread,
Feb 25, 2015, 1:39:24 PM2/25/15
to google-adm...@googlegroups.com
Hi Andrew!

Any update on new Facebook Adpater question?

Many thanks!

Andrew Brogdon (Mobile Ads SDK Team)

unread,
Feb 25, 2015, 2:55:22 PM2/25/15
to google-adm...@googlegroups.com
I pinged the engineer just to be sure, but the adapter is still being tested.  I have this forum post pinned, though, and I'll make sure to let you guys know when the download link goes live.

-Andrew

Andrew Brogdon (Mobile Ads SDK Team)

unread,
Mar 10, 2015, 8:39:01 PM3/10/15
to google-adm...@googlegroups.com
Looks like the new Facebook adapter is ready!

You can grab it from our Mediation Networks page.  Let me know if you still have an issue with smart banner sizes.

-Andrew

Chen Wei Hsu

unread,
Mar 10, 2015, 9:09:47 PM3/10/15
to google-adm...@googlegroups.com
Hi Andrew,

I just downloaded the new Facebook adapter and tried it on my app. However, I still could not load any facebook ads by using SMART_BANNER. I do notice that the change log said the the smart banner is supported now. I find the following messages from my debug app. In our app, we use https for security because our server also use https. Is this why I cannot load the smart banner ads?

03-11 09:00:44.328  24773-24773/xxxxxxxxx W/Ads﹕ JS: The page at 'https://pubads.g.doubleclick.net/gampad/ads' was loaded over HTTPS, but ran insecure content from 'http://googleads.g.doubleclick.net/mads/static/formats/templates.js': this content should also be loaded over HTTPS.
03-11 09:00:44.328  24773-24773/xxxxxxxxx I/chromium﹕ [INFO:CONSOLE(0)] "The page at 'https://pubads.g.doubleclick.net/gampad/ads' was loaded over HTTPS, but ran insecure content from 'http://googleads.g.doubleclick.net/mads/static/formats/templates.js': this content should also be loaded over HTTPS.

--

Andrew Brogdon (Mobile Ads SDK Team)

unread,
Mar 11, 2015, 11:33:36 AM3/11/15
to google-adm...@googlegroups.com
Weird.  That's a different issue, judging by the protocol warnings.  I would try clearing any cached data on the device and try a different network to see if the problem persists.

-Andrew


On Tuesday, March 10, 2015 at 6:09:47 PM UTC-7, Chen Wei Hsu wrote:
Hi Andrew,

I just downloaded the new Facebook adapter and tried it on my app. However, I still could not load any facebook ads by using SMART_BANNER. I do notice that the change log said the the smart banner is supported now. I find the following messages from my debug app. In our app, we use https for security because our server also use https. Is this why I cannot load the smart banner ads?

03-11 09:00:44.328  24773-24773/xxxxxxxxx W/Ads﹕ JS: The page at 'https://pubads.g.doubleclick.net/gampad/ads' was loaded over HTTPS, but ran insecure content from 'http://googleads.g.doubleclick.net/mads/static/formats/templates.js': this content should also be loaded over HTTPS.
03-11 09:00:44.328  24773-24773/xxxxxxxxx I/chromium﹕ [INFO:CONSOLE(0)] "The page at 'https://pubads.g.doubleclick.net/gampad/ads' was loaded over HTTPS, but ran insecure content from 'http://googleads.g.doubleclick.net/mads/static/formats/templates.js': this content should also be loaded over HTTPS.
To unsubscribe from this group and all its topics, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.

Ronald Geisler

unread,
Mar 12, 2015, 2:50:56 AM3/12/15
to google-adm...@googlegroups.com
Hi Andrew,
the new adapter doesn't fix the issue :-(: 03-12 06:41:18.517: W/FacebookAdapter(1197): The input ad size 360x50_as is not supported at this moment.

I figured out a second size issue. When i use a banner in landscape and set the position to the top left corner than admob works correct but facebook doesn't match the size of the admob view. Facebook use the whole display width as you can see in the attached screenshot.
regards
ronald
issue.png

Changzhi Wang

unread,
Mar 23, 2015, 3:24:34 AM3/23/15
to google-adm...@googlegroups.com
Yes. Same issue here! Get full width banner instead of 320x50 in landscape mode.

Andrew Brogdon (Mobile Ads SDK Team)

unread,
Mar 23, 2015, 3:59:30 PM3/23/15
to google-adm...@googlegroups.com
Hmm. Without access to Facebook's source, I'm not able to see exactly why they're requesting/returning the size they are.  If one of you is able to capture a Charles Proxy log with SSL Proxying turned on, I would be happy to take a look at the traffic, though.

-Andrew

Oliver Ebert

unread,
Jul 21, 2015, 8:46:10 AM7/21/15
to google-adm...@googlegroups.com
Is there already a fix for "full width banner instead of 320x50 in landscape mode" issue?
Reply all
Reply to author
Forward
0 new messages