banner



Only Facebook And Google Will Load

This guide is intended for publishers who want to use the Google Mobile Ads SDK to load and display ads from the Facebook Audience Network through bidding and waterfall mediation. It covers how to add Facebook Audience Network ads to an ad unit's mediation configuration and how to integrate the Facebook Audience Network SDK and adapter into an Android app.

Supported ad formats and features

The AdMob mediation adapter for the Facebook Audience Network has the following capabilities:

Formats
Banner
Interstitial
Rewarded
Rewarded Interstitial
Native
Features
Adaptive banner
Ad network optimization (ANO)
Bidding

Requirements

  • Android API level 16 or higher

  • [For bidding]: Facebook Audience Network adapter 5.10.0.0 or higher (latest version recommended)

  • Latest Google Mobile Ads SDK

Step 1: Set up Facebook Audience Network

Sign up and Log in to the Business Manager Start page.

Click Create a new Business Manager account and fill out the required fields with your business details.

Create a Facebook property

Once you've filled out the required information, you'll be prompted to create a property for your app. Enter the desired name of the property for your app and click Go to Monetization Manager.

Next, select Android as the platform to monetize.

Indicate whether or not your app is live and click Submit.

You will be prompted to create an ad placement for your application. Select a format, fill out the form and click Next.

Bidding

Waterfall

The next step presents an overview of the placement you created. Take note of the Placement ID under the Add placement ID section. Additionally, you will also need your System User Access Token. Simply click the Generate Token button under the Add system user access token section to generate it. You will need both the Placement ID and the System User Access Token when you set up your ad unit ID.

You need to add Facebook to the mediation configuration for your ad unit. First sign in to your AdMob account.

Navigate to the Mediation tab. If you have an existing mediation group you'd like to modify, click the name of that mediation group to edit it, and skip ahead to Add Facebook Audience Network as an ad source.

To create a new mediation group, select Create Mediation Group.

Mediation details

Enter your ad format and platform, then click Continue.

Give your mediation group a name, and select locations to target. Next, set the mediation group status to Enabled. Then click Add Ad Units, which will open up the ad unit selection overlay.

Mediation group 2

Associate this mediation group with your existing AdMob ad unit. Then click Done.

Select ad unit

You should now see the ad units card populated with the ad units you selected.

Group ad units

Add Facebook Audience Network as an ad source

Bidding

Under the Bidding card in the Ad Sources section, select Add Ad Source. Then select Facebook Audience Network.

Next, enter the Placement ID obtained in the previous section and click Done.

Finally, click Save.

Waterfall

In the Ad Sources card, select Add Ad Network.

Select Facebook Audience Network. Enable the Optimize switch. Enter the System User Access Token and Property ID obtained in the previous section. App Access Token is deprecated and can be left blank. Review and check the Authorization checkbox to set up Ad Network Optimization (ANO) for Facebook Audience Network. Then enter an eCPM value for Facebook Audience Network and click Continue.

Enter the Placement ID obtained in the previous section. Then click Done.

Finally, click Save.

Using rewarded ads

In the settings for your rewarded ad unit, provide values for the reward amount and reward type. Then, to ensure you provide the same reward to the user no matter which ad network is served, check the Apply to all networks in Mediation groups box.

If you don't apply this setting, the Facebook adapter defaults to a reward of type "" (empty string) with a value of 1. The Facebook SDK does not provide specific reward values for its rewarded ads.

For more information on setting reward values for AdMob ad units, see Create an ad unit.

Step 3: Import the Facebook Audience Network SDK and adapter

Add the following implementation dependencies with the latest versions of the Facebook Audience Network SDK and adapter in the app-level build.gradle file:

repositories {     google()     mavenCentral() }  ... dependencies {     implementation 'com.google.android.gms:play-services-ads:20.5.0'          implementation 'com.google.ads.mediation:facebook:6.8.0.0'          } ...        

