Page Summary
-
This guide explains how to integrate Meta Audience Network ads into an iOS app using Google Mobile Ads SDK mediation, focusing on bidding integrations.
-
Meta Audience Network supports bidding and various ad formats including Banner, Interstitial, Rewarded, Rewarded Interstitial, and Native.
-
To use Meta Audience Network with Google Mobile Ads mediation, you need to set up configurations in the Meta Audience Network UI and the Google Ad Manager UI.
-
Implementing privacy settings for EU consent/GDPR and US states privacy laws is required, and you must follow guidance from Meta's documentation for these regulations.
-
Integrating the Meta Audience Network SDK and adapter into your project can be done using CocoaPods or manual integration, and additional code is required for Objective-C and to set the Advertising Tracking Enabled flag for iOS 14+.
This guide shows you how to use Google Mobile Ads SDK to load and display ads from Meta Audience Network using mediation , covering bidding integrations. It covers how to add Meta Audience Network to an ad unit's mediation configuration, and how to integrate the Meta Audience Network SDK and adapter into an iOS app.
Supported integrations and ad formats
The mediation adapter for Meta Audience Network has the following capabilities:
1 Meta Audience Network became bidding only in 2021.
Requirements
-
Latest Google Mobile Ads SDK .
-
Complete the mediation Get started guide .
-
iOS deployment target of 13.0 or higher
-
Meta Audience Network adapter 5.10.0.0 or higher ( latest version recommended )
-
The latest Meta Audience Network SDK usually requires the latest version of Xcode
Step 1: Set up configurations in Meta Audience Network UI
Sign up and log in to the Business Manager Start page .
Click Get startedthen Create new account.

Fill out the required fields with your business details and click Next.

Create a property
After you've filled out the required information, you're prompted to create a property for your app. Enter the desired name of the property for your app and click Next.

Next, select your platform to monetize.

Add your app details and click Next.

Set up your payment account by clicking Add a new payment account. You will be redirected to a new page to enter your payment information. Fill out the necessary details, then click Next.

Select Google AdMobas the Mediation platform, then click Create placement.

Select a format, fill out the form and click Create.

Take note of the Placement ID.

Click Done.
Update your app-ads.txt
Authorized Sellers for Apps app-ads.txt
is an IAB Tech Lab initiative that helps ensure your
app ad inventory is only sold through channels you've identified as authorized. To prevent a
significant loss in ad revenue, you'll need to implement an app-ads.txt
file.
If you haven't done so already, create an app-ads.txt file for Ad Manager
.
To implement app-ads.txt
for Meta Audience Network, see Identifying Authorized Sellers with app-ads.txt
.
Turn on test mode
See the Testing Audience Network Implementation guide for detailed instructions on how to enable Meta Audience Network test ads.
Step 2: Set up Meta Audience Network demand in Ad Manager UI
Sign in to your Ad Manager account .
Enable secure signal sharing
Navigate to Admin> Global settings. Go to the Ad Exchange account settingstab and review and toggle on Secure signal sharing. Click Save.

Share secure signal on bid requests
Navigate to Inventory> Secure Signals. Under Secure signals, search for Facebookand toggle on Enable app integration.

Click Save.
Allow secure signal sharing for SDK Bidding
Navigate to Delivery> Demand channel settings. In the Default settingstab, toggle on Allow secure signal sharingfor SDK Bidding.

Click Save.
Configure Meta bidding
Navigate to Delivery> Bidders, and click Go to SDK Bidding.

Click New bidder.

Select Metaas the bidder.

Click Continueto enable SDK Bidding for this bidder.

Click Done.
Configure ad unit mapping
Navigate to Delivery> Bidders, and click Go to SDK Bidding.

Select the company for Meta Audience Network.

Go to the Ad unit mappingtab and click New ad unit mapping.

Choose Specific ad unit. Select an ad unit and format, Mobile appas the Inventory type, and your Mobile application. Then, enter Placement ID obtained in the previous section.
If you are configuring ad unit mapping for a rewarded interstitial ad within the Ad Manager UI, choose the Rewardedformat and use the rewarded interstitial placement ID.
Finally, click Save.

