Firefox增强的隐私保护功能阻止将数据层推送到Google跟踪代码管理器 [英] Firefox Enhanced Privacy Protection is blocking Datalayer push to Google Tag Manager

查看:118
本文介绍了Firefox增强的隐私保护功能阻止将数据层推送到Google跟踪代码管理器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在过去的几周中,我已经意识到,我们建立和维护的网站在Google Analytics(分析)中的转化跟踪每天减少了大约20%-40%。

Over the past few weeks I've realised that the conversion tracking in Google Analytics of a website we built and maintain has been off by about 20% - 40% each day.

在除Firefox以外的任何浏览器中进行测试时,一切正常,您可以看到转化立即推送到Google Analytics(分析)中。

When testing in any browser but Firefox, everything works fine and you can see conversions pushing into Analytics straight away.

但是,在Firefox中,当您启用增强隐私保护后,(现在默认情况下它已打开),您会收到以下错误:

However, in Firefox, when you have Enhanced Privacy Protection turned ON, (it comes switched on as default now) you get the following error:


跨域请求被阻止:相同来源策略不允许读取 https://www.googleadservices.com/pagead/conversion/957837126/wcm?cc=ZZ&dn=01858439338&cl=ITVOCP2S_34Qxt7dyAM&ct_eid一个>。 (原因:CORS请求未成功。)

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://www.googleadservices.com/pagead/conversion/957837126/wcm?cc=ZZ&dn=01858439338&cl=ITVOCP2S_34Qxt7dyAM&ct_eid=2. (Reason: CORS request did not succeed).

关闭增强型隐私保护后,它便会正常工作。

As soon as you switch off Enhanced Privacy Protection it works perfectly.

我用来推送到数据层的代码,如果它与任何相关性是:

The code I am using to push to datalayer, if its of any relevance is:

<script type="text/javascript">
  document.addEventListener( 'wpcf7mailsent', function( event ) {
   window.dataLayer.push({
      "event" : "cf7submission",
      "eventAction": "FormSubmission",
      "eventCategory": "Contact Form Submission",
      "eventCallback" : function() {
        // Firefox never gets to run this callback to redirect page - which is what triggered further investigation.
        window.location.href = "https://www.domain.co.uk/thank-you/"; 
        return false;
      },
      "eventTimeout" : 2000 // I had to add this in so that it still redirects to thank you when datalayer push fails.
    });    
  }, false );
</script>

事件侦听器仅检查站点何时发送电子邮件,然后检查其余部分是推入数据层进行跟踪,然后在完成后重定向到谢谢页面。

The event listener is just to check when the email has been sent by the site, and then the rest is to push into Data Layer for tracking and then redirect to thank you page upon completion.

在我看来,这绝对不是与 CORS 相关的错误,因为该请求是来自我们本地的具有正确标题的脚本。代码可以在所有其他浏览器中正常使用。

In my opinion this is definitely not a CORS related error in the sense that the request is coming from our local script with the correct headers. Code works in all other browsers with no issue.

Firefox的页面 https://developer.mozilla.org/zh-CN/docs/Web/HTTP/CORS/Errors/CORSDidNotSucceed 尝试解释为什么会出现错误:

Firefox has this page https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS/Errors/CORSDidNotSucceed to try to explain why we're getting the error:

原因1:


其证书错误:它的Google,不是证书错误

Its Certificate error : Its Google, it's not a cert error

原因2:


HTTP到HTTPS的请求:使用我们加密SSL的站点上的HTTPS

HTTP to HTTPS request : HTTPS on site with Let's Encrypt SSL

原因3:


不允许访问本地主机:这不是本地主机,并且是活动站点

Not permitted to access localhost : This isn't localhost and is live site

原因4:


服务器没有响应:再次是Google,它对所有内容都做出了响应。

Server didn't respond : Again, it's Google, it responds to everything.

TLDR:
Firefox阻止了数据层pu启用增强隐私功能时启用sh,但应允许标准转化跟踪脚本与其自己的文档一起运行。为什么会阻塞我们,我需要解决什么代码?

TLDR: Firefox is blocking datalayer push when Enhanced Privacy is turned on, but should be allowing a standard conversion tracking script to run in line with their own docs. Why is it blocking us and what code do I need to get around it?

