3

Beginning using AdMob in an iOS app, I have this question:

When I am testing my app, I should not be using real adds. For that I use:

bannerUnitID = "ca-app-pub-3940256099942544/2934735716" // Provided in Google’s tutorial.

All is fine with that. But I read I can also add my device for test using this:

// Requests test ads on test devices. 
request.testDevices = ["2077ef9a63d2b398840261c8221a0c9b"] // Using the proper code for my device obviously.

What is the difference between using the first way and the second way?

I tried and could see that with the second way, I seem to be getting real adds. It is not clear to me, what is going on here. Anyone with a clear view? Please explain.

1 Answer 1

1

"ca-app-pub-3940256099942544/2934735716" is an ad unit. It will still serve real ads, just that it is filtered out (probably) at google's end (since they have it in the examples). This will be replaced with your ad unit id.

"2077ef9a63d2b398840261c8221a0c9b" is the unique device identifier (mac address). If you add this only test ads will be added to the device as long as the test device is kept added, no matter what ad unit id you use. This is the recommended approach (and always let it be there for your development devices) to prevent accidental click and disabling of your account.

2
  • Actually this is not what seems to happen, when I try. If I put my own add unit for bannerUnitID and I also include the code for my device inside request.testDevices, I am appearently getting real adds (not the same kind as with ca-app-pub-3940256099942544/2934735716). Since my device is present inside request.testDevices; does that mean I can click on the adds safely?
    – Michel
    Commented Mar 26, 2016 at 2:09
  • Yes should be fine to click on test device. But double check if the device id is correct and implementation is right. And avoid clicking unless you really need to test something. Commented Mar 26, 2016 at 4:49

Not the answer you're looking for? Browse other questions tagged or ask your own question.