Google Analytics 如何将数据发送回 Google? [英] How does Google Analytics send data back to Google?

查看:31
本文介绍了Google Analytics 如何将数据发送回 Google?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

也许我遗漏了一些东西,但我只是在学习 JavaScript.

我对 Single Origin Policy 的理解是,Google Analytics 不应将数据发送回 Google.

如何在不违反政策的情况下向 Google 发送数据?

解决方案

据我所知,一个网页包含来自 Google 的 JavaScript 文件,然后该脚本动态地将图像添加到页面 (http://www.google-analytics.com/__utm.gif),其中包含记录所需的信息.>

SOP 不适用于动态添加到页面的脚本、图像或 CSS 文件.这就是为什么您非常信任您在网页中包含的任何 JavaScript 文件的原因,因为它们将完全控制页面.

Perhaps I am missing something, but I am just learning javascript.

My understanding of Single Origin Policy is that Google Analytics should not be able to send data back to Google.

How is it able to transmit send data to Google without violating the policy?

解决方案

From what I can tell, a webpage includes the JavaScript file from Google, then that script dynamically adds an image to the page (http://www.google-analytics.com/__utm.gif) which contains the information required for logging.

SOP does not apply to scripts, images or CSS files that are dynamically added to a page. This is why you much trust whatever JavaScript files you include in your webpages, as they will have complete control over the page.

这篇关于Google Analytics 如何将数据发送回 Google?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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