Facebook

Create an Application in Facebook

1. Go to Facebook for developers and log in to your Facebook account.En-1.jpg

2. Click Getting Started (If there are other apps in your account, please skip to this step).En-2.jpg

3. Select Developer options.En-3.jpg

4. Click Create First App.En-4.jpg

If you already have other apps in your account, please click My Apps Add a New App.En-5.jpg

5. After filling in the relevant information, click Create Application ID.En-6.jpg

  • The app name associated with your app ID.
  • This email address is used to contact you about potential policy violations, app restrictions or steps to recover the app if it's been deleted or compromised.

6. If your app is already on the app store, please click SettingsBasic and fill in the relevant information.En-7.jpg

If your app is not yet available on the app store, please go to Facebook Audience Network app creation.
Please complete the relevant information here after your app is available.

7. click Add Platform at the bottom of the page.En-8.jpg

  • [iOS]fb_en_9.jpg
  • [Android] fb_en_10.jpg

Key hash:

Please execute this command in Mac: keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore | openssl sha1 -binary | openssl base64

Please execute this command in Windows:  keytool -exportcert -alias androiddebugkey -keystore %HOMEPATH%\.android\debug.keystore | openssl sha1 -binary | openssl base64

 
This command will generate a 28-character private key hash for your development environment. Please copy and paste the key hash into the space below. You need to provide the development key hash of the development environment for each staff member of the application.
 
If your application is published, you also need to add the hash of the publishing key.
 

Android apps must use the release key as a digital signature to upload to the app store. To generate a distribution key hash, execute the following command on Mac or Windows, replacing your distribution key alias and keystore path: keytool -exportcert -alias YOUR_RELEASE_KEY_ALIAS -keystore YOUR_RELEASE_KEY_PATH | openssl sha1 -binary | openssl base64

This will generate a string of 28 characters. Please copy and paste the string into the space below. Also, check the Android documentation to learn how to sign the app.

 

Facebook Audience Network Application Creation

1. On the Facebook for developer dashboard, click the Audience Network Set Up button.En-11.jpg

Please make sure you have selected the correct app on the top left.En-12.jpg

2. Choose to Start Now.fb_en_12.jpg

3. After selecting your business management platform, click Continue.

fb_en_14.jpg

4. After naming your app, click Next.fb_en_15.jpg

Assets are a concept proposed by Facebook Audience Network. If your product has different versions according to operating systems or devices, you can combine these versions into one asset for centralized management and performance reports.

Each asset can include iOS app, Android app, Instant Articles platform and Instant Games app.

Learn more.

5. Choose your application platform.En-16.jpg

You can add more platforms in the Monetization Manager, IntegrationsAssets.

6. If your app is already on the app store, please fill in the app store address. Facebook will conduct an app review. Your app needs to comply with Facebook Audience Network Policy and Facebook Community Standards before it can be approved; if your app is not yet on the app store, you can choose to test the app after it’s on the shelf and submit it to the app store The URL can be monetized using Facebook Audience Network.fb_en_17.jpg

You don’t need to check This app is using mediation.

 

Facebook Audience Network Placement

1. Select the Ad Placement you need to create.fb_en_18.jpg

Note that if you want to create a banner ad slot, please choose Banner instead of Native Banner. Learn more.

You can add more Placement or more Ad Spaces in Integration Properties.

Learn more.

En-19.jpgEn-20.jpg

 

Facebook Placement Price Setting

1. You can set a reserve price for a placement when you create or edit placement.En-21.jpgfb_en_22.jpg

Learn more.

 

OpenMediation Platform Configuration

Ad Network

1. Enter the OpenMediation publisher platform, click on Ad Network → click Edit behind Facebook.23.jpg

2. After filling in the relevant information, click Save.

FB____.png

  • App ID: Please select the first half of the underscore parameter in your Unit ID
    • For example: your Unit ID is: 636435993620146_636462546950824, then your App ID please fill in 636435993620146.
  • System User Access Token: You need to enter the Business Management Platform to set up a login account, and complete the following steps to obtain it.

 

Create system user

a. Click on the System Users and select Add.

If you already have a system user, please skip to Adding a system user to the corresponding application.En-25.jpg

