Google Analytics(GA4)反初始化的反浏览量

发布于 2025-02-09 17:42:48 字数 561 浏览 1 评论 0原文

我对GA4有问题。

我需要用户第一次访问该网站(当他没有任何cookie Google时)与第一个页面浏览发送了一个cookie _ga 存储 client Id 和另一个带有信息的cookie关于会话。

ga3 计数器的先前版本中,您可以使用参数 gtag('config','ua-xxxxxxx-yy',{send_page_view:false}) 在这种情况下,计数器将创建一个cookie,但不会发送pageview。创建cookie后,我们以 gtag('config',....)带有 clientId 参数。

但是在GA4中,当使用 gtag('config','sucurement_id',{send_page_view:false})根本没有设置cookie。

有人知道如何创建cookie,但没有发送pageview?

没有GTM!

I have a problem with GA4.

I need the first time a user visits the site (when he does not have any cookies google) with the first pageview sent a cookie _ga which stores ClientID and another cookie with information about the session.

In previous version of GA3 counter you could use parameter gtag('config', 'UA-XXXXXX-YY', { send_page_view: false })
In that case, the counter would create a cookie, but would not send pageview. After creating the cookie, we sent gtag('config', .... ) with the ClientID parameters we wanted.

But in GA4 when using gtag('config', 'MEASUREMENT_ID', { send_page_view: false }) the cookie is not set at all.

Does anyone know how to make the cookies are created but the pageview is not sent?

Without GTM!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

迷乱花海 2025-02-16 17:42:48

我遇到了同样的问题。

广告阻滞剂

检查是否没有任何阻止浏览器中的GA发送给GA,例如广告阻滞剂甚至Firefox:

数据层的错误调控

可能会损坏您的数据层。尝试从GA复制确切的片段。

cookie同意工具

也许可能有些同意工具阻止cookie,请尝试:

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

最终

,如果一切都可以,GA将发送收集请求:

“在此处输入图像描述”

I had the same problem.

Ad blockers

Check if nothing is blocking the sending to GA in your browser, like AD blockers or even Firefox:

enter image description here

Misconfiguration of data layer

Maybe your data layer is corrupted. Try to copy the exact snippet from GA.

Cookie Consent Tools

Maybe some Consent Tools are blocking cookies, try:

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

Final

If all it's ok, GA will send collect requests:

enter image description here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文