App ID and Ad Unit ID

686 views
Skip to first unread message

Gold Locke

unread,
Jan 10, 2018, 9:23:15 AM1/10/18
to Google Mobile Ads SDK Developers
Hi,

I understand, every app has an app ID. Must I put this app ID in the app or is it enough only to put in the ad unit ID?
I put in only the ad unit ID and have no problems. So must I put in the app ID? Or do I have to put it only to have some features with firebase?
Question is, is it important or not?

Can I put the app ID in string.xml, like <string name="admob_app_id">ca-app-pub-XXXXXXXX~XXXXXXXXXXX</string>?

Thank you in advance.

mobileadssdk-a...@google.com

unread,
Jan 10, 2018, 3:01:02 PM1/10/18
to Gold Locke, Google Mobile Ads SDK Developers
Hi there,

Thanks for contacting us. You would have to add the App ID and Ad unit IDs to your strings.xml. Open strings.xml located under res =>values and add the IDs of all the ad units. Before loading ads, have your app initialize the Mobile Ads SDK by calling MobileAds.initialize() with your AdMob App ID. You have to globally initialize the AdMob App Id.This only needs to be done once, ideally at app launch. You can find your app's App ID in the AdMob User Interface.

Let us know if you have any other questions. We will be happy to help you.

Regards,
Deepika Uragayala
Mobile Ads SDK Team
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+ page:
    http://googleadsdeveloper.blogspot.com
    https://plus.google.com/115658573333388777174/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

--

---
You received this message because you are subscribed to the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.
To post to this group, send email to google-admob-ads-sdk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-admob-ads-sdk/37d29f80-4cd1-4002-81cf-8e2405da418e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

I.D.E.

unread,
Jan 23, 2018, 5:41:30 AM1/23/18
to Google Mobile Ads SDK Developers
> You have to globally initialize the AdMob App Id.This only needs to be done once, ideally at app launch.

Are we supposed to call MobileAds.initialize() in Application.onCreate() or in an Activity.onCreate() ?

The tutorial uses Activity.onCreate() -- https://developers.google.com/admob/android/quick-start -- but this means it's not globally initialized. Instead it's initialized whenever the Activity is launched.

mobileadssdk-a...@google.com

unread,
Jan 23, 2018, 2:50:14 PM1/23/18
to I.D.E., Google Mobile Ads SDK Developers
Hi there,

Either is fine but Application.onCreate() would be ideal as this would have to be called only once. If it's already called, then the SDK will ignore this. So Activity.onCreate() would also work.

Regards,
Deepika Uragayala
Mobile Ads SDK Team
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+ page:
    http://googleadsdeveloper.blogspot.com
    https://plus.google.com/115658573333388777174/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

To unsubscribe from this group and stop receiving emails from it, send an email to google-admob-ads-sdk+unsubscrib...@googlegroups.com.

--

---
You received this message because you are subscribed to the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.
To post to this group, send email to google-admob-ads-sdk@googlegroups.com.

Dominik Pysch

unread,
May 20, 2018, 3:34:39 PM5/20/18
to Google Mobile Ads SDK Developers
Hi there,

I would like to clarify one issue for myself.
So is it true, that the process of showing the ads will not succeed if I do only set the AdUnitID?
Is it mandatory to set the AppID as well or is it only for being able to use Firebase?

Thanks in advance,
Dominik

mobileadssdk-a...@google.com

unread,
May 21, 2018, 2:28:22 PM5/21/18
to Dominik Pysch, Google Mobile Ads SDK Developers
Hi Dominik,

You do not need to init the SDK with the AppID as this is optional step. If you do not call this, the SDK will automatically do this when the first AdRequest is made. This is just to fire up the SDK and saves a few milliseconds with the first AdRequest.


Regards,
Deepika Uragayala
Mobile Ads SDK Team
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+ page:
    http://googleadsdeveloper.blogspot.com
    https://plus.google.com/115658573333388777174/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

To unsubscribe from this group and stop receiving emails from it, send an email to google-admob-ads-sdk+unsubscrib...@googlegroups.com.

--

---
You received this message because you are subscribed to the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.
To post to this group, send email to google-admob-ads-sdk@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages