简体   繁体   English

gtag:为什么谷歌分析即使没有被授权也会收集数据

[英]gtag: why does google analytics collects data even if not granted

So I'm making a GDPR, CCPA... compliant Next.js App with cookie consent and preferences and need to implement Google Anayltics with Google Tag Manager with Consent.因此,我正在制作一个符合 GDPR、CCPA 的 Next.js 应用程序,并获得 cookie 同意和偏好,并且需要通过 Google 跟踪代码管理器和同意来实施 Google Anayltics。

_app.js: _app.js:

...
<Script src={`https://www.googletagmanager.com/gtag/js?id=${googleTagId}`} strategy="afterInteractive" />
<Script
    id="gtag"
    strategy="afterInteractive"
    dangerouslySetInnerHTML={{
        __html: `
            window.dataLayer = window.dataLayer || [];
            function gtag(){dataLayer.push(arguments);}
            
            gtag('consent', 'default', {
                'ad_storage': 'denied',
                'analytics_storage': 'denied',
            });

            (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','My Id from gtag code...');
        `
    }}
/>

But when I go to my app I can see that Google anayltics collects data without prior consent (denied in consent gtag function).但是当我 go 到我的应用程序时,我可以看到 Google anayltics 在未经事先同意的情况下收集数据(在同意 gtag 功能中被拒绝)。 See this image看到这张图片

Only after the user consented with this code it should collect data:只有在用户同意此代码后,它才应该收集数据:

gtag('consent', 'update', {
    'ad_storage': 'granted',
    'analytics_storage': 'granted',
});

Why is it collecting data without prior consent, when everything is set to denied?当一切都设置为拒绝时,为什么要在未经事先同意的情况下收集数据?

This happens because Google applies modeling , that is, if you deny consent to analytical cookies, the hits are sent anonymously rather than lost.发生这种情况是因为 Google 应用了建模,也就是说,如果您拒绝同意分析 cookies,命中将匿名发送而不是丢失。

Behavioral modeling for consent mode aims at filling this data gap by modeling the behavior of users who decline analytics cookies based on the behavior of similar users who accept analytics cookies.同意模式的行为建模旨在通过根据接受分析 cookies 的类似用户的行为对拒绝分析 cookies 的用户的行为进行建模来填补这一数据空白。 The training data used for modeling is based on the consented user data from the property where modeling is activated.用于建模的训练数据基于来自激活建模的属性的同意用户数据。

For example, behavioral modeling estimates data based on user and session metrics, such as daily active users and conversion rate, that may be unobservable when identifiers like cookies or user IDs are not fully available.例如,行为建模基于用户和 session 指标(例如每日活跃用户和转化率)估计数据,当 cookies 等标识符或用户 ID 不完全可用时,这些数据可能无法观察到。 Without modeling, you have a less complete understanding of user behavior on your site based only on the observed data you have available.如果没有建模,您仅基于可用的观察数据对您网站上的用户行为的了解不够全面。

https://support.google.com/analytics/answer/11161109?hl=en https://support.google.com/analytics/answer/11161109?hl=en

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM