How to use Google Analytics to track views of static HTML pages on file server?

倾然丶 夕夏残阳落幕 提交于 2021-01-28 06:28:32

问题


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 ?


回答1:


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.




回答2:


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.




回答3:


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."



来源:https://stackoverflow.com/questions/8894783/how-to-use-google-analytics-to-track-views-of-static-html-pages-on-file-server

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!