Developer Console

Ad Targeting Options

Besides ad unit size, there are a number of targeting options you can include in the request that's sent to the Amazon Mobile Ad Network. For example, you may include latitude and longitude gathered from the device. To set targeting options, you must construct an AdTargetingOptions object and pass it to the AdLayout.loadAd or InterstitialAd.loadAd method call.

Optional - Including Latitude and Longitude

You may choose to supply the Amazon Mobile Ads API with latitude and longitude coordinates as part of an ad request, if your app has permission from the user to gather this information. Requests that contain geographic location may earn higher CPMs.

Important: On Android your app must include permissions for ACCESS_FINE_LOCATION and ACCESS_COARSE_LOCATION to utilize latitude and longitude coordinates. See Step 2 of the Quick Start Guide for more information about permissions. Example:

AdTargetingOptions opt = new AdTargetingOptions().enableGeoLocation(true);

Advanced Option

Advanced options can be set as String key value pairs through the setAdvancedOption method. The advanced options currently include "ec" for floor price. Example:

AdTargetingOptions opt = new AdTargetingOptions().setAdvancedOption("key", "value");

Optional - Floor Price

When making load ad requests, you can specify a floor price in micro-dollars. For example, if you wanted to earn a minimum of $0.85 per thousand ads returned, then you would specify "850000" micro-dollars. The floor price is set through the advanced options using the key "ec".

The code shown in the following example will only allow ads to be returned if they have a CPM of $0.85 or greater. Example:

AdTargetingOptions opt = new AdTargetingOptions().setAdvancedOption("ec", "850000");