How to use Huawei Ads with AdMob mediation ?

Enes Özdemir
Huawei Developers
Published in
5 min readMar 9, 2021

--

Google AdMob is one of the largest global ad networks. AdMob maximizes the value of every impression by combining global advertiser demand, innovative ad formats, and advanced app monetization technology.

As for Huawei, Huawei alone has shipped 240.6 million smartphones in the year of 2019 (source) therefore Huawei environment impresses us as a market with a large number of users and a very high potential. It is clear that publishers or developers can increase monetization by using Huawei Ads.

If you are already using Google AdMob, you could use its custom mediation feature to add Huawei Ads as one of your Ad sources to maximize your profit.

In this article you will learn how to use AdMob mediation creation to display Huawei Ads.

Test ad IDs will be used in this article. If you want to use your own ads, sign in to your Huawei Developer Console and create an AdUnit.

Set up and configure your AdMob account.

Go to AdMob Console and login with your AdMob account.

Go to Apps > Add App

Select App’s platform and check whether if your app listen on a supported app store then click continue.

Enter your app name and click Add App.

Congratulations first step is over you have created an app in AdMob.

Now we have to create ad units. You can click Create ad Unit in the next page.

Now select the ad type you want to create

Enter ad unit name and click Create Ad Unit

Ad unit is created.

Take note of your app ID you will use it later!

How to create a mediation group

Select Mediation from left menu and click Create Mediation Group button.

Select your ad format and platform of your app then click continue.

Enter a name for the mediation then click Add ad Units.

Select your app and click Done.

We added our app to the mediation.

Under the add source section ad source section is automatically added.

Now we are going to add custom event for this mediation by clicking Add Custom Event.

Enter a label for the custom event and Enter a manual eCPM of any figure for now and click continue.

Next,

Enter the full class path to our adapter class.

“com.hmscl.huawei.admob_mediation.all_ads”

Make sure that adapter class name entered correctly otherwise the mediation will not work.

Enter the Huawei test banner ad id testw6vs28auh3 as the parameter. (For the sake of simplicity, we’ll only use test ads for now) then click Done.

For other types of ads such as Interstitial and Rewarded the relevant custom event class should be used. AdUnitID is required in custom event data.

For more information on custom event classes, please refer to the Huawei mediation adapter for AdMob.

Now simply click save.

After completing this configurations, the mediation will be completed successfully.

For more information regarding Huawei Ads, refer to the official documentation here.

For more information regarding Google AdMob mediation, refer to the official documentation here.

FAQ

1-) We have implementation of “google-play-services-ads” on build.gradle and google meta-data on Manifest file. Would it work on pure HMS devices?

— These particular implementations is for Admob plaftorm and they doesn’t have GMS dependency. So it would work perfectly fine on HMS devices.

2-) Does Huawei Admob mediation adapter has any country restrictions?

— There is no restrictions besides China.

3-) Can we see ad statistics like impressions on Admob ?

— Yes statistics like impression, clicks etc. will be presented in the Admob like any other custom mediation.

4-) When mapping your ad unit to custom events do we always have to put ”com.hmscl.huawei.admob_mediation.all_ads”?

— Yes for Huawei Admob mediation this class name always has to be “com.hmscl.huawei.admob_mediation.all_ads”

Summary

In this article, we learned how to create Huawei-AdMob mediation using Huawei AdMob mediation adapter.

References

Mediation Adapter

Huawei Ads Kit

Google AdMob Documentation

--

--