Why are URLs with my domain name at the end showing up in analytics?

It could happen if you have link like this in your template that is missing the http://

<a href="www.domain.com">

It could happen if you use your domain name in a javascript string. Some bots are known to try to crawl all javascript strings as if there were urls.

var site = 'www.domain.com';

I found your site using the allinurl: operator and google and looked through the source code for couple of the pages. I didn't find anything that resembled either of the above senarios.

It could happen if redirects from the old domain were not working in some cases. I'd think you would be able to test the redirects and find that problem.

So, I'm not sure what is causing it. If you want to fix it, you can redirect away from any url that ends in your domain name with a rewrite rule. The following will strip off the "www.domain.com" bit and redirect to a url without it.

RewriteRule (.*)www.domain.com$ $1 [R=301,L]

You can do this by doing the following steps:

  • Login to Google Analytics
  • Click admin (upper right corner)
  • Click on the profile associated with the domain that you're having an issue with.
  • Click profile settings
  • Check the "Default Page" field, if it has your domain name in there, delete it and press apply.

Why?

The Default Page field is for the index.html, index.php or similar. This field allows GA to treat http://yourdomain.com/index.php as the same page as http://yourdomain.com/.