Page Summary
-
This guide details using the Google Mobile Ads SDK with Unity Ads mediation for waterfall integrations on iOS.
-
The mediation adapter supports both bidding and waterfall integrations, as well as banner, interstitial, rewarded, and native ad formats.
-
Requirements include an iOS deployment target of 12.0 or higher, the latest Google Mobile Ads SDK, and completing the mediation Get started guide.
-
Setting up involves configuring settings in the Unity Ads UI, such as creating a project, ad units, and placements, and setting up demand in the Ad Manager UI by adding Unity Ads as a company and configuring ad unit mapping.
-
Proper implementation requires importing the Unity Ads SDK and adapter, implementing privacy settings for GDPR and US state regulations, and adding required code including SKAdNetwork integration.
This guide shows you how to use Google Mobile Ads SDK to load and display ads from Unity Ads using mediation , covering bidding and waterfall integrations. It covers how to add Unity Ads to an ad unit's mediation configuration, and how to integrate the Unity Ads SDK and adapter into an iOS app.
Supported integrations and ad formats
The mediation adapter for Unity Ads has the following capabilities:
Requirements
-
iOS deployment target of 13.0 or higher
-
[For bidding]: To integrate all supported ad formats in bidding, use Unity adapter 4.14.1.1 or higher ( latest version recommended )
-
Latest Google Mobile Ads SDK
-
Complete the mediation Get started guide
Step 1: Set up configurations in Unity Ads UI
Sign up or log in to Unity Ads.
Create a project
On the Unity Ads dashboard , navigate to Projectsand click New.

Fill out the form and click Createto add your project.

Navigate to Unity Ads Monetization, then click Get started.

In the New Projectmodal, select I will use Mediationand Google Admobfor Mediation Partner, then click Next.

Select the option for ad settings, then click Next.

Select your placement setup, then click Next.
Bidding

Waterfall

Fill out the form, then click Add project.

Take note of the Game ID.

Create ad units and placements
Navigate to Unity Ads Monetization> Placements, then select your project and click Add ad unit.

Enter an Ad unit name, then select your Platformand Ad format.

Navigate to Monetization> Placements, then click Add Ad Unit.

Enter an Ad Unit Name, then select your Platformand Ad Format.

Select Waterfallfor the Setup. Under Placement, enter the Placement name, GEO Taggingand Target.

Take note of the Placement ID.
Finally, click Add ad unitto save your ad unit and placement.
Locate Unity Ads Reporting API key
Bidding
This step isn't required for bidding integrations.
Waterfall
Navigate to the Unity Ads Monetization> API managementand take note of the API Keyin Monetization Stats API Access.

Then, navigate to the Unity Ads Monetization> Organization Settingsand take note of the Organization core ID.

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 Unity Ads, see setting up app-ads.txt for the first time
.
Turn on test mode
Test mode can be enabled from the Unity Ads dashboard . Navigate to Unity Ads Monetization> Testing.
You can force test mode for your app by clicking the edit button beside Apple App Store, enabling Override client test modeand selecting Force test mode ON (i.e. use test ads) for all devices.

Alternatively, you can enable test mode for specific devices by clicking Add Test Device.

Enter your test device details, then click Save.

Step 2: Set up Unity Ads demand in Ad Manager UI
Sign in to your Ad Manager account .
Add Unity Ads in Companies
Bidding
This step isn't required for bidding integrations.
Waterfall
Navigate to Admin> Companies, then click the New companybutton in the All companiestab. Select Ad network.

Select Unity Adsas the Ad network, enter a unique Nameand enable Mediation. Turn on Automatic data collection, and enter the API Key and Organization core ID obtained in the previous section.
You don't need to enter a Usernameor Password. Click Savewhen done.

Enable secure signal sharing
Bidding
Navigate to Admin> Global settings. Go to the Ad Exchange account settingstab and review and toggle on Secure signal sharing. Click Save.

Waterfall
This step isn't required for waterfall integrations.
Share secure signal on bid requests
Bidding
Navigate to Inventory> Secure Signals. Under Secure signals, search for Unity Adsand toggle on Enable app integration.

Click Save.
Waterfall
This step isn't required for waterfall integrations.
Allow secure signal sharing for SDK Bidding
Bidding
Navigate to Delivery> Demand channel settings. In the Default settingstab, toggle on Allow secure signal sharingfor SDK Bidding.

Click Save.
Waterfall
This step isn't required for waterfall integrations.
Configure Unity Ads bidding
Bidding
Navigate to Delivery> Bidders, and click Go to SDK Bidding.

Click New bidder.

Select Unity Adsas the bidder.

Click Continueto enable SDK Bidding for this bidder.

Click Done.
Waterfall
This step isn't required for waterfall integrations.
Configure ad unit mapping
Bidding
Navigate to Delivery> Bidders, and click Go to SDK Bidding.

Select the company for Unity Ads.

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 Game ID and Placement ID obtained in the previous section.
Finally, click Save.

Waterfall
Navigate to Delivery> Yield groupsand click the New yield groupbutton. Select your Mobile application.

Scroll down and click Add yield partner.

Select the company you created for Unity Ads in the previous section. Choose Mobile SDK mediationas the Integration type, iOSas the Platform, and Activeas the Status.
Enter the Game ID and Placement ID obtained in the previous section, and the Default CPMvalue. Click Save.

Note: Automatic data collection takes a few days to gather data before it can accurately calculate a Dynamic CPM value for a mediation network. Once the eCPM can be calculated, it is automatically updated on your behalf.
Add Unity Ads to GDPR and US state regulations ad partners list
Follow the steps in European regulations settings and US state regulations settings to add Unity Adsto the European and US state regulations ad partners list in the Ad Manager UI.
Step 3: Import the Unity Ads SDK and adapter
Use Swift Package Manager
Before you continue, you must have the minimum supported adapter version 4.16.0.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-unity.git -
In Dependency Rule, select Branch.
-
In the text field, enter
main.
Use CocoaPods
-
Add the following line to your project's Podfile:
pod 'GoogleMobileAdsMediationUnity' -
From the command line run:
pod install --repo-update
Manual integration
-
Download the latest version of the Unity Ads SDK , and link UnityAds.frameworkin your project.
-
Download the latest version of the Unity Ads adapter from the download link in the Changelog and link UnityAdapter.frameworkin your project.
Step 4: Implement privacy settings on Unity Ads 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.
In SDK version 2.0.0, Unity Ads added an API to support privacy settings. The following sample code shows how to pass this consent information to the Unity Ads SDK. Should you choose to pass consent information to the Unity Ads SDK manually, it is recommended that this code is called prior to requesting ads through the Google Mobile Ads SDK .
Swift
let
gdprMetaData
=
UADSMetaData
()
gdprMetaData
.
set
(
"gdpr.consent"
,
value
:
true
)
gdprMetaDat
.
commit
()
UnityAdsMediationSwiftSnip

