Re: addTestDevice has no effect

606 views
Skip to first unread message

Markus Wiederkehr

unread,
Aug 13, 2012, 4:38:41 PM8/13/12
to google-adm...@googlegroups.com
Take a close look at the last line of code you posted and what happens to the AdRequest object you so carefully constructed. ;-)

On Friday, August 10, 2012 3:38:20 AM UTC+2, Diggory Blake wrote:
I'm using AdMob v6.1.0 on android, and addTestDevice seems to be having no effect - proper ads are displayed at all times, and I don't want to be accused of generating spurious ad requests while testing.

I have two android devices, so I'm using the code below to create my adview:

            AdView adView = new AdView(this, AdSize.BANNER, publisherId);
           
            AdRequest request = new AdRequest();
           
            request.addTestDevice(AdRequest.TEST_EMULATOR);
            request.addTestDevice("75B200A25645770FE7DD2C61545E7C5D");
            request.addTestDevice("5B76989C9426AC2903B86A55E17CB10F");
           
            adView.loadAd(new AdRequest());
           
These IDs are exactly as they appear in LogCat when usb debugging is enabled:
To get test ads on this device, call adRequest.addTestDevice("75B200A25645770FE7DD2C61545E7C5D");
To get test ads on this device, call adRequest.addTestDevice("5B76989C9426AC2903B86A55E17CB10F");

And these log message still show up when using the above code.

The problem happens on both android devices and in the emulator, still happens if only one or two of the test devices are added.

Eric Leichtenschlag

unread,
Aug 13, 2012, 7:03:49 PM8/13/12
to google-adm...@googlegroups.com
What Markus is hinting at is try adView.loadAd(request) instead. :)

Cheers,
Eric


--
 
 
 



--

Eric Leichtenschlag | Developer Programs Engineer | eleich...@google.com | 650-776-5591


William Ferguson

unread,
Sep 1, 2012, 2:52:25 AM9/1/12
to google-adm...@googlegroups.com
Actually I am seeing exactly the same thing.
And I'm actually passing AdView#loadAd the AdRequest that I constructed.
More to the point AdRequest#isTestDevice always returns false (at least for all real devices I have tried).

Ie 

AdRequest adRequest = new AdRequest();
adRequest.addTestDevice("04C06F4F962B"); // Ideos Test Device
adRequest.addTestDevice("0149B3A11600E01D"); // Galaxy Nexus Test Device
Log.v(AppConstants.TAG, "(ads) isTestDevice=" + adRequest.isTestDevice(this));
admobAdView.loadAd(adRequest);

Always return false for #isTestDevice and always shows real ads.
This is using an Admob mediation id to construct the AdView.

William

Eric Leichtenschlag

unread,
Sep 4, 2012, 12:23:52 PM9/4/12
to google-adm...@googlegroups.com
William,

The device ID that AdMob accepts is a hashed value (I'm not sure, but it might also include a salt) of your actual device ID.  The way to get this hashed device ID is to make a live request on your device and check logcat for a message like "To get ads no this device, call adRequest.addTestDevice("YOUR_HASHED_DEVICE_ID")".  This ID is what you should use.  It should be a 32-digit HEX number like the numbers the OP has.

Cheers,
Eric

--
 
 
  


William Ferguson

unread,
Sep 4, 2012, 6:31:27 PM9/4/12
to google-adm...@googlegroups.com
Ah, missed that. Thanks Eric.

BTW eCPM is now down to 1/3 of what it was pre 5-AUG and still falling. Is there a bottom?
Reply all
Reply to author
Forward
0 new messages