Mars SDK - AppLovin AdOps

Create Custom Network

To incorporate the Mars SDK into your AppLovin monetization setup, enable the Mars SDK ad network and add it to the appropriate ad units.

Here are the steps to follow:

Navigate to your AppLovin dashboard and select Networks tab.

Locate Click here to add a Custom Event button and click it.

Fill the Custom Network Name field. In thw iOS Adapter Class Name field set value - MediafyAppLovinAdapter. Click Save.

Add Placements to Ad units

Navigate to your AppLovin dashboard and select Ad Units tab.

Click Create ad unit.

Fill Name field. Choose iOS option in Platform section and add your app's bundle ID. Choose an appropriate Ad Type option.

Configure Mars Placements

Locate Custom Networks section. Set Status switch on. Add values for:

  • Placement ID - the name of the placement.
  • CPM Price - price for this custom network.
  • Custom parameter - custom JSON parameter with configuration. It differs for different ad formats (banner, interstitial, native). See the details in the following section.

Click Save.

Custom Parameters

You can provide custom parameters via Parameter field during custom event setup. For that you should pass a valid JSON structure with desired values.

Attribute Type Description Example
ad_formats Array of strings Ad formats for ad unit. You can pass only banner and video ad formats. Other values will be ignored. Note that multiformat request is supported only for interstitial ads. ["banner", "video"]
ad_unit_id String Ad unit ID. The value will be passed in imp[].ext.mediafy.adunitid field in the ad request. "56maxa"
sizes Array of objects Ad sizes for ad unit. You can specify width in w field and height in h field. Make sure you've provided both width and height values. [{ "w": 320,"h": 480},{"w": 1024,"h": 768}]

Ensure you provide sizes for your ad unit in code or via settings on the publisher's UI. It's a critical property.

Examples:

Banner Ad
{
  "ad_formats": [
    "banner"
  ],
  "sizes": [
    {
      "w": 300,
      "h": 250
    }
  ],
  "ad_unit_id": "56maxa"
}
Video Ad
{
  "ad_formats": [
    "video"
  ],
  "sizes": [
    {
      "w": 300,
      "h": 250
    }
  ],
  "ad_unit_id": "56maxa"
}
Multisize Banner Ad
{
  "ad_formats": [
    "banner"
  ],
  "sizes": [
    {
      "w": 300,
      "h": 250
    },
    {
      "w": 320,
      "h": 50
    }
  ],
  "ad_unit_id": "56maxa"
}
Multisize Video Ad
{
  "ad_formats": [
    "banner"
  ],
  "sizes": [
    {
      "w": 300,
      "h": 250
    },
    {
      "w": 320,
      "h": 50
    }
  ],
  "ad_unit_id": "56maxa"
}
Banner Multisize Interstitial Ad
{
  "ad_formats": [
    "banner"
  ],
  "sizes": [
    {
      "w": 320,
      "h": 480
    },
    {
      "w": 1024,
      "h": 768
    }
  ],
  "ad_unit_id": "56maxa"
}
Video Multisize Interstitial Ad
{
  "ad_formats": [
    "video"
  ],
  "sizes": [
    {
      "w": 320,
      "h": 480
    },
    {
      "w": 1024,
      "h": 768
    }
  ],
  "ad_unit_id": "56maxa"
}
Multiformat Interstitial Ad
{
  "ad_formats": [
    "banner",
    "video"
  ],
  "sizes": [
    {
      "w": 320,
      "h": 480
    }
  ],
  "ad_unit_id": "56maxa"
}
Multiformat Multisize Interstitial Ad
{
  "ad_formats": [
    "banner",
    "video"
  ],
  "sizes": [
    {
      "w": 320,
      "h": 480
    },
    {
      "w": 1024,
      "h": 768
    }
  ],
  "ad_unit_id": "56maxa"
}

Contact us today

to enjoy endless opportunities!

Contact Us
+

Contact Us