Trouble using Admob

Am having trouble getting a ad to be displayed using adMob, not really sure what numbers need going where to be honest.

In my build settings am using - publisherId = “com.coronalabs”

In my ads.init as using my pub-xxxxxxxxxxxxxxxx

In my show am just using - ads.show( “Banner”, { x=50, y=50 } )

Something is missing am presuming or is Banner above suppose to be picking my ad called Banner ?

Also when setting up my ads it asks for a App name etc… is that just for my reference as my app isn’t on any stores yet.

For testing am building for iOS simulator.

Dave

Hi Dave,

As far as I know you can’t test ads on the simulator, you need to build to a device to test your ads

Hi Dave,

As Gooner87 said you have to test on device.

publisherId is correct, i assume you have the plugins ={  [“CoronaProvider.ads.admob”] …} in your build settings.

ads.init( “admob”, “XXXXXXXXXXXXXXX”, adMobListener ) – XXX is AppID from the admob setup

ads.show( “banner”, { x=50, y=50 } ) not “Banner”

The App name can be edited later.

Good Luck!

burhan

Thanks for replying.

“XXX is AppID from the admob setup” - Where is this and what format is it in, I have nothing in my adMob setup that says AppId.

ads.show( “banner”, { x=50, y=50 } ) not “Banner”

How does it know what ad to show ?

I used “Banner” as my ad is called Banner.

Dave

You have to fill up your app details at admob website (add site/app ). It will generate a publisherID for you- 15 alphanumeric digit.

Replace XXX… with the given publisherID. 

Eg.

 ads.init( "admob", "a123e4316512f34", adMobListener ) 

I do not understand - “I used “Banner” as my ad is called Banner.”

Are you using your own banner?

The banner is from admob. You call “banner” because you want to show ad banner from admob.

A random ad banner will be fetch from admob every 60 seconds or depending on your setting at admob site.

Do take note that you need to “require” the ads to be able to used ads.

Place this code on top of your lua file before you call ads.init.

local ads = require "ads"

burhan

“banner” isn’t the name of your ad.  It’s either the string “banner” (all lower case) or “interstiital” which determines if you get a banner ad or a full screen interstitial ad.   AdMob gives you the ad they think you should get based on their trafficing rules which factors in  your ad buy, if you’re buying ads with them.  I also doubt that they would show you your ad for your app in your app.  Kind of a waste of inventory since you already have the app.

This is very confusing.

In admob I created a ad unit and called it “Banner”, in that ad unit I decide type of ad, make it child friendly, add other ad networks etc…

How does admob know I want that ad unit ?

EDIT: I get the error “Invalid ad request parameter”

EDIT: Sorted it.

appID is the AD UNIT ID that you have setup, this is how it knows what ad to serve.

Oh and it works fine in the xCode simulator, no need to build for device.

Dave

Hi guys,

I just started using admob (banner) and I am also very confused! I cannot see the banner on my app. I am sure it is my setup of admob. I went admob site and added an app which game me a   publisher ID = pppppppp

Now I am not sure if i need to add an actual banner ad to the admob site under my app? If do it is giving me “mediation ID” But even if I use that code (instead of the publishing ID) is still does not work (cannot see the banner) 

I should also note that the code works fine with Revmob (banner)…

Thank you for any suggestions. I am wondering if admob just need time before showing ad? 

Mo

Hello again.

I found this thread that could help but I do not completely understand it!

http://forums.coronalabs.com/topic/40362-admob-integration-whats-my-app-id/#entry217550

It talks about an app ID in the form of ca-app-pub-xxxxxxxxxxxxxxxx/xxxxxxxxxxxxxxxxx ???

ads.init( “admob”, “ca-app-pub-xxxxxxxxxxxxxxxx/xxxxxxxxxxxxxxxxx”, adListener )

I am assuming that the appID i need to use the publisher ID that we get when we add an app to the admob site? My publisher ID is 

Publisher ID: xxxxxxxxxxxxxx x

 talks  I am not sure why the pubID above is in the form of xxxxxxx/xxxxxx??

