Google Analytics 同意模式(测试版)- 发送数据但未反映在仪表板上 [英] Google Analytics Consent mode (beta) - Sends data but is not reflected on dashboard

查看:14
本文介绍了Google Analytics 同意模式(测试版)- 发送数据但未反映在仪表板上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想按照官方指南

将以下内容放入标题:

    <script>
 

     window.dataLayer = window.dataLayer || [];
      function gtag(){dataLayer.push(arguments);}
    
      gtag('consent', 'default', {'ad_storage': 'denied', 'analytics_storage': 'denied'});
     
    </script>
        
    <script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXX"></script>
    <script>
      window.dataLayer = window.dataLayer || [];
      function gtag(){dataLayer.push(arguments);}
      gtag('js', new Date());
    
      gtag('config', 'G-XXXXXXXX');
    </script>

分析同意模式适用于:

 gtag('consent', 'default', {'ad_storage': 'denied'})

但是,如果我在如下设置中拒绝 cookie,则不再有效(仪表板上没有用户活动):

However no longer works (no user activity on dashboard) if I deny cookies in the settings like so:

gtag('consent', 'default', {'ad_storage': 'denied', 'analytics_storage': 'denied'});

我的理解是它仍然应该反映没有 cookie 的页面点击.

My understanding is that it should still reflect page hits without the cookie.

我可以看到 POST 请求被发送到他们的 go 服务器,状态为 204.

I can see the POST request being sent to their go server with status 204.

我做错了什么?

推荐答案

'analytics_storage' 设置为 'denied' 的点击根本不显示在 GA 报告中现在.最初我可以在实时报告中看到它们,但现在似乎也不见了.

The hits with 'analytics_storage' set to 'denied' are not shown in GA reports at all now. Initially I could see them in the real-time report, but now that seems to be gone too.

话虽如此,可以使用 customTask API 操作请求并重写 'gcs' 参数(或完全删除它).这样,您将在不使用 cookie 的情况下在 GA 中看到匿名(在用户级别)点击.

Having said that, it is possible to manipulate the request with the customTask API and rewrite the 'gcs' parameter (or drop it altogether). This way, you would see the anonymized (on user level) hits in GA while not using cookies.

这篇关于Google Analytics 同意模式(测试版)- 发送数据但未反映在仪表板上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