vote up 1 vote down star

Hi friends,

I am using google analytics but it would only work for a live,hosted website.

Is there a way to let it work in localhost also.

Or is it possible to convert localhost to a url for example

_hxxx://localhost/xyz to _hxxx://mysite/xyz

Please help.

flag

migrated from stackoverflow.com

2 Answers

vote up 0 vote down

Presumably as your site has no domain (has no "." in it like "localhost") then you will need to set _udn="none".

This way Analytics leaves out the domain portion of it's tracking cookies. Another possible way is to setDomainName("none") in GA.js syntax. This prevents Google trying set a domain= on the cookie's and this way they will not fail.

Must admin i have not done this but it would seem the logical way to approach it. Analytics looks for and expects a domain and so fails when it doesn't get one. Stop it looking for one and it shouldn't fail.

link|flag
vote up 0 vote down

I believe you can use a host file on the IIS server and create an entry for whatever domain you want, then point it to 127.0.0.1 .

link|flag

Your Answer

Get an OpenID
or
never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.