Unity 3d - Admob shows only test ads

196 views
Skip to first unread message

Vivek Gadhvi

unread,
May 6, 2018, 8:15:18 AM5/6/18
to Google Mobile Ads SDK Developers
I have been trying since 2 days to figure out why on earth is admob just showing the TestAds! When i use testId it shows test ads. When i use my admob banner id it becomes blank(no ads shown) Below ive attached my admob banner code. (c#)

using UnityEngine;
using System.Collections;
using GoogleMobileAds.Api;

public class AdmobScript : MonoBehaviour
{

   
public string BannerId;


   
// Use this for initialization
   
void Start()
   
{
       
//Request Ads
       
RequestBanner();

   
}

   
private void RequestBanner()
   
{
#if UNITY_EDITOR
       
string adUnitId = "unused";
#elif UNITY_ANDROID
               
string adUnitId = "ca-app-pub-xxxxxxxxxxxxxxxxxxx";
#elif UNITY_IPHONE
                       
string adUnitId = "INSERT_IOS_BANNER_AD_UNIT_ID_HERE";
#else
                       
string adUnitId = "unexpected_platform";
#endif

       
// Create a 320x50 banner at the bottom of the screen.
       
BannerView bannerView = new BannerView(adUnitId, AdSize.Banner, AdPosition.Bottom);
       
// Create an empty ad request.
       
AdRequest request = new AdRequest.Builder().Build();
       
// Load the banner with the request.
        bannerView
.LoadAd(request);
   
}
}

I tried to research on why it aint working but unfortunately there are very less unity related admob solutions available on the internet.

Google Mobile Ads Plugin v3.13.1
Unity 2017.4.0f1

Please help me out! Thanks!

mobileadssdk-a...@google.com

unread,
May 7, 2018, 3:35:24 AM5/7/18
to Vivek Gadhvi, Google Mobile Ads SDK Developers
Hi Vivek,

There are a number of factors that could result to live ads not serving on your end and this includes, but not limited to, the availability of ads for your Ad request.

Since you were able to load test ads on your end, then we can safely assume that your code implementation of the Mobile Ads SDK is working correctly.

Could you test your Banner Ad Unit Id with our sample app and see if you can replicate the issue?

For us to check on our end, could you provide to us the following information privately using Reply privately to author option?
  • Banner Ad Unit Id in question
  • Complete device logs particularly the error logs when ads failed to load (using Ad events)
Regards,
Ivan Bautista
Mobile Ads SDK Team
Reply all
Reply to author
Forward
0 new messages