【问题标题】:Ads not showing for correct app package name未显示正确的应用程序包名称的广告
【发布时间】:2021-04-16 10:22:07
【问题描述】:

来自 Google Ad Manager 的实时广告未在正确的应用包名称上展示(例如 com.android.test)并返回以下错误

{
      "Code": 3,
      "Message": "No ad config.",
      "Domain": "com.google.android.gms.ads",
      "Cause": "null",
      "Response Info": {
        "Response ID": "null",
        "Mediation Adapter Class Name": "",
        "Adapter Responses": []
      }
}

测试广告单元 ID 显示正常,没有问题,但奇怪的是,如果我将应用程序包名称更改为其他名称,例如 com.android.test.devcom.android.test。暂存直播广告也将毫无问题地展示。

我见过一些人遇到过同样的问题,但它并没有真正的帮助

https://groups.google.com/g/google-admob-ads-sdk/c/xhwxgDyu5Ds/m/X09ha2L4AQAJ

https://groups.google.com/g/google-admob-ads-sdk/c/Og5Gai4Vt4g/m/I4ZVM99qBQAJ

我只使用 Google Ad Manager SDK 'com.google.android.gms:play-services-ads:19.7.0',没有使用 AdMob

提前谢谢你!

【问题讨论】:

  • 和我一样。有更新吗?
  • @AndroidGuy 我已经联系了 Google 的广告支持团队,他们能够重现该问题。他们目前仍在调查该问题,我仍在等待他们对可能解决方案的答复

标签: android ads google-ad-manager


【解决方案1】:

联系 Google Ads 支持人员后,原因是我们的应用面向 6 至 12 岁的儿童

应用需要遵守此政策 标记网站或广告请求以进行面向儿童的处理 https://support.google.com/admanager/answer/4442399?hl=en

在应用中,我们需要在MyApplication中将TagForChildDirectedTreatment设置为true,将maxAdContentRating设置为G,可以参考这个链接https://support.google.com/admanager/answer/9467073?hl=en#zippy=%2Ccode-sample-for-implementation-in-apps-for-everyone-including-children-and-families

 MobileAds.initialize(this)
 val config = MobileAds.getRequestConfiguration().toBuilder()
        .setTagForChildDirectedTreatment(TAG_FOR_CHILD_DIRECTED_TREATMENT_TRUE)
        .setMaxAdContentRating(MAX_AD_CONTENT_RATING_G).build()
 MobileAds.setRequestConfiguration(config)

希望这对面临相同问题的每个人都有帮助。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-04-22
    • 1970-01-01
    • 1970-01-01
    • 2021-03-19
    • 2017-09-03
    • 2017-12-14
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多