Manual integration

  1. Download the latest version of the Facebook Audience Network SDK for Android and extract the AudienceNetwork.aar under the AudienceNetwork/bin folder and add it to your project.

  2. Navigate to the Facebook Audience Network adapter artifacts on Google's Maven Repository. Select the latest version, download the Facebook Audience Network adapter's .aar file, and add it to your project.

Step 4: Additional code required

Follow Facebook's Android network security config guide to modify your network security config file to support media caching.

Step 5: Test your implementation

See the Testing Audience Network Implementation guide guide for detailed instructions on how to enable Facebook test ads. You can then use the Mediation Test Suite to verify if your implementation is correct.

That's it! You now have a working mediation integration with Facebook's Audience Network.

Optional steps

Under the Google EU User Consent Policy, you must ensure that certain disclosures are given to, and consents obtained from, users in the European Economic Area (EEA) regarding the use of device identifiers and personal data. This policy reflects the requirements of the EU ePrivacy Directive and the General Data Protection Regulation (GDPR). When seeking consent, you must identify each ad network in your mediation chain that may collect, receive, or use personal data and provide information about each network's use. Google currently is unable to pass the user's consent choice to such networks automatically.

Please review Facebook's guidance for information about GDPR and Facebook advertising.

CCPA

The California Consumer Privacy Act (CCPA) requires giving California state residents the right to opt out of the "sale" of their "personal information" (as the law defines those terms), with the opt-out offered via a prominent "Do Not Sell My Personal Information" link on the "selling" party's homepage. The CCPA preparation guide offers the ability to enable restricted data processing for Google ad serving, but Google is unable to apply this setting to each ad network in your mediation chain. Therefore, you must identify each ad network in your mediation chain that may participate in the sale of personal information and follow guidance from each of those networks to ensure compliance with CCPA.

Please review Facebook's documentation for data processing options for users in California.

Using native ads

Some Facebook native ad assets don't map one to one to Google native ad assets. Such assets are passed back to the publisher in a bundle in getExtras() method in NativeAd. Here's a code example showing how to extract these assets:

Example:

Java

              Bundle extras = nativeAd.getExtras(); if (extras.containsKey(FacebookAdapter.KEY_SOCIAL_CONTEXT_ASSET)) {     String socialContext = extras.get(FacebookAdapter.KEY_SOCIAL_CONTEXT_ASSET);     ... }                          

Kotlin

              val extras = nativeAd.getExtras() if (extras.containsKey(FacebookAdapter.KEY_SOCIAL_CONTEXT_ASSET)) {    var socialContext = extras.get(FacebookAdapter.KEY_SOCIAL_CONTEXT_ASSET)    ... }                          

Using Facebook Native Ads without a MediaView

Facebook's native ad format requires rendering the MediaView asset. If you plan to render native ads without that asset, make sure to use Facebook's native banner ad format.

To use Facebook's native banner ads instead, you must:

  • Select the Native Banner format when setting up Facebook Audience Network.
  • Use Facebook adapter 5.4.1.0 or higher.
  • For waterfall mediation, pass an extra parameter into the ad request indicating you want to request a native banner ad, as shown below.

Java

              Bundle extras = new FacebookExtras()        .setNativeBanner(true)        .build();  AdRequest request =  new AdRequest.Builder()        .addNetworkExtrasBundle(FacebookAdapter.class, extras)        .build();                          

Kotlin

              var extras = FacebookExtras()        .setNativeBanner(true)        .build()  var adrequest = AdRequest.Builder()        .addNetworkExtrasBundle(FacebookAdapter::class.java, extras)        .build()                          

Ad rendering

The Facebook adapter returns its native ads as NativeAd objects. It populates the following Native ads field descriptions for a NativeAd.

Field Populated by Facebook adapter
Headline
Image 1
Body
App icon
Call to action
Advertiser Name
Star rating
Store
Price

