DevDev
DevDev

Reputation: 81

AdMob Facebook Mediation in Android

I am unable to mediate between admob and facebook audience network (FAN) in android app. The app is only serving ads from Admob network. The mediation between Admob and FAN is not working. Below is the process I have followed:

  1. Integrated Admob in Android app. This is working fine.
  2. Created a new developer account in facebook.
  3. Added a new app (application id) in facebook.
  4. Added two publishers id in facebook (one for banner and other for interstitial)
  5. Included the adapter jar in the eclipse and added it to build path
  6. Downloaded facebook sdk and added the classes.jar in eclipse. Added this to build path.
  7. Added meta-data for facebook app id in Android Manifest
  8. Project is compiled without any errors
  9. Made proguard changes as per the instruction available at: https://firebase.google.com/docs/admob/android/mediation#include_network_adapters_and_sdks
  10. Added mediation entries in Admob with ecpm 0.01 and 5.00.

When I run the code, I only get test ads from admob. On facebook, i see no ad requests. Till facebook doesn't recieves the ad request, it won't validate the app and ads.

Not sure if I need to make any change to android code. I am using the same code that worked for admob. It is just that I have now included the facebook jars and made changes to manifest file. No change is made to java code files or xml files?

Also, does facebook need activity context in adview request? I have adview defined in XML so I don't knw how to pass the activity context.

The code is driving me crazy.. and there is no single documentation available on how to make admob and FAN work in android code..

Upvotes: 4

Views: 10016

Answers (4)

Merbin Joe
Merbin Joe

Reputation: 688

After integrating the ads and sdk, you can used mediation test suit to test your ad implementation.

https://developers.google.com/admob/android/migrate-to-ad-inspector

Upvotes: 0

user846316
user846316

Reputation: 6331

To get the Facebook ads delivered to your device, you need to have Facebook app installed and logged-in at least once. Do the following:

  1. Install the Facebook app on your phone

  2. Log in to the Facebook app with the same account from which you are requesting the ads

  3. Now open your own app and request the ads from Facebook. If your integration is fine, you should get the ads.

Upvotes: 1

Richard R
Richard R

Reputation: 967

Here's what I did: For Facebook to validate your app, deactivate the mediation in your code and try loading just a Facebook ad instead as they show on their how-to-page. Once you see the ad from Facebook the status of your App turns to "validating". For me after like 3-4 hours it changed to "ready".

Upvotes: 1

mboy
mboy

Reputation: 755

Prioritize facebook so the traffic/request will go to facebook instead admob just for testig purposes.

In my case to redirect traffic to facebook I set admob floor eCPM to $50 so it won't be served and surely it will try facebook since you configured it in the mediation stack.

NOTE: DO not use test ads on admob when doing above. Use real ads just don't click on it.

Upvotes: 2

Related Questions