Admob Mediation Payment
Hi,
I want to use Admob Mediation but i don't know its details. My mediation has two ad networks. They are Admob and Unity Ads.
How will they pay? Will it be a single source of payment?
Answer by Arsh7 · Jan 08, 2017 at 10:31 AM
Admob only does banners and interstitials. Unity ads are only video ads. But you can try setting up chartboost and unity ads for "video ads", admobs provides a mediation platform, not video ads. I just figured it out today..Very confusing. The two examples I gave seemed the easiest to integrate into unity project
Answer by ugameplayer111 · Apr 20, 2017 at 08:36 AM
Banner,Interstitial,video ,native expresive ad ,admob can use all of that. using UnityEngine; using System.Collections; using admob; public class admobdemo : MonoBehaviour {
// Use this for initialization
void Start () {
Debug.Log("start unity demo-------------");
initAdmob();
}
// Update is called once per frame
void Update () {
if (Input.GetKeyUp (KeyCode.Escape)) {
Debug.Log(KeyCode.Escape+"-----------------");
// ad.removeAllBanner();
}
}
Admob ad;
//bool isAdmobInited = false;
void initAdmob()
{
// isAdmobInited = true;
ad = Admob.Instance();
ad.bannerEventHandler += onBannerEvent;
ad.interstitialEventHandler += onInterstitialEvent;
ad.rewardedVideoEventHandler += onRewardedVideoEvent;
ad.nativeBannerEventHandler += onNativeBannerEvent;
ad.initAdmob("ca-app-pub-3940256099942544/2934735716", "ca-app-pub-3940256099942544/4411468910");
// ad.setTesting(true);
ad.setGender(AdmobGender.MALE);
string[] keywords = { "game","crash","male game"};
ad.setKeywords(keywords);
Debug.Log("admob inited -------------");
}
void OnGUI(){
if (GUI.Button(new Rect(120, 0, 100, 60), "showInterstitial"))
{
if (ad.isInterstitialReady())
{
ad.showInterstitial();
}
else
{
ad.loadInterstitial();
}
}
if (GUI.Button(new Rect(240, 0, 100, 60), "showRewardVideo"))
{
if (ad.isRewardedVideoReady())
{
ad.showRewardedVideo();
}
else
{
ad.loadRewardedVideo("ca-app-pub-3940256099942544/xxxxxxxxxx");
}
}
if (GUI.Button(new Rect(0, 100, 100, 60), "showbanner"))
{
Admob.Instance().showBannerRelative(AdSize.SmartBanner, AdPosition.BOTTOM_CENTER, 0);
}
if (GUI.Button(new Rect(120, 100, 100, 60), "showbannerABS"))
{
Admob.Instance().showBannerAbsolute(AdSize.Banner, 0, 300);
}
if (GUI.Button(new Rect(240, 100, 100, 60), "removebanner"))
{
Admob.Instance().removeBanner();
}
string nativeBannerID = "ca-app-pub-3940256099942544/2562852117";//google
if (GUI.Button(new Rect(0, 200, 100, 60), "showNative"))
{
Admob.Instance().showNativeBannerRelative(new AdSize(320,120), AdPosition.BOTTOM_CENTER, 0,nativeBannerID);
}
if (GUI.Button(new Rect(120, 200, 100, 60), "showNativeABS"))
{
Admob.Instance().showNativeBannerAbsolute(new AdSize(320,120), 0, 300, nativeBannerID);
}
if (GUI.Button(new Rect(240, 200, 100, 60), "removeNative"))
{
Admob.Instance().removeNativeBanner();
}
}
void onInterstitialEvent(string eventName, string msg)
{
Debug.Log("handler onAdmobEvent---" + eventName + " " + msg);
if (eventName == AdmobEvent.onAdLoaded)
{
Admob.Instance().showInterstitial();
}
}
void onBannerEvent(string eventName, string msg)
{
Debug.Log("handler onAdmobBannerEvent---" + eventName + " " + msg);
}
void onRewardedVideoEvent(string eventName, string msg)
{
Debug.Log("handler onRewardedVideoEvent---" + eventName + " " + msg);
}
void onNativeBannerEvent(string eventName, string msg)
{
Debug.Log("handler onAdmobNativeBannerEvent---" + eventName + " " + msg);
}
}
Your answer
Follow this Question
Related Questions
UnityAds vs AdMob 0 Answers
Interstitial Ads Network 0 Answers
I can not build my project after I imported Ironsource SDK. 2019.4.5f1 0 Answers
Is ad platform CPIMobi good or bad? 5 Answers
Which ad provider you are using? 1 Answer