title: How to supply location with an AdRequest now that AdMob has become part of the Google Play Services?
body: <p>With the <a href="http://android-developers.blogspot.co.nz/2013/10/google-play-services-40.html" rel="noreferrer">October update of the Google Play Services</a>, AdMob was integrated into the library, which means Android developers no longer have to include the <code>GoogleAdMobAdsSdk-x.x.x.jar</code> in a project's <code>libs</code> folder. There's a nice <a href="https://developers.google.com/mobile-ads-sdk/docs/admob/play-migration" rel="noreferrer">migration guide</a> that explains how to migrate from <code>com.google.ads.*</code> to <code>com.google.android.gms.ads.*</code>. </p>
  
  <p>So far, so good. Migrating is a piece of cake, but... There's always a "but". </p>
  
  <p>Previously, <code>com.google.ads.AdRequest</code> used to have a <a href="https://developers.google.com/mobile-ads-sdk/docs/admob/intermediate?csw=1#android-targeting" rel="noreferrer"><code>setLocation(Location)</code></a> method that would allow you to augment the targeting information. That option is no longer available in <a href="http://developer.android.com/reference/com/google/android/gms/ads/AdRequest.html" rel="noreferrer"><code>com.google.android.gms.ads.AdRequest</code></a>, nor in its <a href="http://developer.android.com/reference/com/google/android/gms/ads/AdRequest.Builder.html" rel="noreferrer"><code>Builder</code></a> class. </p>
  
  <p>I suppose my questions are: where and why did it go? The <em>where</em> is probably easily answered, because it simply seems to have been removed. I'd love for someone to prove me wrong here though, so feel free to comment if I'm overlooking something. That leaves the <em>why</em>.</p>
  
  <p>Right now I can only speculate as to why it was removed:</p>
  
  <ul>
  <li>It was overlooked when AdMob was refactored to become part of the Google Play Services.</li>
  <li>Out of privacy concerns, Google has decided to no longer support this feature.</li>
  <li>Since AdMob is now part of the Google Play Services, perhaps it integrates with its <a href="http://developer.android.com/google/play-services/location.html" rel="noreferrer">Location API</a> (i.e. the Fused Location Provider) and automatically supplies location information if available?</li>
  </ul>
  
  <p>The first option seems unlikely, whereas the second one would be understandable. Not sure about the third, but considering the privacy implications, not too likely either. Any chance someone can give a conclusive answer on the matter, or perhaps point to a reliable source?</p>
  
  <hr>
  
  <p>Note: Yes, I'm aware of the following remark in the docs:</p>
  
  <blockquote>
    <p>Out of respect for user privacy, Google asks that you only specify
    location and demographic data if that information is already used by
    your app.</p>
  </blockquote>
  
  <p>The app this issue came up for is already location-aware. In fact, it's a rather important aspect of the app. As the note says, since the user's location is already used by the app, supplying it with the ad request has been a valid use case so far.</p>
  
  <hr>
  
  <p><strong>Update</strong>:</p>
  
  <p>With the <a href="http://android-developers.blogspot.co.nz/2014/01/google-play-services-41.html" rel="noreferrer">9 January blog post on the upcoming Google Play Services 4.1 update</a>, there is a mention of location targetting being re-introduced through a new API:</p>
  
  <blockquote>
    <p><strong>Google Mobile Ads</strong><br/> 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. <strong>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.</strong></p>
  </blockquote>
  
  <p><strike>Currently I haven't found any updated documentation on this new API, but would expect it to become available very soon - as soon as rollout of Google Play Services 4.1 has been completed. Until then, I'll keep my initial answer below for reference.</strike></p>
  
  <p>Google has now updated the Android docs on the new features. See accepted answer below.</p>