如何使用 Google Analytics 跟踪文件服务器上静态 HTML 页面的视图?

发布于 2024-12-27 13:44:23 字数 154 浏览 4 评论 0原文

我在 file:///c:/Path/Index.html 设置了一个简单的 Intranet,我想通过 Google Analytics 跟踪它的使用情况。

因为它的协议是“file:”,而不是“http:”,所以它没有域名。有没有办法使用 Google Analytics?

I have set up a simple intranet at file:///c:/Path/Index.html and I'd like to track its use with Google Analytics.

Because its protocol is 'file:', not 'http:', it does not have a domain name. Is there a way to use Google Analytics anyway ?

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

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

发布评论

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

评论(3

猫烠⑼条掵仅有一顆心 2025-01-03 13:44:23

如果您打开文件审核,您可以使用它查看访问日志,但除了添加网络服务器应用程序之外,我看不到这如何与谷歌一起使用。

If you turn on file auditing you can view access logs with that, but other than adding a web server app I can't see how this would work with google.

や三分注定 2025-01-03 13:44:23

任何在本地访问的网页,cookie 都将由 Google Analytics 生成,并且不会被记录,仅仅是因为没有要记录的域。

如果您想在 Google Analytics 中测量数据,则需要您的 Intranet 在 Web 服务器内启动并运行。

没有被重定向到本地主机,而是被重定向到虚构的域。

Any web page that is accessed locally, the cookies will be generated by Google Analytics and will not be recorded, simply because does not have a domain to be recorded.

If you want to measure your data in Google Analytics requires that your intranet is up and running within a Web Server.

Not being redirected to the Local Host but to a fictitious domain.

空城缀染半城烟沙 2025-01-03 13:44:23

我正在寻找有关在静态 HTML 上实施谷歌分析的信息,遇到了这个官方谷歌信息 -
https://support.google.com/analytics/answer/1008080?hl= en

“静态网站
静态网站是指页面 HTML 不是使用 Python、Ruby、PHP 等编程语言或界面生成的网站。要收集数据,您必须将 Analytics 跟踪代码复制并粘贴到您访问的每个网页的源代码中。希望追踪。
获得您的资源的 Javascript 跟踪代码段后,请准确复制该代码段,而无需对其进行编辑。
将您的跟踪代码片段(完整且未更改)粘贴到您希望跟踪的网站上每个网页的结束标记之前。
如果您希望一次性从网页收集数据到多个媒体资源,请了解如何使用多个帐户或媒体资源跟踪页面。”

I was looking for information on implementing google analytics on static HTML, came across this official google info -
https://support.google.com/analytics/answer/1008080?hl=en

"Static website
A static website is one in which the page HTML is NOT generated using a programming language or interface such Python, Ruby, PHP, etc. To collect data, you must copy and paste the Analytics tracking code into the source code on every web page you wish to track.
Once you have the Javascript tracking code snippet for your property, copy the snippet exactly without editing it.
Paste your tracking code snippet (unaltered, in its entirety) before the closing tag on every web page on your site you wish to track.
If you wish to collect data from web pages to multiple properties at once, learn how to track a page using multiple accounts or properties."

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