4

Google Mobile Ads

With Google Play services 4.1, the Google Mobile Ads SDK now fully supports DoubleClick for Publishers, DoubleClick Ad Exchange, and Search Ads for Mobile Apps. You can also use a new publisher-provided location API to provide Google with the location when requesting ads. Location-based ads can improve your app monetization.

How to get publisher provided location? How to set the retrived location to com.google.android.gms.ads.AdRequest?

1
  • 1
    Google said the apis and docs would be released once the rollout of play services 4.1 is complete, which as far as I know hasn't happened yet.
    – athor
    Jan 16, 2014 at 7:40

2 Answers 2

3

As I understand, you can receive user's location using standart Android methods (https://developer.android.com/google/play-services/location.html) and set location in AdRequest using this method: https://developer.android.com/reference/com/google/android/gms/ads/AdRequest.Builder.html#setLocation(android.location.Location)

This question also may be helpful: How to supply location with an AdRequest now that AdMob has become part of the Google Play Services?

1
AdRequest request = new AdRequest.Builder()
    .setLocation(Location l)
    .build();

This works for me.

1
  • I used this by passing latitude & longitude of particular country say US. But in adMob console it doesn't show the same country. Do you know why this is happening ?
    – Raj
    Dec 1, 2020 at 15:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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