1 The Facebook adapter does not provide direct access to the main image asset for its native ads. Instead, the adapter populates the MediaView with a video or an image.

Impression and click tracking

The table below demonstrates when native ad impressions and clicks are recorded by the Google Mobile Ads SDK.

Integration type Impression recording Click recording
Bidding 1px of native ad on screen + asset rendering requirements Facebook Audience Network SDK callback
Waterfall Facebook Audience Network SDK callback Facebook Audience Network SDK callback

For bidding impressions, Facebook Audience Network has specific asset rendering requirements in order for an impression to be considered valid, depending on whether you selected the Native or Native Banner format when setting up Facebook Audience Network.

Facebook native format Required asset Required rendering class
Native Media View MediaView
Native Banner App icon ImageView

Error codes

If the adapter fails to receive an ad from the Facebook Audience Network, publishers can check the underlying error from the ad response using ResponseInfo.getAdapterResponse() under the following classes:

          com.google.ads.mediation.facebook.FacebookAdapter com.google.ads.mediation.facebook.FacebookMediationAdapter                  

Here are the codes and accompanying messages thrown by the Facebook Audience Network adapter when an ad fails to load:

Error code Reason
101 Invalid server parameters (e.g. missing Placement ID).
102 The requested ad size does not match a Facebook Audience Network supported banner size.
103 The publisher must request ads with an Activity context.
104 The Facebook Audience Network SDK failed to initialize.
105 The publisher did not request for Unified native ads.
106 The native ad loaded is a different object than the one expected.
107 The Context object used is invalid.
108 The loaded ad is missing the required native ad assets.
109 Failed to create a native ad from the bid payload.
110 The Facebook Audience Network SDK failed to present their interstitial/rewarded ad.
111 Exception thrown when creating a Facebook Audience Network AdView object.
1000-9999 The Facebook Audience Network returned an SDK-specific error. See Facebook's documentation for more details.

6.8.0.0

  • Verified compatibility with Facebook SDK v6.8.0.
  • Updated the minimum required Google Mobile Ads SDK version to 20.4.0.

Built and tested with:

  • Google Mobile Ads SDK version 20.4.0.
  • Facebook SDK version 6.8.0.

6.7.0.0

  • Verified compatibility with Facebook SDK v6.7.0.

Built and tested with:

  • Google Mobile Ads SDK version 20.3.0.
  • Facebook SDK version 6.7.0.

6.6.0.0

  • Verified compatibility with Facebook SDK v6.6.0.
  • Updated the minimum required Google Mobile Ads SDK version to 20.3.0.

Built and tested with:

  • Google Mobile Ads SDK version 20.3.0.
  • Facebook SDK version 6.6.0.

6.5.1.1

  • Fixed a bug introduced in 6.5.1.0 where test ads are returned instead of live ads.
  • Updated the adapter to use the new AdError API.

Built and tested with:

  • Google Mobile Ads SDK version 20.2.0.
  • Facebook SDK version 6.5.1.

6.5.1.0 (Deprecated)

  • An issue with version 6.5.1.0 has been detected and confirmed. It is recommended to upgrade to version 6.5.1.1.
  • Verified compatibility with Facebook SDK v6.5.1.
  • Updated the minimum required Google Mobile Ads SDK version to 20.2.0.

Built and tested with:

  • Google Mobile Ads SDK version 20.2.0.
  • Facebook SDK version 6.5.1.

6.5.0.0

  • Verified compatibility with Facebook SDK v6.5.0.
  • Fixed an issue where native ads did not include Facebook's cover image.
  • Updated the minimum required Google Mobile Ads SDK version to 20.1.0.

Built and tested with:

  • Google Mobile Ads SDK version 20.1.0.
  • Facebook SDK version 6.5.0.

6.4.0.0

  • Verified compatibility with Facebook SDK v6.4.0.
  • Updated the minimum required Google Mobile Ads SDK version to 20.0.0.

