How to supply location with an AdRequest now that AdMob has become part of the Google Play Services?

前端 未结 1 995
暗喜
暗喜 2021-02-03 10:11

With the October update of the Google Play Services, AdMob was integrated into the library, which means Android developers no longer have to include the GoogleAdMobAdsSdk-

相关标签:
1条回答
  • 2021-02-03 10:36

    Final update:

    Google has finally updated the Android docs to include the new publisher-provided location API. Not surprisingly, these are glued into the builder pattern and pretty much identical to how things worked previously:

    AdRequest.Builder.setLocation(Location)

    The answer below is kept for educational purposes; if above answered your question, there's no need to look any further.


    Update: It appears location targetting will be re-enabled through a new API in Google Play Services 4.1. See update to original question for more details.


    For a lack of answers, I'm going to put this brief analysis up for the time being. I had a quick look at the old AdMob SDK and the new Google Play Services in an attempt to discover more information.

    Here are my findings so far, outlined in a small table. Basically this gives a comparison of the various key-value pairs that are sent with an AdRequest.

     Admob SDK:                     | Google Play Services:
    --------------------------------|--------------------------------
     map.put("kw", ...);            | map.put("kw", ...);
     map.put("cust_gender", ...);   | map.put("cust_gender", ...);
     map.put("cust_age", ...);      | map.put("cust_age", ...);
     map.put("uule", ...);          |
     map.put("testing", ...);       |
     map.put("pto", ...);           |
     map.put("cipa", ...);          |
     map.put("adtest", ...);        | map.put("adtest", ...);
     map.put("extras", ...);        | map.put("extras", ...);
                                    | map.put("tag_for_child_directed_treatment", ...);
    --------------------------------|--------------------------------
    
    Legend:
    * kw = keyword
    * cust_gender = gender
    * cust_age = birthday
    * uule = location
    * testing = testing
    * pto / cipa = plus one opt out
    * adtest = is test device
    * extras = extras
    

    In the old AdMob SDK, the uule key is used to bind up a location. Unfortunately, that is nowhere to be found in Google Play Services. That suggests that the 3rd speculation in my original question is most likely no the case. In a way, that would make sense, because that's definitely something that would've been documented somewhere, simply because of the change in required permissions.

    I'm also inclined to say that the location feature wasn't overlooked. It's not the only missing key, but most of the other mainstream ones are there, like age, gender, keyword etc. In stead, I'm starting to believe that it was left out intentionally, dropping support for it. If I were to venture a guess, then it's most likely because of privacy concerns.

    If anyone (in particular someone from Google) could confirm this, that'd be great. Also, if you find anything that contradicts these findings, most definitely leave a comment. I'm happy to be proven wrong.

    0 讨论(0)
提交回复
热议问题