"Invalid Request. Cannot determine request type. Is your ad unit id correct?"

6015 views
Skip to first unread message

Ecuador

unread,
Jun 1, 2016, 5:15:25 PM6/1/16
to Google Mobile Ads SDK Developers
I really don't get it. Admob seemed easy to implement, got test ads showing fine, but trying the AppId that I created last week and I get "<Google> Invalid Request. Cannot determine request type. Is your ad unit id correct?" The app id does seem a bit weird compared to the test-id, containing a tilde (~) where the test had a slash, so I also tried replacing the tilde with a slash and I do not get that message, but there are never any ads shown. I can't think of something else to try. I am not on the absolute latest version - I am using 7.7.1, since 7.8 doesn't seem to work on Mavericks/Xcode 6.2 - but I don't see how last month's API wouldn't work...
TIA

Veer Arjun Busani(Mobile Ads SDK Team)

unread,
Jun 2, 2016, 9:43:07 AM6/2/16
to Google Mobile Ads SDK Developers
Hi there,

App ID is different to Ad Unit ID. You must use Ad Unit ID when requesting ads. You can find your Ad Unit ID in Account > Monetize section of your AdMob account. App ID is now being used for analytics among other things and it's an optional step for now.

Thanks,
Veer Busani
Mobile Ads SDK Team

Ecuador

unread,
Jun 2, 2016, 9:48:31 AM6/2/16
to Google Mobile Ads SDK Developers
Wow, it was as simple as that, I did not notice the difference. Thanks. 

Magesh

unread,
Nov 26, 2019, 4:52:16 PM11/26/19
to google-adm...@googlegroups.com
Finally, this is the post I was looking for all week, almost wasted more than 2 days to find the difference between Ad AppID, AdUnitID, and where to put them appropriately.

Major Differences:
ca-app-pub-3940256099942544~3347511713  <- Test AppID    (has Tilde ~)
ca-app-pub-3940256099942544/6300978111  <- Test AdUnitID (has forward slash /)

AppID -> Manifest tag, MobileSdk Initialization.
Found in AdmobPage->App->AppSettings->AppID
<meta-data
    android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="AppID Here"/>
and 
MobileAds.initialize(this, "AppID Here");

AdUnitID (Banner/Small/Interstitial., etc) 
Found in AdmobPage->AdUnits and appropriate Ad units like banner etc.
AdView instances can be inflated from XML having (AdUnitID set from above step) or dynamically set at runtime using mAdView.setAdUnitID("your AdUnitID here")

<com.google.android.gms.ads.AdView
android:id="@+id/adView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
app:adSize="BANNER"
app:adUnitId="ca-app-pub-3940256099942544/6300978111"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.494"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView"
app:layout_constraintVertical_bias="0.892">
</com.google.android.gms.ads.AdView>


Though its 2019, this post is still very helpful, 
Thanks.
Reply all
Reply to author
Forward
0 new messages