Built and tested with:

  • Google Mobile Ads SDK version 20.0.0.
  • Facebook SDK version 6.4.0.

6.3.0.1

  • Fixed an issue where a ClassCastException is thrown when rendering native ads on apps that don't use ImageView to render image assets.

Built and tested with:

  • Google Mobile Ads SDK version 19.7.0.
  • Facebook SDK version 6.3.0.

6.3.0.0

  • Verified compatibility with Facebook SDK v6.3.0.

Built and tested with:

  • Google Mobile Ads SDK version 19.7.0.
  • Facebook SDK version 6.3.0.

6.2.1.0

  • Verified compatibility with Facebook SDK v6.2.1.
  • Updated the minimum required Google Mobile Ads SDK version to 19.7.0.

Built and tested with:

  • Google Mobile Ads SDK version 19.7.0.
  • Facebook SDK version 6.2.1.

6.2.0.1

  • Removed support for the deprecated NativeAppInstallAd format. Apps should request for unified native ads.
  • Updated the minimum required Google Mobile Ads SDK version to 19.6.0.

Built and tested with:

  • Google Mobile Ads SDK version 19.6.0.
  • Facebook SDK version 6.2.0.

6.2.0.0

  • Verified compatibility with Facebook SDK v6.2.0.
  • Updated the minimum required Google Mobile Ads SDK version to 19.5.0.

Built and tested with:

  • Google Mobile Ads SDK version 19.5.0.
  • Facebook SDK version 6.2.0.

6.1.0.0

  • Verified compatibility with Facebook SDK v6.1.0.
  • Updated the minimum required Google Mobile Ads SDK version to 19.4.0.

Built and tested with:

  • Google Mobile Ads SDK version 19.4.0.
  • Facebook SDK version 6.1.0.

6.0.0.0

  • Verified compatibility with Facebook SDK v6.0.0.
  • Updated the minimum required Google Mobile Ads SDK version to 19.3.0.

Built and tested with:

  • Google Mobile Ads SDK version 19.3.0.
  • Facebook SDK version 6.0.0.

5.11.0.0

  • Verified compatibility with Facebook SDK v5.11.0.

Built and tested with:

  • Google Mobile Ads SDK version 19.2.0.
  • Facebook SDK version 5.11.0.

5.10.1.0

  • Verified compatibility with Facebook SDK v5.10.1.

Built and tested with:

  • Google Mobile Ads SDK version 19.2.0.
  • Facebook SDK version 5.10.1.

5.10.0.0

  • Verified compatibility with Facebook SDK v5.10.0.

Built and tested with:

  • Google Mobile Ads SDK version 19.2.0.
  • Facebook SDK version 5.10.0.

5.9.1.0

  • Verified compatibility with Facebook SDK v5.9.1.

Built and tested with:

  • Google Mobile Ads SDK version 19.2.0.
  • Facebook SDK version 5.9.1.

5.9.0.2

  • Added support for rewarded interstitial ads.
  • Updated the adapter to support inline adaptive banner requests.
  • Fixed an issue where bidding banner ads always render full-width.
  • Updated the minimum required Google Mobile Ads SDK version to 19.2.0.

Built and tested with:

  • Google Mobile Ads SDK version 19.2.0.
  • Facebook SDK version 5.9.0.

5.9.0.1

  • Adapter now forwards an error if the FAN SDK encounters an error while presenting an interstitial/rewarded ad.

Built and tested with:

  • Google Mobile Ads SDK version 19.1.0.
  • Facebook SDK version 5.9.0.

5.9.0.0

  • Verified compatibility with Facebook SDK v5.9.0.

Built and tested with:

  • Google Mobile Ads SDK version 19.1.0.
  • Facebook SDK version 5.9.0.

5.8.0.2

  • Fixed incorrect variable reference which caused a crash in certain scenarios when loading native ads.

