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.
Apps
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.
Ad units
Get started
Choose the type of ad unit and click Select.
Select
Fill Ad unit name and tune other settings if needed. Click Create ad unit.
Ad unit name
Create ad unit
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.
The custom event requires filling three parameters:
com.mediafy.sdk.gad.MediafyGadMediationAdapter
JSON parameter for banner request.
ad_formats
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" }
JSON parameter for display interstitial request.
sizes
Ensure you provide sizes for your ad unit in code or via settings on the publisher's UI. It's a critical property.
{ "ad_formats": [ "banner" ], "sizes": [ { "w": 320, "h": 480 } ], "ad_unit_id": "test_ad_unit_id" }
{ "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" }
JSON parameter for native request.
Example: Custom event parameter for native:
{ "ad_unit_id": "test" }