Mars SDK - AdMob AdOps

This guide helps you to configure the AdMob account to add Mediafy as a Monetization partner.

Create Ad Unit

This step is optional if you already have an ad unit that you want to monetize with Mars.

Sign in to your AdMob account at https://apps.admob.com. Create an app if you haven't done this already. Click Apps and then Add app.

Choose platform and whether your app is listed on a supported app store.

Add app name and click Add app.

Create an ad unit. To do this, select your app from the app list, click onAd units and then on Get started.

Choose the type of ad unit and click Select.

Fill Ad unit name and tune other settings if needed. Click Create ad unit.

Create Mediation Group

To add Mars to the waterfall, you need to create a custom event in your AdMob account and then add this event to the respective mediation groups.

To create a Mars custom event, follow the instructions:

Create a mediation group.

Select ad format and platform.

Fill the Name field. Click Add ad units.

Select ad units and click Done.

Create Custom Event

Locate the Waterfall section and click Add custom event.

Fill the Label field and Manual eCPM ($ USD). Click Continue.

Click Add mapping.

The custom event requires filling three parameters:

  • Mapping name - any name for search.
  • Class name - adapter name. It's constant for Mars adapter: MediafyGADMediationAdapter.
  • Parameter - custom JSON parameter with configuration. It differs for different ad formats (banner, interstitial, native). See the Custom Parameters section for the details.

Click Done.

Click Select a mapping. Select an appropriate mapping from the list.

Click Done.

Click Save.

Custom Parameters

You can provide custom parameters via the Parameter field during custom event setup. For that, you should pass a valid JSON structure with the 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 the 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.

Configuration 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