ammarahm-ed / react-native-admob-native-ads

A simple and robust library for creating & displaying Admob Native Advanced Ads in your React Native App using Native Views.
https://ammarahm-ed.github.io/react-native-admob-native-ads/docs/introduction/
MIT License
399 stars 134 forks source link

Facebook Mediation w/Header Bidding #230

Open raffibag opened 2 years ago

raffibag commented 2 years ago

While I've integrated this library and have ads being served via FB Audience Network mediation using waterfall, no calls have been posted using header bidding - despite setting everything up per both AdMob and Facebook's instructions.

Is bidding fully supported in this library? And, if so, is there any additional client-side configuration that's required to make it work?

forbesgillikin commented 2 years ago

I'm having this same issue

ammarahm-ed commented 2 years ago

Have you checked if AdMob Mediation supports header bidding?

forbesgillikin commented 2 years ago

@ammarahm-ed Have you checked if AdMob Mediation supports header bidding?

Yes.

https://support.google.com/admob/answer/9842838?hl=en

Also Facebook Audience Network no longer supports Waterfall Ad Requests and only supports Header Bidding.

https://www.facebook.com/audiencenetwork/resources/blog/audience-network-to-become-bidding-only-beginning-with-ios-in-2021

Also, the documentation needs to be updated to include trackingAuthorized: true for iOS in the Ad Manager setup.

AdManager.setRequestConfiguration({
  maxAdContentRating: 'PG',
  tagForChildDirectedTreatment: true,
  tagForUnderAgeConsent: true,
  trackingAuthorized: true
})
ammarahm-ed commented 2 years ago

@raffibag trackingAuthorized should be set to true if tracking is authorized by the user. Otherwise not.

ammarahm-ed commented 2 years ago

Also follow this guide to setup bidding properly: https://developers.google.com/admob/android/mediation/facebook in Admob. Also you may want to check the version of Facebook Audience Network adapter installed in android. It should be higher than 5.10.0.0 for bidding to work properly

raffibag commented 2 years ago

Thank you @ammarahm-ed for the update. I confirmed everything is set up correctly - and saw confirmation of as much in the Mediation Test Suite. Seems, however, that AdMob is not recognizing my device as a test device when using the production ad unit id (works fine when I use the generic Google test ad unit id).

A few reasons why I suspect this: 1) The Mediation Test Suite does not recognize the test device, even though I confirmed it's correct in the AdMob portal (and am passing it as a prop in the AdManager config); 2) My app had previously been flagged by AdMob for violating their policies as my "test" device was requesting too many ads, which leads me to believe AdMob is not recognizing the device as registered; 3) Ads are not serving on my "test" device when using the production ad unit id - only when I use the generic Google test ad unit id.

As such, I suspect the issue is not related to FB Mediation integration, rather it may be a React Native issue whereby the IDFA on my iOS device is not making its way to AdMob. Have you encountered this issue?

I've attached screens of my MTS screens - including the screen showing the Facebook Audience Network SDK details... You'll see it's not allowing an ad load as it does not recognize the test device ID, which is also registered w/Facebook mediation.

IMG_DF145D7152A0-1 IMG_04E8E6EC6810-1

ammarahm-ed commented 2 years ago

@raffibag have you added your device idfa to facebook audience network to get test ads? And have you registered your idfa with admob?

For facebook audience network to show test ads, you must register your device IDFA in test devices. To get your device IDFA you can download any IDFA app from App store that supports the latest App Tracking Transparency Dialog SDK.

raffibag commented 2 years ago

@ammarahm-ed yes - I have the test device set up using the IDFA in both AdMob and Facebook. I also tried it while passing the test device IDs in the AdManager config (e.g, AdManager.setRequestConfiguration({ testDeviceIds: ["XXXX-XXXX-XXXXX-XXXXX"], ... }). Note also that I did send a test ad to the test device via the "Select test ad" link associated with the test device in the Facebook console.

I'm learning that AdMob often limits ad traffic for new services with limited usage - so it may be the ad serving limit is due to that.

Can you please confirm whether I should be using the AdMob Test Ad Unit ID or my app's production Ad Unit ID for testing mediation? I suspect it needs to be the latter (my app's Ad Unit ID), as the Facebook Placement ID needs to be associated with an AdMob Ad Unit ID. I've tested it both ways and it doesn't seem to work. As I understand, registering the test device IDFA allows you to use the app's Ad Unit ID while not incurring invalid traffic.

If you can confirm this works correctly on your end, we can close this issue - as the original issue (sdk integration) has been resolved.

ammarahm-ed commented 2 years ago

You will need to use your app's test IDs. Then you have to register your test device with admob to get test ads from admob. For facebook, you must set your IDFA in facebook ads. And Get IDFA permission for your App that integrates Admob during testing so that facebook can confirm it's the same device.

One more thing to try: Install latest library version from master branch.