You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

升级Google Consent Mode V2后Logcat无ad_personalization相关日志

我按官方文档升级到Google Consent Mode V2后,Android Studio的Logcat里只能看到analytics_storage=granted、ad_storage=granted、ad_user_data=granted的授权设置日志,完全找不到ad_personalization=denied或ad_personalization=granted的相关日志。

排查方向和解决办法

  • 漏设ad_personalization状态
    Consent Mode V2要求显式配置全部5种授权类型,要是代码里只设置了前三个,自然不会输出ad_personalization的日志。检查你的代码,确保加上该字段的状态设置,比如:

    val consentSettings = mapOf(
        "analytics_storage" to ConsentStatus.GRANTED,
        "ad_storage" to ConsentStatus.GRANTED,
        "ad_user_data" to ConsentStatus.GRANTED,
        "ad_personalization" to ConsentStatus.DENIED // 必须显式指定这个字段
    )
    ConsentInformation.getInstance(context).updateConsentStatus(consentSettings, null)
    
  • Logcat过滤规则挡了日志
    看看你的Logcat是不是设了太严格的过滤条件,比如只搜了特定关键词,导致ad_personalization的日志被过滤掉了。直接清空过滤,搜ad_personalization关键词试试。

  • SDK版本太旧
    检查下集成的Consent SDK是不是最新稳定版,旧版本可能存在日志输出不全的问题,升级到官方推荐的版本再测试。

  • 授权状态没变化,SDK不重复输出
    如果之前已经设置过ad_personalization的状态,这次没修改的话,SDK可能不会重复打相同状态的日志。可以重置用户授权状态后重新设置,再看日志会不会出来。

内容的提问来源于stack exchange,提问作者Langgan

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.30 08:23:20