404 Code for Google Analytics

Scripts to include to show referrer path of 404 links

by Virtual

HTML

<!-- head -->
<meta name="Keywords" content="error404" />
<meta name="robots" content="noindex, follow" />
<meta name="description" content="error 404 page for bad links or missing pages" />
<script type="text/javascript"> 
var _gaq = _gaq || []; 
_gaq.push(['_setAccount', 'UA-4471790-1']); 
_gaq.push(['_trackPageview', '/404.php?page=' + document.location.pathname + document.location.search + '&from=' + document.referrer]);
(function() { 
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; 
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; 
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(ga); 
})(); 
</script>
<!-- -->