---
agentTools:
  projectIndex: https://developers.appnext.com/llms.txt
---

# Banners

Android SDK Admob Adapter - Banners ad unit

[block:api-header]
{
  "title": "Adding Appnext Banner to Admob"
}
[/block]

Please follow the steps below to integrate Appnext’s adaptor for Admob

\##Step 1: Login to your AdMob account and configure Appnext

As explained above, you must have an AdMob account, and an associated app within this account, in order to integrate Appnext

\##Step 2: Within your AdMob account, press the “Apps” button and choose your app from the ‘All apps’ list:

[block:image]
{
  "images": [
    {
      "image": [
        "https://files.readme.io/6154aea-Group_1.png",
        "Group 1.png",
        474,
        221,
        "#f3f2f4"
      ]
    }
  ]
}
[/block]

\##Step 3: Create an ad unit

* Select the app for which you want to add a new ad unit from your app list on the left side menu.
* Click on “Ad Units” from the app screen.

[block:image]
{
  "images": [
    {
      "image": [
        "https://files.readme.io/a6c2ccd-Group_2.png",
        "Group 2.png",
        272,
        432,
        "#f2f1f3"
      ]
    }
  ]
}
[/block]

* Click on the 'Get Started' button -
  Note: If it's not your first Ad unit implementation, click on 'Add Ad Unit'

[block:image]
{
  "images": [
    {
      "image": [
        "https://files.readme.io/482e7d2-Group_4.png",
        "Group 4.png",
        801,
        301,
        "#f2f3f6"
      ]
    }
  ]
}
[/block]

* Choose the 'Banner' Ad Unit -

[block:image]
{
  "images": [
    {
      "image": [
        "https://files.readme.io/9c43d5e-Group_5.png",
        "Group 5.png",
        705,
        431,
        "#f0e5e6"
      ]
    }
  ]
}
[/block]

* Configure your new ad unit
  * Enter a name for your ad unit
* Click on Advanced settings
  * Make sure both text, images, and videos are checked

[block:image]
{
  "images": [
    {
      "image": [
        "https://files.readme.io/9e7db88-Group_8.png",
        "Group 8.png",
        801,
        522,
        "#f6eced"
      ]
    }
  ]
}
[/block]

* Please add the App ID to your project manifest file
  Note: If it's not your first Ad unit implementation skip this step.

[block:image]
{
  "images": [
    {
      "image": [
        "https://files.readme.io/492c8a4-Group_9.png",
        "Group 9.png",
        745,
        361,
        "#f4e7e7"
      ]
    }
  ]
}
[/block]

[block:code]
{
  "codes": [
    {
      "code": "<meta-data\n            android:name=“com.google.android.gms.ads.APPLICATION_ID”\n            android:value=“ca-app-pub-3899300681756284~5575119254\"/>",
      "language": "text"
    }
  ]
}
[/block]

* After the Ad Unit is created successfully, please press on Meditation button

[block:image]
{
  "images": [
    {
      "image": [
        "https://files.readme.io/9c79181-Group_3.png",
        "Group 3.png",
        272,
        432,
        "#f2f1f3"
      ]
    }
  ]
}
[/block]

Then, press on create Medition Group button -

[block:image]
{
  "images": [
    {
      "image": [
        "https://files.readme.io/05e0c7c-Group_10.png",
        "Group 10.png",
        526,
        238,
        "#eaeaf1"
      ]
    }
  ]
}
[/block]

Choose Ad Format and Platform -

[block:image]
{
  "images": [
    {
      "image": [
        "https://files.readme.io/128d810-Group_11.png",
        "Group 11.png",
        561,
        252,
        "#f3dedf"
      ]
    }
  ]
}
[/block]

Enter Mediation Group name and click on Add Ad units -

[block:image]
{
  "images": [
    {
      "image": [
        "https://files.readme.io/8622672-Group_12.png",
        "Group 12.png",
        800,
        450,
        "#f7e6e6"
      ]
    }
  ]
}
[/block]

Select your app

[block:image]
{
  "images": [
    {
      "image": [
        "https://files.readme.io/e90da22-Group_13.png",
        "Group 13.png",
        660,
        546,
        "#eeeeef"
      ]
    }
  ]
}
[/block]

\##Step 4: Under the Waterfall section

* Press on Add Custom Events
* Set Label and an eCPM value

[block:image]
{
  "images": [
    {
      "image": [
        "https://files.readme.io/2235d92-Group_14.png",
        "Group 14.png",
        800,
        234,
        "#fbfafb"
      ]
    }
  ]
}
[/block]

\##Step 5: Configure eCPM
You should allocate the Appnext eCPM manually in order for Appnext to show ads in your AdMob SDK.
You can configure the eCPM for the Appnext network in the ‘Mediation’ page and press ‘Save’ after each change:

[block:image]
{
  "images": [
    {
      "image": [
        "https://files.readme.io/cffce51-Group_15.png",
        "Group 15.png",
        463,
        320,
        "#ebe8e9"
      ]
    }
  ]
}
[/block]

* In the “Custom Event” details fill the following details:
  * Class name: `com.appnext.sdk.adapters.admob.banners.AppnextAdMobBannerAdapter`
  * Parameter: Appnext Placement ID

