Link Building using 404 Error Reports
If you have a domain that’s been around for a while there are probably some links pointing to URLs on your site that don’t exist any more.
You can identify some of these brokens links by tracking your 404 error page with analytics and then either get the links updated or set up redirects to take advantage of lost traffic and PageRank.
Error tracking is a surprisingly weak area of most analytics packages. Google Analytics provides no error page tracking by default but it’s not to hard to set it up. You simply need to add some custom tracking code to your errors pages.
You have to update the line in the tracking code from…
pageTracker._trackPageview();
to the new code…
pageTracker._trackPageview(“/404.html?page=” + document.location.pathname + document.location.search + “&from=” + document.referrer);
After you’ve updated the code, a page view will be tracked every time someone visits your error 404 page and you will be able to see it in the Google Analytics’ content report.
The name of the page in the content report will include the text ’404′ at the start so it’s easy to find using the search filter. It also includes the URL that was broken and the referring URL that contained the broken link.
Once you’ve had the tag running for a while, you will have some great data showing you all the broken links that have driven traffic to your site as well as any broken internal links.
You can now approach the webmasters of any sites that contain a broken link to your site. If you can’t get them to update the link then you can always set up a redirect on our own site to point a related page.
The difference between this method of finding broken inbound links over other sources, such as Webmaster Tools, Yahoo Site Explorer etc, is that you know that the link has driven real visitors and therefore has some value even if it doesn’t guarantee any PageRank value. The inbound link data sources are also far from comprehensive and may not have indexed all the broken links.
You can read more about the custom code on the Google Analytics Help site.
For additional bonus points you can also modify the code to track other error such as an error 500 which might be generated by some types of broken URLs on your site.
Note: If you’re using WordPress then the rather execellent Analytics Plugin from Joost de Valk add the custom GA code automatically. Go get it.
