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

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

问题描述

我想使用遵循此官方指南

将以下内容放置在标题中:

Placed following into the header:

    <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>

Analytics同意模式适用于:

Analytics consent mode works with:

 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请求被发送到状态为204的go服务器.

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

我在做什么错了?

推荐答案

GA报告中完全不显示将'analytics_storage'设置为'denied'的匹配现在.最初,我可以在实时报告中看到它们,但现在似乎也消失了.

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天全站免登陆