The purpose of this article is to guide publishers who want to use the Fyber FairBid SDK to load and display ads from Facebook Audience Network (FAN) via FairBid Mediation.
Facebook Audience Network (FAN) is transitioning to support bidding-only Instances. New FAN Instances can be created only for Android apps which already had FAN Instances prior to 31 May 2021. For these apps, all FAN Instances must be migrated to Facebook Bidding by 30 September 2021.
Any iOS FAN Instances and Android Instances of apps with no FAN Instances prior to 31 May 2021, will not respond in waterfalls in which they participate.
This is a six-step process:
- Create or login to your Facebook Audience Network account
- Create an app in Facebook Audience Network
- Create a placement for your app
- Retrieve the parameters from the Facebook dashboard
- Insert the Facebook parameters into the Fyber Console
- Adding the Facebook Audience Network SDK to your integration
Facebook currently supports the following ad formats:
- Rewarded Videos
Refer to Facebook for updates on supported ad formats.
Step 1: Create or login to your Facebook Audience Network Account
Follow these steps for creating a Facebook account.
If you are a new user:
- Go to Facebook for Developers and register with your Facebook account.
- Follow the instructions and set your application name.
- Click Register.
If you are already registered:
- Sign in to your Facebook account
- Click My Apps in the top right corner and select your app.
Creating a Business
You can manage your business on Facebook including Facebook advertising and Audience Network monetization. Facebook Manager is a more secure way to manage your Pages and ad accounts. You can see who's working on what and what they have access to see and work on.
- Go to Facebook Manager
- Click Create Business
- Enter your details and click Next
- Enter your business details and click Submit.
Facebook's Monetization Manager is a platform to help you grow your business with Audience Network. It helps you manage your placements, understand your performance and maximize your revenue.
- Go to Monetization Manager, here.
- Login with your credentials.
- Click the business you just created or create a new business, as described above.
- Scroll down and click +Create Property
- Enter the name of the new property
- Click Create Property to continue.
Selecting Your Platform and Display Format
Platforms are the different products you can monetize with Audience Network. Once you have created your property your next step is to add the platform you want to monetize.
- Click +Add on the platform you want to work with
- Complete the details
- Click Submit.
Creating an Ad Space
An Ad Space helps you organize ad placements to reflect what a person is doing when they see an ad in your app. To create an ad placement, you’ll need to create an Ad Space first. You can create up to 4 Ad Spaces per platform.
- On the Monetization Manager left tool bar go to Integration >> Properties >> Select a property
- Click +Create Ad Space
- Enter a name for the Ad Space
- Upload a file and description of when your ad is to be triggered.
- Click Create Ad Space.
Now you have created your Ad Space, you can create ad placements by clicking on the edit icon and Create placement.
- Click the menu bar on the window and select Create Placement
Step 3: Creating a Placement for your Add
Facebook Audience Network offers different types of ad units. Each ad unit in your app is identified using a unique placement ID.
The Create Placement window is displayed:
- Enter a Placement Name
- Select the display format for your your ad placement.
- Scroll down and complete the Price Settings details
- Click Create Placement
An ad placement can only be used by one Ad Space and must match the same platform as the Ad Space.
Adding Placements to your App
Once you have click on Create Placement, the details of your placement are displayed:
Click Get Code or Copy ID
Your app cannot receive Audience Network ads until payout information is added and it has been sent for review.
Step 4: Retrieve the parameters from the Facebook dashboard
To enable Facebook to as an Ad Network with Fyber, you must obtain three parameters from your Facebook account and later insert them into the Fyber dashboard.
Set out below are the details of what parameters are required, how and where to obtain them.
|App ID||The unique identifier of your app in Facebook Audience Network’s system.|
|System User Access Token||This is the most commonly used type of token. This kind of access token is required any time the app calls an API to read, modify or write a specific person’s Facebook data on their behalf.|
|Placement ID||The unique identifier of a specific placement in your app in Facebook Audience Network’s system.|
Alternatively, watch and listen to the video below to find out how to obtain the required parameters:
Retrieving the App ID
To retrieve your App ID, follow these steps:
- In the dashboard of your Facebook account, in the left hand menu bar, click App Dashboard
- The App Dashboard is displayed and the App ID appears twice:
Retrieving the System User Access Token
To retrieve your System User Access Token, follow Facebook’s Guide.
At Step 3. make sure you check read_insights as well as read_audience_network_insights in Available Scopes.
Retrieving the Placement ID
To retrieve your Placement ID:
- Click Audience Network on the left sidebar in the dashboard
You are asked to navigate to Monetization Manager, click the link:
Under your application review you find a list of your placements, click the one you want to retrieve its Placement ID
Now that you have obtained this information, you can complete the configuration of Facebook's Parameters in your Fyber Account.
Step 5: Insert the Facebook Parameters into the Fyber Console
To enter the parameters obtained from Facebook and insert them into the Fyber Console, follow these steps.
- Sign-in to your Fyber account.
- Select your app from the App Management window.
- On the App Management page, click Mediated Networks.
- Select Facebook from the list
The Facebook Mediation window opens:
- Enter the Facebook app credentials and set the Instance name.
Instance name should be distinguishable in case you have multiple Facebook Instances.
- For each ad format, enter the Instance Name and Placement ID.
- Click Save.
- To complete the set up, you must associate the network instance that you just created to the relevant Placement set up on the Fyber dashboard. For a detailed guide click here.
You have now successfully integrated Facebook into the console.
Step 6: Adding the Facebook Audience Network SDK to your Integration
To add the Facebook Audience Network SDK go to the Supported Networks page and follow the guide while selecting the Configuration for Facebook.
Targeting Android P
When targeting Android P and using video ads, you must add an exception rule to 'localhost' found in your apps Network Security Configuration.
- Make the Network Security Configuration xml with the code below:
<?xml version="1.0" encoding="utf-8"?> <network-security-config> <base-config cleartextTrafficPermitted="true"> <trust-anchors> <certificates src="system" /> </trust-anchors> </base-config> <domain-config cleartextTrafficPermitted="true"> <domain includeSubdomains="true">127.0.0.1</domain> </domain-config> </network-security-config>
- Modify your manifest of your app to point to this file.
The following code is an example of how to create this entry:
<?xml version="1.0" encoding="utf-8"?> <manifest ... > <application android:networkSecurityConfig="@xml/network_security_config" ... > ... </application> </manifest>
More information can be found here.
Add the following frameworks to your project,
Add the libxml2.tbd and libc++.tbd lib to the target by clicking the application target -> Build Phases -> Link Binary With Libraries.
Facebook Audience Network iOS 14 Guidelines
Facebook provides additional guidelines for the measures required by you to prepare for iOS 14. For further details, click here.