3

I'm just finishing my first app for Android and iOS, made in Unity3D. I used a Unity Plugin to add an addmob banner to it and tested it in a Android Device. The banner showed just fine.

I now created an account in addMob, manually added my app to it (since it's not on any store yet), got the Add Unit ID, put it into my code.

I now need to test it and I don't know how to do that. I know I'm not supposed to click my own banners, but how do I know if it's working before sending it to the AppStore or GooglePlay?

Thank you.

donfuxx
  • 11,277
  • 6
  • 44
  • 76
DanielFox
  • 675
  • 2
  • 9
  • 18

4 Answers4

3

You can set the device you are working on as your test-device. For example, I have the following configured for my AdView

<com.google.ads.AdView 
    android:id="@+id/adView"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    ads:adUnitId="APP_ID"
    ads:adSize="SMART_BANNER"
    ads:loadAdOnCreate="true" 
    ads:testDevices="TEST_DEVICE_ID" />

When you fill in your TEST_DEVICE_ID from your Android device (there is plenty on the internet available on how to obtain TEST_DEVICE_ID, e.g.: here), you'll get your test-banners on your device, even if your app is on Google Play.

I compared my app installed on a test-device and an app installed on another device: The test-device got a test-ad, whereas the other device got a "real" ad. I just took some screenshots from my that might give you a better comparison.

Hereafter a screenshot from my production app on my test-device:

Production App, test device

Hereafter a screenshot from my test app on my "test enabled" device:

Test App, test-enabled device

Hereafter a screenshot from my test app on my "test disabled" device

Test App, test-disabled device

Whether you add your device as test device in XML or code, I don't think it should matter. But anyway, screenshots above were for the XML implementation.

Community
  • 1
  • 1
Steven De Bock
  • 429
  • 4
  • 21
  • 1
    Well, the banners are already showing up and as far as I can tell, they seem to be real ads (even tough they are very generic and repetitive... they don't seem to have much in comon with my app). However the clicking isn't working. Nothing happens when I click on the banner... I wanted to get just a $0,01 in my account to be sure it's working. Can't I do that somehow? – DanielFox Mar 27 '14 at 15:12
  • Update: I just added my device id and it's still showing the same ads as before... – DanielFox Mar 27 '14 at 15:31
  • 1
    @DanielFox I added some pictures for reference. I don't have multiple devices, so sadly I can't upload a picture for a production app on a production device. – Steven De Bock Mar 27 '14 at 21:30
  • @StevenDeBock is it allowed to click on our own TestAds? – admin 7798 Dec 31 '15 at 10:45
  • You should register your device as a testdevice, then you have testads you can click on. Otherwise, you are not allowed to do so. – Steven De Bock Jan 02 '16 at 14:55
3

For the version of Admob using the Google Play services library, you can only achieve this in the code, not in the XML files.

All is explained in this documentation.

Basically here is how to do, just enter the following lines, the method addTestDevice will allow you to add the devices used during your tests:

AdRequest adRequest = new AdRequest.Builder()
        .addTestDevice(AdRequest.DEVICE_ID_EMULATOR)
        .addTestDevice("INSERT_YOUR_HASHED_DEVICE_ID_HERE")
        .build();
Yoann Hercouet
  • 17,894
  • 5
  • 58
  • 85
  • I'm sorry, but for me it works perfectly when leaving in "addtestdevice" in production code. Do you have any example of why it wouldn't work? Also, it works perfectly from XML... – Steven De Bock Mar 27 '14 at 08:25
  • Hi, I checked back and indeed it seems there is no risk in keeping it, just the devices listed will not be taken into consideration. I will update my answer. Thanks! – Yoann Hercouet Mar 27 '14 at 08:31
  • 1
    My answer works with Google Play services, your answer is based on the Android SDK, but soon this method will be obsolete because Google is pushing the use of Google Play services. They explain how to migrate here: https://developers.google.com/mobile-ads-sdk/docs/admob/play-migration – Yoann Hercouet Mar 27 '14 at 08:40
  • I din't put my device as a test device (I didn't put it's id on the code). So... the banners are showing up and they seem real. But they can't be clicked... I just wanted to click once an see if I get just a cent to make sure it's working... – DanielFox Mar 27 '14 at 15:14
2

Load the app. If the ad shows in the correct place then it is working. You aren't supposed to click your own ads. You can load your ads and see that they are working. ADMOB handles the linking, so you don't have to worry about that part. If they are showing, they are working.

Trent Pierce
  • 387
  • 3
  • 22
  • Clicking on my banners isn't working (I know I shouldn't but I just want to try it once). Could some Unity3D programing be interfering with it? – DanielFox Mar 27 '14 at 15:15
  • Build your app and put it on a friends device and click the ad. You are walking a fine line clicking your own ads. I doubt that one will hurt you, but Google frowns upon that heavily. Plus, once you get it signed and put on another device you can see how it will run when it's downloaded from the market – Trent Pierce Mar 27 '14 at 18:58
  • So if I don't press the ads, can I still use my own app or am I completely banned from using my app with ads? – Marshall Jan 07 '15 at 10:08
1

Aparently it was a problem with the Unity Plugin. I managed to fix it using this simple tutorial here:

http://forum.unity3d.com/threads/195169-Google-Admob-plugin-for-Unity-ad-is-not-clickable

The ads are now clickable! (I clicked only once to avoid beeing banned by google)

DanielFox
  • 675
  • 2
  • 9
  • 18