MoPub Ad Tag

This page will demonstrate how to set up the Smaato Ad Tag to MoPub using the network integration setup process.

  • When using MoPub as your primary ad server, we recommend you to use Smaato SDK for seamless integration.
  • In order to use our AdTag inside MoPub, you need to request it synchronously, i.e., set the sync parameter to true
  • When using our AdTag inside MoPub in applications running on iOS 10, you need to add the “Allow Arbitrary Loads in Web Content” key in the info.plist file in order to allow non-secure creatives to render

Beginning With SPX

Log Into Your SPX Account

If you have not already, you will first need to create an account in SPX

https://spx.smaato.com

Create Your Apps and Adspaces in SPX

To create your app, go to inventory and then click the +New App button of the right side of the page.

When you create a new app in SPX you will need to add the following details mandatory information is indicated with a (*).

  • Name your app with the appropriate name.
  • A description is optional, but here you can enter special details about your app.
  • Add the store download URL (ie., for your app on the App Store or Google Play).
  • Set the app category similarly set in the store.
  • Check the box for COPPA.
  • You then can define your adspace or multiple adspaces.
    • Add the adspace name
    • Add the ad format type
    • Add the dimension
    • Ad position and category are optional
  • Once you have defined all of you adspaces, simply click save.
  • You will then receive a confirmation of “App Created Successfully.”
  • Here, you can click “Done” and you will return to the Inventory dashboard.

Create Your Line Items

  • Next, you will need to create your line item/s by going to Smaato Exchange tab and clicking on the +New Line Item button on the right hand side of the page next to Edit Settings.
  • Add the name and the floor price by choosing a minimum eCPM in US Dollars.
  • Now, scroll down to the targeting section to choose the inventory (apps/adspaces) you want this line item to send ads to.
  • From the inventory targeting section simply select the options you want clicking +Add, and the item will then be added to the Inventory Targeting Summary on the right side.
  • Once you have the inventory selected, click Save.

Pause the Default Line Item

  • Next, you will need to pause the default line item by going into Smaato Exchange and click on the status button (default is set at running).
  • Click on the green play button, and this will pause the line item, displaying a red pause sign.

Create an Ad Tag for Each Adspace

Use the following Ad Tag snippet to traffic the Smaato Ad Tag from within your MoPub instance. If you have created multiple adspaces, you will need to double check the Publisher ID, Adspace ID, and dimension for each of the adspaces that you have created.

<div id="smaatoad" style="padding:0px"></div>
<script type="text/javascript" src="https://soma-assets.smaato.net/js/smaatoAdTag.js"></script>
<script>
    function callBackForSmaato(status){
        console.log("callBack was called with status : " + status);
        if (status == "ERROR"){
            loaded= true;
            window.location="mopub://failLoad";
        }
    };
    SomaJS.loadAd({
        adDivId: "smaatoad",
        publisherId: REPLACE_WITH_PUBLISHER_ID,
        adSpaceId: REPLACE_WITH_ADSPACE_ID,
        did: "%eudid!", // Android and iOS
        diddnt: ("%%DNT%%" == "1"),
        keywords: "%%KEYWORDS%%",
        latitude: "%%LATITUDE%%",
        longitude: "%%LONGITUDE%%",
        sync: true,
        cb: "%%CACHEBUSTER%%",
        dimension: "xxlarge"
    },callBackForSmaato);
</script>

Add the Publisher ID, Adspace ID, and Dimension

You will then need to add the following macros into the code snippet with the correct details for each of the adspaces that you have created:

  • publisherID
  • adspaceID
  • dimension

Next, scroll down to the Ad Tag integration options.

Use the Adspace drop-down to select the adspace that you created in the previous steps.

Then scroll down to the ‘Copy to Clipboard’ section where you will find the Publisher ID along with the Adspace ID and dimension that is selected for each of the adspaces that you create.

On the MoPub Side

