网站分析,GTM和http / 2推送

时间:2021-07-11 13:37:05

If javascripts from Google Analytics, Google Tag Manager and/or other javascripts doing a kind of web analytics, are implemented with a HTTP/2 push - does it, and if yes, how, manipulate/falsify the measuring results?

如果来自Google Analytics,Google跟踪代码管理器和/或其他javascripts的javascripts执行某种网络分析,则使用HTTP / 2推送实现 - 如果是,那么如何操纵/伪造测量结果?

1 个解决方案

#1


1  

Shouldn’t have any effect.

不应该有任何影响。

Push is about delivering assets (e.g. javascript files) to the web browser before they are asked for. Google Analytics (GA) and Google Tag Manager (GTM) only do stuff when the scripts are executed - so getting the GA file for example via push, pull, or loaded from cache doesn’t matter until that file is run and it registers a hit, or loads the tags that register the hits.

推送是指在要求之前将资产(例如javascript文件)传送到Web浏览器。 Google Analytics(GA)和Google跟踪代码管理器(GTM)仅在脚本执行时执行操作 - 因此,通过推送,拉取或从缓存加载来获取GA文件无关紧要,直到该文件运行并注册点击或加载注册命中的标记。

In fact, at a technical level, HTTP/2 push doesn’t even push any files directly to the page, but pushes it to a push cache, and which the browser checks first before requesting a file.

事实上,在技术层面,HTTP / 2推送甚至不会将任何文件直接推送到页面,而是将其推送到推送缓存,并且浏览器在请求文件之前首先检查。

So the only change should be that, if you have set up HTTP/2 push correctly, then the browsers that support that might be able to execute them fractionally earlier as the pushed file should hopefully already be downloaded when it’s needed. This might, for example, register more a accurate start time on the page (though to be honest it shouldn’t be massively different for the level of accuracy that these tools give). However, on the flip side, if you are currently inlining the GA code and change this to an external (pushed) js file then you might lose a tiny bit of time as there are still some overheads to processing a separate file, even if it is pushed to arrive before it’s needed. But again this time used shouldn’t really be noticed.

所以唯一的变化应该是,如果你已经正确设置了HTTP / 2推送,那么支持它的浏览器可能能够稍早地执行它们,因为推送文件应该在需要时已经下载。例如,这可能会在页面上注册更准确的开始时间(但老实说,这些工具给出的准确度水平不应该大不相同)。但是,另一方面,如果您当前正在内联GA代码并将其更改为外部(推送)的js文件,那么您可能会丢失一点时间,因为处理单独的文件仍有一些开销,即使它*在需要之前到达。但是这次使用的时间不应该被注意到。

Saying that you need to be careful with push and shouldn’t waste users bandwidth pushing assets they already have (e.g. if you push the GA js file with every request even though it’s cached). Won’t affect the accuracy it’s just a waste of bandwidth.

说你需要小心推送,不应该浪费用户带宽推动他们已经拥有的资产(例如,如果你按照每个请求推送GA js文件,即使它被缓存)。不会影响准确性,这只是浪费带宽。

Thanks, Barry

谢谢,巴里

#1


1  

Shouldn’t have any effect.

不应该有任何影响。

Push is about delivering assets (e.g. javascript files) to the web browser before they are asked for. Google Analytics (GA) and Google Tag Manager (GTM) only do stuff when the scripts are executed - so getting the GA file for example via push, pull, or loaded from cache doesn’t matter until that file is run and it registers a hit, or loads the tags that register the hits.

推送是指在要求之前将资产(例如javascript文件)传送到Web浏览器。 Google Analytics(GA)和Google跟踪代码管理器(GTM)仅在脚本执行时执行操作 - 因此,通过推送,拉取或从缓存加载来获取GA文件无关紧要,直到该文件运行并注册点击或加载注册命中的标记。

In fact, at a technical level, HTTP/2 push doesn’t even push any files directly to the page, but pushes it to a push cache, and which the browser checks first before requesting a file.

事实上,在技术层面,HTTP / 2推送甚至不会将任何文件直接推送到页面,而是将其推送到推送缓存,并且浏览器在请求文件之前首先检查。

So the only change should be that, if you have set up HTTP/2 push correctly, then the browsers that support that might be able to execute them fractionally earlier as the pushed file should hopefully already be downloaded when it’s needed. This might, for example, register more a accurate start time on the page (though to be honest it shouldn’t be massively different for the level of accuracy that these tools give). However, on the flip side, if you are currently inlining the GA code and change this to an external (pushed) js file then you might lose a tiny bit of time as there are still some overheads to processing a separate file, even if it is pushed to arrive before it’s needed. But again this time used shouldn’t really be noticed.

所以唯一的变化应该是,如果你已经正确设置了HTTP / 2推送,那么支持它的浏览器可能能够稍早地执行它们,因为推送文件应该在需要时已经下载。例如,这可能会在页面上注册更准确的开始时间(但老实说,这些工具给出的准确度水平不应该大不相同)。但是,另一方面,如果您当前正在内联GA代码并将其更改为外部(推送)的js文件,那么您可能会丢失一点时间,因为处理单独的文件仍有一些开销,即使它*在需要之前到达。但是这次使用的时间不应该被注意到。

Saying that you need to be careful with push and shouldn’t waste users bandwidth pushing assets they already have (e.g. if you push the GA js file with every request even though it’s cached). Won’t affect the accuracy it’s just a waste of bandwidth.

说你需要小心推送,不应该浪费用户带宽推动他们已经拥有的资产(例如,如果你按照每个请求推送GA js文件,即使它被缓存)。不会影响准确性,这只是浪费带宽。

Thanks, Barry

谢谢,巴里