This guide is intended for publishers who want to use the Google Mobile Ads SDKto load and display ads from MoPub viamediation. It covershow to add MoPub to an ad unit's mediation configuration, and how to integratethe MoPub SDK and adapter into a Unity app.
Supported ad formats and features
Have a 2D, 3D, VR, or AR project that needs cross-platform functionality? Whether you’re a hobbyist, professional, or enterprise business, we can help! Take a look at the Unity real-time dev platform. Unity Web Player, free download. Unity Web Player 2019.1.7: The Unity Web Player enables you to view blazing 3D content created with Unity directly in your browser, and updates as necessary.Unity allows you to build rich 3D games with animated characters, sizzling graphics, immersive physics.
The AdMob mediation adapter for MoPub has the following capabilities:
Requirements
Step 1: Set up MoPub
First, sign up (if you haven't already) and log in to yourMoPub UI. Navigate to theApps page and click the Add a New App button.
Select the Platform for which you would want to set up Unity Ads. If yourapp supports both platforms (Android and iOS), you need to add yourapps separately for each platform.
Enter the Name of your app, Package name of your app, and select aprimary and secondary category of your app from the provided list.
MoPub requires you to create your first Ad Unit before completing theregistration of your app.
Note: To add an Ad Unit to an existing app, navigate to theApps page in the MoPub's UI and select the app forwhich you want to add the Ad Unit. On your app's details page, click theAdd an Ad Unit button.
For additional instructions on creating an ad unit, select the tab correspondingto your preferred ad format.
Banner
Choose Tablet as the Device type. Choose a banner format thatmatches the ad size you're requesting in your app. Enter a Name for yourAd Unit.
The refresh rate is handled by the Google Mobile Ads SDK according to yourrefresh rate setting in the UI. So, werecommend using a high value for the Refresh Interval here(e.g. 1000 seconds).
Note: The Banner size chosen here should match the request size in your app.The adapter ignores the size passed during the banner ad request.
Interstitial
Choose Tablet as the Device type. Choose Fullscreen Tablet asthe Format. Enter a Name for your Ad Unit. Choose the type ofLayout to present the ad in.
Click Save and View Code Integration to get your Ad Unit ID.
Note: To find your Ad Unit ID for an already existing ad unit, navigate tothe Apps page, select your ad unit under theAd Units section and click the Code Integration button.
We will use this Ad Unit ID to set up your AdMob Ad Unit ID for mediationin the next section.
MoPub Marketplace
To get ads from MoPub, your account needs to be approved for MoPub Marketplace.During your initial account setup, you will be prompted to go through theprocess for Marketplace approval. Part of this process includes entering yourpayment information.
See Marketplace setupfor more details.
Step 2: Configure AdMob Ad Unit
You need to add MoPub to the mediation configuration for your Ad Unit. Firstsign into the AdMob UI.
If you're deploying your Unity app to both Android and iOS, you need two AdMobad units, one for each platform.
Navigate to the Mediation tab. If you have an existing mediation groupyou'd like to modify, click the name of that mediation group to edit it,and skip ahead toAdd MoPub as an ad source.
To create a new mediation group, select Create Mediation Group.
Enter your ad format and platform, then click Continue.
Android
Give your mediation group a name, and select locations to target.Next, set the mediation group status to Enabled. Then clickAdd Ad Units, which will open up the ad unit selection overlay.
Associate this mediation group with your existing AdMob ad unit.Then click Done.
You should now see the ad units card populated with the ad units youselected.
iOS
Give your mediation group a name, and select locations to target.Next, set the mediation group status to Enabled. Then clickAdd Ad Units, which will open up the ad unit selection overlay.
Associate this mediation group with your existing AdMob ad unit.Then click Done.
You should now see the ad units card populated with the ad units youselected.
Add MoPub as an ad source
In the Ad Sources card, select Add Ad Network. Then selectMoPub.
Enable the Optimize switch. Enter the API Key andInventory Report ID obtained in the previous section to set up ANO forMoPub. Then enter an eCPM value for MoPub and click Continue.
Note: You only need to set up ANO once per network.
Enter the Ad Unit ID obtained in the previous section and click Done.
Finally, click Save.
Note: Ad network optimization takes a few days to gather data to accuratelycalculate eCPM for a mediation network. In the meantime, the ANO status will bePENDING, so you must manually set an eCPM value for the network. Once the eCPMcan be calculated, ANO will automatically start updating the eCPM on yourbehalf.
Using rewarded video ads
In the settings for your rewarded video ad unit, check the Apply to allnetworks in Mediation groups box so that you provide the same reward to theuser no matter which ad network is served.
If you don't apply this setting, the MoPub adapter passes back the rewardspecified in the MoPub dashboard.
For more information on setting reward values for AdMob ad units, seeCreate an ad unit.
Step 3: Import the MoPub SDK and adapter
Download the latest version of theGoogle Mobile Ads mediation plugin for MoPuband extract the
GoogleMobileAdsMoPubMediation.unitypackage from the zipfile.
In your Unity project editor, select Assets > Import Package > Custom Packageand find the
GoogleMobileAdsMoPubMediation.unitypackage file you downloaded. Make sure that all the files are selected and clickImport.
Step 4: Additional code requiredInitialize the MoPub SDK
Before loading ads, have your apps initialize the MoPub SDK. TheGoogle Mobile Ads mediation plugin for MoPubversion 2.3.1 includes the
MoPub.Initialize() method to initialize the MoPubSDK with any valid MoPub ad unit ID that you created inStep 1. This needs to be done only once,ideally at app launch.
Android
No additional code required.
iOS
No additional code required.
Step 5: Test your implementation
To get test ads from MoPub, you need a guaranteed or backfill line item. MoPubrecommends adding the Demo line item to your Ad Unit to get test ads. TheDemo line item is added to your MoPub account by default.
The Demo Line Item contains test creatives for native and banner ad units bydefault, but does not have a test creative for interstitial ad units. To addyour own test creative for interstitial ads, you need to upload a simple imageto the MoPub UI bynavigating to the Demo Line Item and clicking the Add a New Creative button.Choose Tablet Full Screen format. Fill the form with the necessary detailsand click Save to add your test creative to the Demo Line Item.
That's it! You now have a working mediation integration with MoPub.
Optional stepsEU Consent and GDPR
Under the Google EU User ConsentPolicy, you must ensure that certain disclosures are given to, andconsents obtained from, users in the European Economic Area (EEA) regardingthe use of device identifiers and personal data. This policy reflects therequirements of the EU ePrivacy Directive and the General Data ProtectionRegulation (GDPR). When seeking consent, you must identify each ad networkin your mediation chain that may collect, receive, or use personal data andprovide information about each network's use. Google currently is unable topass the user's consent choice to such networks automatically.
MoPub's Unity plugin offers APIs to help you collect consent for MoPub. Thefollowing steps explain how to import the MoPub Unity plugin in a way thatdoesn't conflict with the Google Mobile Ads mediation plugin forMoPub that you installed earlier.
Download the MoPub Unity pluginthat depends on the same MoPub iOS SDK version as the Google Mobile AdsMediation plugin:
After downloading the correct Mopub Unity plugin, selectAssets > Import Package > Custom Package in your Unity project editor andfind the
MoPubUnity.unitypackage file you downloaded. Make sure to uncheck thefollowing files from the MoPub/Plugins/Android folder:
Now that you installed the MoPub Unity plugin, you are ready to implement theirconsent solution. Please consult MoPub's guides for more information:
Android permissions
If the user's location needs to be used for the targeting, MoPub recommendsadding the following optional permission into your app's
AndroidManifest.xml file:
MoPub recommends adding the following optional permission for MRAID 2.0:
MoPub Unity Mediation Plugin ChangelogVersion 2.9.0
Version 2.8.0
Version 2.7.0
Version 2.6.0
Version 2.5.1
Version 2.5.0
Version 2.4.0
Version 2.3.1
Version 2.3.0
Version 2.2.0
Version 2.1.0
Version 2.0.0
Version 1.0.0
Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
January 2023
Categories |