Create Apps and Ad Units in MoPub

After logging into MoPub, you will then need to use the MoPub dashboard to create your new app.

  • Follow the steps for creating a new app by using the App Store drop-down and selecting your app in one of the app stores.
  • If your app settings are accurate, select Save & create ad units.

Now create your ad unit.

  • Name your ad unit.
  • Select device type.
  • Select the ad format type.
  • We recommend to leave the default frequency caps and refresh interval as is.
  • Then, save the ad unit.

Once you have saved your new ad unit, you will see the message for code integration… you close this for now and go straight to the Orders tab.

On the MoPub Side

Adding MoPub Line Items in Orders

We recommend connecting your Line Items using the following ‘Orders’ method as opposed to a previous method of connectiong through ‘Networks’ in MoPub. Using the Orders method will insure the best performance

Now you will need to create your Line Items.

Important Note: For best performance, it is recommended to create identical Line Items inside both the Smaato and MoPub ad servers.

To create new Line Items, click on the button for New Order. You will then be directed to the New Order creation window.

  • First you will align the order with the appropriate.
  • You will also set Smaato as the Advertiser.
  • Then you will Save & Create Line Item


When creating your Line Item it is important to use the same name as the Line Item setup in SPX to avoid confusion.

  • You will need to select the Order Name
  • Then Line Item name
  • Next, it is very important to select Non-Guaranteed in the Type & Priority dropdown selection.
  • By default the priority is set at 12. You can leave it at the default.

Please Note: For best performance, it is important to match the Line Items in MoPub and Smaato with the same prices, i.e. if you created a Line Item in Smaato with a price of $0.50 you will want to have the same price in MoPub.

That being said, you then need to:

  • Set the CPM Rate
  • For the schedule we recommend checking the box to Start Immediately
  • After this you can Save and move on.

Next, set the targeting for the ad units that you just created.

In the ‘All Orders’ section, select the app and the ad units from the list and click Next.

Please Note: If you have a long list of apps, you can use the search feature or the filter options to find the correct apps and ad units.


For Audience Targeting it is highly recommended to select the exact same targeting options that you have set in SPX.

  • If you wish to leave the targeting at default, you just need to Save.

Now you will need to add the Creative for the ad unit.

  • Add the name of the Creative
  • Add the dimension
  • Select HTML
  • Add the HTML creative
  • Lastly, please make sure to check the box for MRAID Ad.
  • (This will ensure better performance in the ad delivery.)

The last thing you need to do is to check the order and the Line Items that you created and if they match those created in SPX.

  • In the Orders Tab, select the order that you created.
  • From here, you will see all of the Line Items.
  • Check the Status
  • Check if Enabled
  • Check if Priority matches the Smaato Priority.
  • Check if the CPM Rate matches the Line Items created in SPX.

If all of your Line Items match, you have now finished creating the Smaato Ad Tag integration with MoPub.


Important Reminders:

For best performance in the monetization of your mobile application there are few highlights to make a note in the Ad Tag to MoPub integration:

  • Double check that you have the correct publisherID, adspaceID and dimension for each of the Adspaces in Smaato SPX.
    1. Side Note: Do not use this entire snippet to copy and paste to MoPub, as this will cause major errors. All you need are the publisherID, AdspaceID, and the dimension.

  • Next it is important to make sure that the Line Item targeting and CPM price options match in both ad servers. (the Smaato SPX platform and the MoPub platform)
  • Also make sure to select Non-Guaranteed for

    Type & Priority in the New Line Item section in MoPub.

  • There are also two very important checkboxes in MoPub:
    1. Make sure to select the option to ‘start immediately’ in the Budget & Schedule section,
      Also make sure to select the option for ’MRAID ad’ in the New Creative section

For further assistance, please contact your Smaato Account Manager or contact support by going to https://www.smaato.com/support/

Modified: November 6, 2019 at 6:42 pm