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

3.3k Views Asked by At

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 ?

3

There are 3 best solutions below

0
On

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.

0
On

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.

0
On

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