Built and tested with:

  • Google Mobile Ads SDK version 19.1.0.
  • Facebook SDK version 5.8.0.

5.8.0.1

  • Added additional descriptive error codes and reasons for adapter load/show failures.
  • Updated the minimum required Google Mobile Ads SDK version to 19.1.0.

Built and tested with:

  • Google Mobile Ads SDK version 19.1.0.
  • Facebook SDK version 5.8.0.

5.8.0.0

  • Verified compatibility with Facebook SDK v5.8.0.
  • Updated the minimum required Google Mobile Ads SDK version to 19.0.1.

Built and tested with:

  • Google Mobile Ads SDK version 19.0.1.
  • Facebook SDK version 5.8.0.

5.7.1.1

  • Added support for Facebook Audience Network adapter errors.
  • Added descriptive error codes and reasons for adapter load/show failures.

Built and tested with:

  • Google Mobile Ads SDK version 18.3.0.
  • Facebook SDK version 5.7.1.

5.7.1.0

  • Verified compatibility with Facebook SDK v5.7.1.
  • Added support for Facebook Native Banner ads when using bidding.
  • Native ads now use 'Drawable' for the icon asset.

Built and tested with:

  • Google Mobile Ads SDK version 18.3.0.
  • Facebook SDK version 5.7.1.

5.7.0.0

  • Verified compatibility with Facebook SDK v5.7.0.

Built and tested with:

  • Google Mobile Ads SDK version 18.3.0.
  • Facebook SDK version 5.7.0.

5.6.1.0

  • Verified compatibility with Facebook SDK v5.6.1.
  • Updated the minimum required Google Mobile Ads SDK version to 18.3.0.

Built and tested with:

  • Google Mobile Ads SDK version 18.3.0.
  • Facebook SDK version 5.6.1.

5.6.0.0

  • Verified compatibility with Facebook SDK v5.6.0.
  • Updated Facebook Adapter to use AdChoicesView.

Built and tested with:

  • Google Mobile Ads SDK version 18.2.0.
  • Facebook SDK version 5.6.0.

5.5.0.0

  • Verified compatibility with Facebook SDK v5.5.0.

5.4.1.1

  • Fixed an issue that causes a crash when Native Ads are removed.

5.4.1.0

  • Verified compatibility with Facebook SDK v5.4.1.
  • Added support for Facebook Native Banner Ads for waterfall mediation.
    • Use setNativeBanner() from the FacebookExtras class to request for Native Banner Ads.
  • Fixed an issue that caused Smart Banner Ad requests to fail.
  • Fixed an issue where Rewarded Video Ads were not forwarding the onAdClosed() event in some cases where the app was backgrounded while the video was in progress.
  • Migrated the adapter to AndroidX.
  • Updated the minimum required Google Mobile Ads SDK version to 18.1.1.

5.4.0.0

  • Verified compatibility with Facebook SDK v5.4.0.

5.3.1.2

  • Fixed a bug where Facebook bidding failed to initialize due to "No placement IDs found".

5.3.1.1

  • Updated native RTB ads impression tracking.
  • Updated the minimum required Google Mobile Ads SDK version to 17.2.1.

5.3.1.0

  • Added bidding capability to the adapter for banner, interstitial, rewarded and native ads.
  • Verified compatibility with Facebook SDK v5.3.1.

5.3.0.0

  • Updated mediation service name for Google Mobile Ads.
  • Added adapter version to the initialization call.
  • Verified compatibility with Facebook SDK v5.3.0.

5.2.0.2

  • Added support for flexible banner ad sizes.

5.2.0.1

  • Updated adapter to support new open-beta Rewarded API.
  • Updated the minimum required Google Mobile Ads SDK version to 17.2.0.

5.2.0.0

  • Verified compatibility with Facebook SDK v5.2.0.

5.1.1.1

  • Updated the adapter to populate Advertiser Name for Unified Native Ads.

