4

I'm making a webpage for the users to open directly from their local drives with Internet Explorer. I want to use Google Analytics on these pages.

I added the Google Analytics tracking code to the page, but it doesn't seem to be working.

Is it possible to use Google Analytics for local pages? If so, how?

ronalchn
  • 12,225
  • 10
  • 51
  • 61
sol1000
  • 141
  • 1
  • 6

3 Answers3

5

I have tested some settings according to this post and it seems to work fine.

Shortly, you need to setup few things.

DomainName whether is set or not should be none.

_gaq.push(['_setDomainName', 'none']);

Additionally change google js url from ga.js to: u/ga_debug.js

 ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/u/ga_debug.js';

What may be interesting that at first glance google analytics seems to be not working on this site (my local site). After half or maybe an hour it starts recording actions.

Good luck!

dicoder
  • 111
  • 2
  • 2
  • This really solved my problem for my local rails application tracking, using http://localhost. As WEB URL "localhost" is not allowed in GA, when 127.0.0.1 is allowed. But my 127.0.0.1 is occupied by the apache project. This method really helps. Thanks – zhihong Nov 28 '13 at 11:13
  • This does not seem to work anymore. In the log it reads "Local file. Aborting hit." – Carson Ip Jun 06 '14 at 08:37
  • You're probably right. Check this post: http://stackoverflow.com/questions/4375447/can-you-test-google-analytics-on-a-localhost-address – dicoder Nov 18 '14 at 10:04
2

It is not possible to use Google Analytics Tool for local Pages. Because, if you insert the tracking Code in your page, Google Analytics is trying to connect and check the tracking code on your domain and this don´t work.

Rene Herget
  • 1,506
  • 13
  • 28
0

there is one way you can do it, just configure you webpage/site to iis, then you can track that site/page for "localhost / 127.0.0.1"

in short, you can create GA for localhost also.you should surf on it

Raj Tamakuwala
  • 1,163
  • 1
  • 9
  • 18