MoPub Network 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

Networks (previously used setup process)

Add the Custom JavaScript Network

Next, you need to add the custom javascript network using the adjusted Smaato snippet (as provided above).

In MoPub, navigate to the section:

  • Networks
    • Select New Network
    • Scroll down to custom networks
    • Select Custom JavaScript network

Next, you will be taken to the Add Custom Network forms.

  • Add the name of the network and then click next.
  • Next, you will see the display section for the default CPM price.
  • Simply click Next and move on to the app and ad units section.

Now you need to add the AdTag snippet with the correct Publisher ID, Adspace ID, and dimension for each of the adspaces that you have created in SPX and matching those created here in MoPub.

Here’s how you can quickly locate the macro details for the custom snippet:

  • Go back to SPX
  • Go to Menu > Integration options > AdTag
  • Select each of the adspaces from the drop-down
  • Inside the script code provided, you will find Publisher ID, Adspace ID, and dimension.

Enable Ad Units in MoPub

Next, you will need to enable global segments in MoPub:

  • Go to Segments > Global (default)
  • For each app’s ad units, click on the switch to enable the ad units.
  • From this point, it would be best to double check if the eCPM floor prices in MoPub match those set in SPX. If not, you can adjust now.

At this stage, you have successfully completed the process of creating the AdTag MoPub integration.

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

Modified: July 15, 2019 at 11:09 am