I also think that I am confusing the situation by adding a mediation placement banner which is giving another a mediation ID. I am pretty sure now that I do need a mediation banner  placement banner but just need to use the publisher ID to initialize admob for banner (or for full screen for that matter) 

Still I LOVE to confirm all this!

Thank you guys!

Mo

Mine is working fine in the xCode simulator and on a Android device.

I created a adMob account, added my app and added a ad unit as a banner ad.

In the init function I use the ad unit id NOT my publisher id (like you have it above).

Then in the show I just call a banner type ad.

Remember it only works on the xCode simulator (NOT Corona simulator) or an actual device.

Dave

hey!

OMG, I am officially a moron :frowning:  I forgot to add “admob” as one of the provider in a table of providers. Not wonder “revmob” worked. I did add the ad unit “banner” as you said and it works great! (I am seeing the banner ad)

I am wondering about the test mode setting? Should I unchecked that on the admob site for the app? I will assume so…

In any event THANK YOU so much Dave for taking the time and clarify the issue. I was going mad…

Cheers.

Mo

I couldn’t see a “Test Mode” any where on the adMob site.

Anyway on the xCode simulator I was seeing test mode type ads but on the actual device am getting proper ads without me changing anything.

Dave

It is under app settings tab (close to the managing fliters tab) I just unchecked it but it seems that either way it was showing live ads.

Cool! Thanks Dave.

Mo

So this is what causes the confusion. At least on my part.

The admob I’m using is legacy admob. Dave is using New Admob.

New admob has not been rolled out to all countries.  :frowning:

From google support:

Legacy AdMob New AdMob Sites Ad units Publisher ID Ad units ID Publisher controls Ad filters

Changing test mode settings does nothing as mine is showing live ads too!

In my console it shows:

<Warning>: <Google> To get test ads on this device, call: request.testDevices = [NSArray arrayWithObjects:@“6ed781fe56d5beacd11b4ef114205387”, nil];

which is xCode? and i don’t know how.

burhan

Ah I thought judging by the answers I was using a different adMob to everyone else, didn’t realise I actually was.

Dave

Hi Dave,

As far as I know you can’t test ads on the simulator, you need to build to a device to test your ads

Hi Dave,

As Gooner87 said you have to test on device.

publisherId is correct, i assume you have the plugins ={  [“CoronaProvider.ads.admob”] …} in your build settings.

ads.init( “admob”, “XXXXXXXXXXXXXXX”, adMobListener ) – XXX is AppID from the admob setup

ads.show( “banner”, { x=50, y=50 } ) not “Banner”

The App name can be edited later.

Good Luck!

burhan

Thanks for replying.

“XXX is AppID from the admob setup” - Where is this and what format is it in, I have nothing in my adMob setup that says AppId.

ads.show( “banner”, { x=50, y=50 } ) not “Banner”

How does it know what ad to show ?

I used “Banner” as my ad is called Banner.

Dave

You have to fill up your app details at admob website (add site/app ). It will generate a publisherID for you- 15 alphanumeric digit.

Replace XXX… with the given publisherID. 

Eg.

&nbsp;ads.init( "admob", "a123e4316512f34", adMobListener )&nbsp;

I do not understand - “I used “Banner” as my ad is called Banner.”

Are you using your own banner?

The banner is from admob. You call “banner” because you want to show ad banner from admob.

A random ad banner will be fetch from admob every 60 seconds or depending on your setting at admob site.

Do take note that you need to “require” the ads to be able to used ads.

Place this code on top of your lua file before you call ads.init.

local ads = require "ads"

burhan

“banner” isn’t the name of your ad.  It’s either the string “banner” (all lower case) or “interstiital” which determines if you get a banner ad or a full screen interstitial ad.   AdMob gives you the ad they think you should get based on their trafficing rules which factors in  your ad buy, if you’re buying ads with them.  I also doubt that they would show you your ad for your app in your app.  Kind of a waste of inventory since you already have the app.