Mars SDK - AdMob AdOps

Create App And 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. 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

Open Google AdMob Mediation page.

Click "Create mediation group".

Choose the desired ad format and choose Android platform.

Set the name and click "Add ad units".

Select ad units that will use Mars adapter.

Click "Add custom event".

Set label and eCPM price.

Click "Select mapping" and "Add additional mapping".

Fill custom event fields for current ad format (look at next section "Custom event fields").

Click "Select mapping" and choose already created.

Save Mediation group.

Create Custom Event

The custom event requires filling three parameters:

  • Mapping name - any name for search.
  • Class name - adapter name. It's constant for Mars adapter: com.mediafy.sdk.gad.MediafyGadMediationAdapter.
  • Parameter - custom JSON parameter with configuration. It differs for different ad formats (banner, interstitial, native).

Custom event: banner

JSON parameter for banner request.

  • ad_formats - ad format (by default "banner").
  • ad_unit_id - (optional) - Mars ad unit id.

Example: Custom event parameter for banner:

{
  "ad_formats": [
    "banner"
  ],
  "ad_unit_id": "test_ad_unit_id"
}

Example: Custom event parameter for video:

{
  "ad_formats": [
    "video"
  ],
  "ad_unit_id": "test_ad_unit_id"
}

Custom event: interstitial

JSON parameter for display interstitial request.

  • ad_formats - ad formats.
  • sizes - ad sizes.
  • ad_unit_id (optional) - Mars ad unit id.

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

Example: Custom event parameter for banner:

{
  "ad_formats": [
    "banner"
  ],
  "sizes": [
    {
      "w": 320,
      "h": 480
    }
  ],
  "ad_unit_id": "test_ad_unit_id"
}

Example: Custom event parameter for video:

{
  "ad_formats": [
    "video"
  ],
  "sizes": [
    {
      "w": 1024,
      "h": 768
    }
  ],
  "ad_unit_id": "test_ad_unit_id"
}

Example: Custom event parameter for multiformat - banner and video. It will request the ad for display and video ads with sizes 1024x768 and 320x480.

{
  "ad_formats": [
    "banner",
    "video"
  ],
  "sizes": [
    {
      "w": 1024,
      "h": 768
    },
    {
      "w": 320,
      "h": 480
    }
  ],
  "ad_unit_id": "test_ad_unit_id"
}

Custom event: native

JSON parameter for native request.

  • ad_unit_id (optional) - Mars ad unit id.

Example: Custom event parameter for native:

{
  "ad_unit_id": "test"
}

Contact us today

to enjoy endless opportunities!

Contact Us
+

Contact Us