Google Analytics '/' and '/index.html' Tracked Separately?


#1

Okay so recently I have noticed that when viewing my web stats in Google Analytics my homepage is being listed twice within reports. Once as simply as / and then as mydomaindotcom/index.html

After looking around the GA help files I found the following article: http://support.google.com/analytics/bin/answer.py?hl=en&answer=1009675

It states that "You can configure Google Analytics to treat them as the same page by defining the Default page for your profile". It then continues to advise that under Main Website Profile Information "in the Default page text box, enter the default (or index) page for this domain. This is the page that loads when a visitor enters only the domain of your site into their address bar. For example, if www.exampledotcom loads your index.html web page, enter index.html in this text box."

If I type mydomain into the browser the at first page it loads the file index.html but in the address bar it simply reads mydomaindotcom/ it is only when I then go back to the home page that it then changes the address to include index.html. I know this is the case as in my code any links to the homepage are coded as fulldomaindotcom/index.html

It is slightly confusing me and I don't want to mess up my analytic reports or anything. Which value should I set as the default page? (At the moment it is currently empty) Has anyone else how this problem and had did you overcome it?

Thanks in advance.


#2

I think that's where the real problem lies. All of your links should be to fulldomain.com, not to fulldomain.com/index.html. That will mostly get rid of the problem. But if you really want to get rid of the duplication altoghether, the next step would be to create a rule in a .htaccess file that redirects fulldomain.com/index.html to fulldomain.com/. Doing it via analytics is not the best way to go. Better to stop the problem where it's actually being created.


#3

Thanks Ralph, I realise this now. To clarify am I right in thinking that I would still save the file as index.html and then upload it to the root directory on my web server. Then whenever I link to the homepage from any of my pages use fulldomain.com/. As no filename is included in the URL the server will then load the index.html from the root directory by default?

Will this method stop analytics from tracking "/" and "index.html" separately? Ideally I just want it to track "/" then I wont have any issues with duplicates when producing reports etc.

Also if I was to recode the links as above would this have any impact on Search Engine Ranking, as the site is gradually making some good progress and I would not want to jeopardize this? From what I can see so far whenever the homepage is listed on SERPs it does not include the file extension .html

Thanks


#4

Essentially your server is set to treat / as index.html [then index.php, index.asp, etc] so the issue isn't in your settings or the name of the file but rather in the links you created.

Remove all of links to index.html and just link them to / {href="/"} and you're set [don't use the domain, that's an absolute link when it's not needed]. Analytics won't see this retroactively but it's ideal to have just one url for one page for users, scripts and search.


#5

Yes indeed, as Ted explained above.

Will this method stop analytics from tracking "/" and "index.html" separately? Ideally I just want it to track "/" then I wont have any issues with duplicates when producing reports etc.

Not necessarily. If there are any links specifically to index.html, they may be viewed separately by Google. Removing all links to index.html will help, but to be sure there is no duplication, the htaccess method (choosing one or the other) is safer ... though I don't bother with it myself.

Also if I was to recode the links as above would this have any impact on Search Engine Ranking ... so far whenever the homepage is listed on SERPs it does not include the file extension .html

Given your last comment, I suspect it won't have an effect. Anyhow, better to get it done sooner rather than later. smile


#6

Thanks, I will change my code as you suggested. Think while I am on I will double check all my links / structure.

For now I am going to remove all links to index.html and see whether that sorts out the issue... I have no experience working with htaccess files so will see what impact this change has before going down that route.

As for the SEO stuff I will just keep an eye on things, but I am hoping it won't have any effect smile


#7