b. Enter the system user name and select the identity as the Admin.En-26.jpg

 

Add system users to the corresponding application

a. Click Account → Apps → Select the corresponding application → Add People.En-27.jpg

b. Select the created System User and grant management application permissions.En-28.jpg

 

Add system users to corresponding properties

a. Click Data SourcesProperties → Select the corresponding asset → Add People.En-29.jpg

b. Select the created system user and click Manage Property.En-30.jpg

 

Generate Token

a. Click on System Users in the left navigation bar → Guide System UserGenerate New Token.En-31.jpg

b. After selecting the corresponding application, check read_audience_network_insights, and click Generate Token. 

fb_en_30.jpg

c. Copy the Token and paste it to the OpenMediation platform System User Access Token.En-33.jpg

 

Add Instance

1. Click Mediation → Ad unitAdd Instance.En-34.jpg

2. After filling in the relevant information, click Save.En-35.jpg

  • Ad NetwrokSelect Facebook.

  • Instance Name: You can define the name of your ad unit yourself, we suggest you name it: Placement ID_Ad Network Name_ Country_Floor Price. (E.g: 6539_FB_USA_40)

  • Unit ID:You can obtain the AdUnit ID in the Monetization Manager.En-36.jpg

 

Facebook Test Mode

It is very important to enable the test mode for testing. We recommend that you test in the following ways before the app is released to avoid violating the Facebook Audience Network Policy and causing your app to not be able to monetize normally using Facebook Audience Network.

1. Go to theMonetization Manager, click Integration Testing.En-37.jpg

2. Enable testing for your devices And Use real advertiser content.

fbt1.png

3. Add test devices.

En-38.jpg

4. Choose Ad Type.

fbt3.png

fbt4.png

 

Facebook iOS 14+ Settings

If you are using FBAudienceNetwork Version 6.2.1+, and building for iOS14+, you must to set the setAdvertiserTrackingEnabled flag. This allows you to inform Facebook whether to use the data to deliver personalized ads. If the flag is set to false Facebook will not be able to deliver personalized ads.

Please note that setting the setAdvertiserTrackingEnabled flag should be done before initializing OpenMediation SDK. Learn more about Advertising Tracking Enabled for Audience Network here.

 

Add the Facebook SDK&Adapter to Your Build

Android

1. Add the Facebook SDK

  •   Add to your application-level build.gradle file inside dependencies section.
implementation 'com.facebook.android:audience-network-sdk:+'

2. Add the Facebook Adapter

    OpenMediation supports both Gradle dependencies and Manual download mechanisms.

       Gradle dependencies

  • Add the following in your application-level build.gradle file inside dependencies section.
implementation 'com.openmediation.adapters:facebook:+'

       Manual download

  • Download the Facebook Adapter from here.
  • Add the Facebook Adapter to Your Project.

In addition, publishers may be needed to include the following in their network security config file.

<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<domain-config cleartextTrafficPermitted="true">
<domain includeSubdomains="true">127.0.0.1</domain>
</domain-config>
</network-security-config>

And update AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest...>
<application android:networkSecurityConfig="@xml/network_security_config">
...
</application>
</manifest>

For more information on Facebook network security configuration check Network Security Config.

3. For Proguard Users Only

If you are using ProGuard with the Facebook adapter, you must add the following code to your ProGuard configuration (Android Studio: proguard-rules.pro or Eclipse: proguard-project.txt):

-keep class com.facebook.ads.** { *; }

 

iOS

OpenMediation supports both Cocoapods and Manualdownload mechanisms.

Cocoapods

To Integrate the Facebook SDK with Cocoapods, enter the following line in your podfile and you are good to go!

pod 'FBAudienceNetwork'

Manual Download

1. Download the Facebook framework

  • you can find the lastest Facebook SDK here.

2. Add the Facebook frameworks to your Project

3. Under the General tab in the application target settings, select Embed and Sign for FBAudienceNetwork.xcframework.

262056455_188100090198428_3835747580846516375_n.png

Done!
You are now all set to deliver Facebook Audience Network Ads through theOpenMediation platform!

Was this article helpful?
5 out of 6 found this helpful

Comments

0 comments

Article is closed for comments.