UPDATE

我已经找到此链接 https:// developer.mozilla.org/zh-CN/docs/Mozilla/Firefox/Privacy/Tracking_Protection 其中说:

I've found this link https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Privacy/Tracking_Protection which says:


Firefox如何选择阻止的内容?

根据要加载内容的域来阻止内容。

Content is blocked based on the domain from which it is to be loaded.

Firefox附带了一个站点列表,这些站点被标识为参与用户跨站点跟踪的
。启用
跟踪保护后,Firefox会阻止列表中网站的内容。

Firefox ships with a list of sites which have been identified as engaging in cross-site tracking of users. When tracking protection is enabled, Firefox blocks content from sites in the list.

跟踪用户的网站通常是第三方广告,
分析网站

Sites that track users are most commonly third-party advertising and analytics sites.

Firefox现在是否严重阻止了Google Analytics(分析)进行标准转化跟踪?

Is Firefox seriously blocking Google Analytics on standard conversion tracking now?

推荐答案

在某种程度上,我似乎对最初的假设是正确的。
Firefox现在默认情况下不会阻止所有分析访问,但是会阻止任何与广告相关的尝试发送与广告相关的转化或跟踪代码。

It looks like I was correct with my original assumptions, to a certain degree. Firefox isn't blocking all analytics access by default now, but it is blocking anything ad related that tries to send conversion or tracking code related to ads.

因此,如果您

Firefox已经选择了自己的目标清单,试图在完成与广告有关的活动后激发目标,而该目标将被阻止,而其他与跟踪有关的脚本也将运行。

Firefox has chosen its own list of what it believes to be third party tracking scripts and by default, its blocking them all now.

有趣点

Google很明显Chrome依赖于此跟踪转化数据,因此Chrome在实施任何阻止广告相关流量的方法方面都远远落后于后者,因为这些流量是他们赚钱的地方,因此阻止自身毫无意义。他们目前在使用方面拥有超过60%的市场份额( https://en.wikipedia.org/wiki / Usage_share_of_web_browsers ),因此您现在可以进行跟踪了。

Google obviously relies on this tracking conversion data and as such Chrome is quite far behind in implementing anything to block ad related traffic, its where they make their money so it wouldn't make sense to block themselves. They currently have over 60% market share in regard to usage (https://en.wikipedia.org/wiki/Usage_share_of_web_browsers) so your tracking is going to be ok for now.

但是,无论是Safari还是Firefox,都没有依靠广告收入实施严格的跟踪措施。

However, both Safari and Firefox, neither of which rely upon ad revenue have implemented strict measures for tracking.

Safari& Firefox

Firefox会全力以赴并阻止与第三方源相关的跟踪脚本。请注意第三方,即当广告客户将其脚本嵌入到您的网站中时。

Firefox goes all out and blocks tracking scripts related to third party sources. Take note of the 'third party', its when an advertiser is embedding their script on your site.

Safari则更进一步,它将自动删除所有与跟踪相关的信息不在网站上7天后的Cookie。 $ b $ $ b $这将使您的数据消失,尽管它仍然会显示访问者,但他们将显示为新访问者,而不是回访者

Safari, on the other hand has gone a step further and will auto delete ALL tracking related cookies after 7 days of not being on the site. This is going to knock your data way off as although it will still show visitors, they'll show as new visitors instead of returning visitors.

结论

现在,我觉得这是网站所有者传统转换和广告跟踪结束的开始,这是由于这些浏览器的更改开始受到人们的欢迎。

Right now, I feel like this is the beginning of the end of traditional conversion and ad tracking for website owners and something is due to change in the near future as these browser changes start to bite.

我暂时不知道有什么办法可以解决这个问题。我尝试过尝试使用代理来绕过跟踪嵌入,但是在不知道Google在每个脚本调用中如何跟踪以及跟踪什么的情况下,不可能将提交内容欺骗进行分析。

I don't know of any way to get around this for now. I explored trying to use a proxy to get around the tracking embeds, but without knowing how and what Google tracks on each script call, it was impossible to spoof the submissions to analytics.

这篇关于Firefox增强的隐私保护功能阻止将数据层推送到Google跟踪代码管理器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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