[block:image]
{
  "images": [
    {
      "image": [
        "https://files.readme.io/f59aaa9-Group_16.png",
        "Group 16.png",
        620,
        317,
        "#f3edef"
      ]
    }
  ]
}
[/block]

* Finally, press ‘Done’ at the bottom of the page.
* Choose the ‘Ad unit’ you want to add Appnext’s custom event from the ‘Ad units’ list by pressing its ‘ad sources’ link

[block:image]
{
  "images": [
    {
      "image": [
        "https://files.readme.io/25c3cba-Group_17.png",
        "Group 17.png",
        800,
        673,
        "#000000"
      ]
    }
  ]
}
[/block]

* Click the "Save" button on the "Mediation" page to save the newly added ‘Ad Network‘

## Step 6: You’re all done!

Your AdMob SDK should start showing Appnext ads immediately. If Appnext ads are not shown, check the eCPM allocation and make sure it’s high enough so it will give Appnext priority.

[block:callout]
{
  "type": "danger",
  "body": "- Each placement has a Placement ID. If you integrate multiple placements, you will need to use a different Placement ID for each.\n- It is against our policies to encourage or reward the user for installing the app; we only allow rewards as a means of encouraging users to watch the video ad, so they will voluntarily install the app if they are interested.",
  "title": "Important Note!"
}
[/block]

[block:api-header]
{
  "title": "Customizing the ad unit"
}
[/block]

The Appnext Admob adapter provides an option to change the ad unit’s configuration.
By default, the SDK configuration will be loaded from Appnext's server, but you can choose to change it directly by creating a `BannerAdRequest` object for the banner ad and call any of the following setters before loading the ad by the AdMob `loadAd` interface:

[block:code]
{
  "codes": [
    {
      "code": "BannerAdRequest config = new BannerAdRequest()\n\n// Relevant for all sizes\nconfig.setCategories(\"category1, category2\");\nconfig.setPostback(\"Postback string\");  \n\n//Relevant for MEDIUM_RECTANGLE size only\nconfig.setCreativeType(TYPE_VIDEO);\nconfig.setAutoPlay(true);\nconfig.setMute(false);\nconfig.setVideoLength(VIDEO_LENGTH_SHORT);\n\nextras.putSerializable(AppnextAdMobBannerAdapter.AppNextBannerAdRequestKey, config);\nAdRequest adRequest = new AdRequest.Builder().addCustomEventExtrasBundle(AppnextAdMobBannerAdapter.class, extras).build();\n\nmAdView.loadAd(adRequest);",
      "language": "java"
    }
  ]
}
[/block]

* `setCategories` - String. Set preferred ad categories
* `setPostback` - String. Postback parameters that will be posted to your server after user installed an app

(make sure to encode the values)

Setters that are relevant only to the MEDIUM\_RECTANGLE banner size:

* `setCreativeType` - The MEDIUM\_RECTANGLE size can show video in addition to static creative. When video is in use, the file will be streamed. The default value is `ALL`.
  * `BannerAdRequest.TYPE_ALL` ("all")
  * `BannerAdRequest.TYPE_VIDEO` ("video")
  * `BannerAdRequest.TYPE_STATIC` ("static")
* `setAutoPlay` - Boolean. When a video is set as the creative, this setter defining if the video will auto play or not. The default value is false.
* `setMute` - Boolean. When a video is set as the creative, this setter is defining if the video will start on muted volume or not. Un-mute/Mute button is located on the video creative. The default value is true - the video is muted.
* `setVideoLength` - When a video is set as the creative, this setter is defining the preferred length of the video. The default value is SHORT.
  * `BannerAdRequest.VIDEO_LENGTH_SHORT` ("15") - Up to 15 seconds long videos
  * `BannerAdRequest.VIDEO_LENGTH_LONG` ("30")  - 20-60 seconds long videos

[block:api-header]
{
  "title": "App Categories"
}
[/block]

[block:parameters]
{
  "data": {
    "0-0": "1. Action\n2. Adventure\n3. Arcade\n4. Arcade & Action\n5. Board\n6. Books & Reference\n7. Brain & Puzzle\n8. Business\n9. Card\n10. Cards & Casino\n11. Casino\n12. Casual\n13. Comics\n14. Communications\n15. Education\n16. Educational\n17. Entertainment\n18. Family\n19. Finance\n20. Health & Fitness\n21. Libraries & Demo\n22. Lifestyle\n23. Live Wallpaper",
    "0-1": "24. Media & Video\n25. Medical\n26. Music\n27. Music & Audio\n28. News & Magazines\n29. Personalization\t\n30. Photography\n31. Productivity\n32. Puzzle\n33. Racing\n35. Shopping\n36. Simulation\n37. Social\n38. Sports\n39. Sports Games\n40. Strategy\n41. Tools\n42. Travel & Local\n43. Trivia\n44. Weather\n45. Word"
  },
  "cols": 2,
  "rows": 1
}
[/block]

Make sure to encode (%20) categories with more than 1 word, example: Travel%20%26%20Local

[block:api-header]
{
  "title": "Integration Support"
}
[/block]

Should you have any problems integrating the product, log a ticket with us by emailing <support@appnext.com>