Add Meta to GDPR and US state regulations ad partners list
Follow the steps in European regulations settings and US state regulations settings to add Metato the European and US state regulations ad partners list in the Ad Manager UI.
Step 3: Import the Meta Audience Network SDK and adapter
Use Swift Package Manager
Before you continue, you must have the minimum supported adapter version 6.20.1.0.
To add a package dependency to your project, follow these steps:
-
In Xcode, navigate to File > Add Package Dependencies....
-
In the prompt that appears, search the following package URL:
https://github.com/googleads/googleads-mobile-ios-mediation-meta.git -
In Dependency Rule, select Branch.
-
In the text field, enter
main.
Use CocoaPods
-
Add the following line to your project's Podfile:
pod 'GoogleMobileAdsMediationFacebook' -
From the command line run:
pod install --repo-update
Manual integration
-
Download the latest version of the Meta Audience Network SDK for iOS and link
FBAudienceNetwork.frameworkin your project. -
Download the latest version of the Meta Audience Network adapter from the download link in the Changelog and link
MetaAdapter.frameworkin your project.
Step 4: Implement privacy settings on Meta Audience Network SDK
EU consent and GDPR
To comply with Google EU User Consent Policy , you must make certain disclosures to your users in the European Economic Area (EEA), the UK, and Switzerland, and obtain their consent for the use of cookies or other local storage where legally required, and for the collection, sharing, and use of personal data for ads personalization. This policy reflects the requirements of the EU ePrivacy Directive and the General Data Protection Regulation (GDPR). You are responsible for verifying consent is propagated to each ad source in your mediation chain. Google is unable to pass the user's consent choice to such networks automatically.
Meta isn't registered on the IAB Europe Global Vendor List (GVL). Instead, you must use the Additional Consent technical specification. For more details, see Components of the Additional Consent . The Additional Consent specification works in conjunction with IAB Europe Transparency & Consent Framework (TCF) version 2. This specification lets you, along with their Consent Management Platforms (CMPs) and partners, collect and transmit supplementary consent signals for companies listed on the Google Ad Tech Providers (ATP) list, but are not yet part of the IAB Europe GVL.
Follow the guidance in Meta's documentation for GDPR and Meta advertising.
US states privacy laws
US states privacy laws require giving users the right to opt out of the "sale" of their "personal information" (as the law defines those terms), with the opt-out offered through a prominent "Do Not Sell My Personal Information" link on the "selling" party's homepage. The US states privacy laws compliance 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.
Follow the guidance in Meta's documentation for data processing options for users in California.
Step 5: Add required code
Compile errors
Swift
No additional code required for Swift integration.
Objective-C
For Meta Audience Network adapter 6.9.0.0 or higher, you must follow the steps below to add Swift paths to your target's Build Settings to prevent compile errors.
Add the following paths to the target's Build Settingsunder Library Search Paths:
$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)
$(SDKROOT)/usr/lib/swift
Add the following path to the target's Build Settingsunder Runpath Search Paths:
/usr/lib/swift
Advertising tracking enabled
If you are building for iOS 14 or later, Meta Audience Network requires that you explicitly set their Advertising Tracking Enabled flag using the following code:
Swift
// Set the flag as true.
FBAdSettings
.
setAdvertiserTrackingEnabled
(
true
)
Objective-C
// Set the flag as true.
[
FBAdSettings
setAdvertiserTrackingEnabled
:
YES
];
SKAdNetwork integration
Follow Meta Audience Network's documentation
to add the SKAdNetwork identifiers to your project's Info.plist
file.
Step 6: Test your implementation
Enable test ads
Make sure you register your test device for Ad Manager and enable test mode in Meta Audience Network UI.
Verify test ads
To verify that you are receiving test ads from Meta Audience Network, enable single ad source testing in ad inspector using the Meta Audience Network (Bidding)ad source(s).
Optional steps
Native ads
Some Meta Audience Network native ad
assets do not map one-to-one to Google native ad assets. Such assets are passed
back to the publisher in the extraAssets
property of GADNativeAd
. The
adapter supports passing the following assets:
GADFBSubtitle
GADFBSocialContext
Here's a code example showing how to extract these assets:
Swift
let
socialContext
=
nativeAd
.
extraAssets
?[
GADFBSocialContext
]
as
?
String
.
swift

