Confused by the "/" and ":" in the admob Ad unit ID
Summary Question: I am confused by the "/" and ":" in the Ad unit ID. More like, when should "/" be there and when should ":" be there.
Background : I am an indie iOS app developer and we want to put unique Ad unit IDs across different screens in the app to better monitor and control the ad experience within the app. We want the admob reports to reflect earnings details for each single ad unit. Our apps do not serve any web page, rather all screens are part of app serving app content like tableviews with a banner ad at the bottom. We have never used Adsense Managament APIs in the past to monitor anything related to ads served via our iOS app.
Detailed description of the problem: I am quoting from https://developers.google.com/mobile-ads-sdk/docs/admob/reporting :
You can find your ad unit ID by going to Monetize -> All apps -> [app in question] in your AdMob page. Look for the ad unit you want to report on and find the ad unit ID. It should be in the form ca-app-pub-xxxxxxxxxxxxxxxx/nnnnnnnnnn, but you'll need to change it to ca-app-pub-xxxxxxxxxxxxxxxx:nnnnnnnnnn to use in the AdSense Management API.
and another excerpt from the same link:
If you only want to see your AdMob earnings, make sure you set a filter with your AdMob account ID:
filter: "AD_CLIENT_ID==ca-app-pub-xxxxxxxxxxxxxxxx"
Similarly, if you want to see your earnings for a single ad unit, you can set a filter with your ad unit ID:
filter: "AD_UNIT_ID==ca-app-pub-xxxxxxxxxxxxxxxx:nnnnnnnnnn"
We do want to see our earnings report split clearly for every single ad unit. So the confusion is that do we need to replace the "/" with ":" when including the ad unit ID in the app?
I went ahead and changed the "/" to ":" in the ad unit ID but then when I ran the iOS app in the iOS simulator, it stopped serving the ads. I did't even see the admob banner at the bottom. It again started serving ads only when I backed out my change to the ad unit ID and replaced the ":" with "/".
Problem Question: Admob specifically requires us to change "/" to ":" in the ad unit ID to be able to use Ad Sense Management APIs which, BTW, we have never used in our iOS apps till now. So do we need to change "/" to ":"? Please note that we do want to see our earnings for every single ad unit. And per my experiment replacing "/" with ":", it does not serve ads at all with ":" in the ad unit ID (hence the question why admob requires filters setup with ":" or advises people to replace "/" with ":" to use Adsense Management APIs)
You are confusing ad requests using Admob with reporting using AdSense.
Leave your app as is. The ad unit id there should be of the form ca-app-pub-xxxxxxxxxxxxxxxx/nnnnnnnnnn.
IF you want to programatically generate reports on your ad requests, revenue etc then you would use the Adsense API to do so and the ad unit id you would use is the same as above except that it is of the form ca-app-pub-xxxxxxxxxxxxxxxx:nnnnnnnnnn
链接地址: http://www.djcxy.com/p/32330.html