Keep Google From Linking To Your Virtual Analytics Pagenames

I was checking the error logs in Apache and noticed something strange. There were requests being made to Analytics virtual pagenames. I wouldn’t have thought that Google or anyone would assume that to be the case since it was in the onclick and in the Analytics method name.

It was troubling, was not that Google was trying to archive them, Google won’t and no other search engine should either because going there will result in a 404, which search engines usually drop. What was troubling was that it was generating a lot of errors and filling the error log with useless and redundant errors.

Oh yeah, it is a good idea to look at the error logs. I’ve also found that missing “favicon.ico” will also generate a lot of 404 hits in your error log, as well as “robots.txt”. If you want to remove the useless errors and keep what is in the error log without additional padding, then add those files, even if they are empty. Well, place this code:

User-agent: *
Disallow:

Check out Robots.txt Info Site for more tips and examples.

The Solution

The solution is to take the analytics code:

pageTracker._trackPageview('/this/is/virtual/pagename');

Then take the “/this/is/virtual/pagename” text and add that to the robots.txt file.

User-agent: *
Disallow: /this/

It seems also that Google and probably other search engines will extract anything that looks like a link and try to see if it is a link or not. This is not always a good solution and causes problems, like for example bloating the error.log file to proportional extremes.

Possibly Related Posts:


Comments are closed.