5.1.1.0

  • Replaced AdChoices View with AdOptions View.
  • Verified compatibility with Facebook SDK v5.1.1

5.1.0.1

  • Fixed an ANR issue caused by 'getGMSVersionCode()'.

5.1.0.0

  • Initialize Facebook SDK for each ad format.

5.0.1.0

  • Verified compatibility with Facebook SDK v5.0.1.

5.0.0.1

  • Updated the adapter to create the rewarded ad object at ad request time.

5.0.0.0

  • Verified compatibility with Facebook SDK v5.0.0.

4.99.3.0

  • Verified compatibility with Facebook SDK v4.99.3.

4.99.1.1

  • Fixed a bug where the Ad Choices icon is not shown for Unified Native Ads.
  • Fixed a bug where the adapter would throw an exception when trying to download images.

4.99.1.0

  • Verified compatibility with Facebook SDK v4.99.1.

4.28.2.1

  • Updated the adapter to invoke the onRewardedVideoComplete() ad event.

4.28.2.0

  • Verified compatibility with Facebook SDK v4.28.2.

4.28.1.1

  • Fixed an issue where clicks are not being registered for Unified Native Ads.

4.28.1.0

  • Verified compatibility with Facebook SDK v4.28.1.

4.28.0.0

  • Verified compatibility with Facebook SDK v4.28.0.

4.27.1.0

  • Verified compatibility with Facebook SDK v4.27.1.

4.27.0.0

  • Verified compatibility with Facebook SDK v4.27.0.

4.26.1.0

  • Verified compatibility with Facebook SDK v4.26.1.
  • Updated the Adapter project for Android Studio 3.0

4.26.0.0

  • Added support for rewarded video ads.
  • Added support for native video ads.
  • Verified compatibility with Facebook SDK v4.26.0.

4.25.0.0

  • Fixed an issue where incorrectly sized banners were being returned.
  • Updated the adapter's view tracking for native ads to register individual asset views with the Facebook SDK rather than the entire ad view. This means that background (or "whitespace") clicks on the native ad will no longer result in clickthroughs.
  • Verified compatibility with Facebook SDK v4.25.0.

4.24.0.0

  • Verified compatibility with Facebook SDK v4.24.0.

4.23.0.0

  • Verified compatibility with Facebook SDK v4.23.0.

4.22.1.0

  • Verified compatibility with Facebook SDK v4.22.1.

4.22.0.0

  • Updated the adapter to make it compatible with Facebook SDK v4.22.0.

4.21.1.0

  • Verified compatibility with Facebook SDK v4.21.1.

4.21.0.0

  • Verified compatibility with Facebook SDK v4.21.0.

4.20.0.0

  • Updated the minimum supported Android API level to 14+.
  • Verified compatibility with Facebook SDK v4.20.0.

4.19.0.0

  • Verified compatibility with Facebook SDK v4.19.0.

4.18.0.0

  • Verified compatibility with Facebook SDK v4.18.0.

4.17.0.0

  • Added support for native ads.

4.15.0.0

  • Changed the version naming system to [FAN SDK version].[adapter patch version].
  • Updated the minimum required FAN SDK to v4.15.0.
  • Updated the minimum required Google Mobile Ads SDK to v9.2.0.
  • Fixed a bug where Facebook's click callbacks for interstitial ads weren't forwarded correctly.
  • The adapter now also forwards onAdLeftApplication when an ad is clicked.

1.2.0

  • Fixed a bug that so that AdSize.SMART_BANNER is now a valid size.

1.1.0

  • Added support for full width x 250 format when request is for AdSize.MEDIUM_RECTANGLE

1.0.1

  • Added support for AdSize.SMART_BANNER

1.0.0

  • Initial release

Only Facebook And Google Will Load

Source: https://developers.google.com/admob/android/mediation/facebook

Posted by: crewsmistne.blogspot.com

0 Response to "Only Facebook And Google Will Load"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel