Search code examples
androidadmobads

Is a different ad unit ID required for each Activity?


In my app I am implementing ad banners in many activities. I have created banner ad unit on admob and I get ID of the banner. Can I give this ID to every banner in my app or I must create unique banner unit with ID for each banner(activity)


Solution

  • It's not recommended way of implementation. It works fine but not a best practice. When you want to implement the analytics and determine how much earning you got from specific adUnit, It will cause a problem. You can use one Ad Unit ID for all banner ads within your app and a different Ad Unit ID for all interstitial ads within the same app.

    Thus, if your app contains only banner ads, it can have only one Ad Unit ID. If your app contains banner and interstitial ads, it can have two Ad Unit IDs.

    However, according to the official AdMob guide, you can use one ID per activity for determination.

    An Ad Unit ID is a unique identifier given to the places in your app where ads are displayed. If you have an app with two activities, for example, each displaying a banner, you need two ad units, each with its own ID.

    For reporting sake, use a different ad unit for each application. This helps you know how each application is performing in regards to eCPMs, requests, and clicks. It will help you understand the market, adjust or improve your apps as needed. It's not against the policy if that's what you want. (Check Thread)