升级Google Consent Mode V2后Logcat无ad_personalization相关日志
Consent Mode V2 无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
相关产品推荐
相关产品推荐

