I d like to have better error page reporting in Google Analytics. Currently, if someone does something on my site which causes a problem, they see an error page instead of the content they expected. The URL remains the same. So if they went to www.example.com/view_my_profile and there was a problem with their profile, they would see an error page at that URL.
What I d like to do is send Google Analytics a virtual pageview of something like www.example.com/error/view_my_profile/ (maybe an event captures the extra parameters better?). That s easy enough. But I want this virtal pageview to happen instead of the /view_my_profile real pageview. Because that real page wasn t actually viewed and it would be registering an extra pageview on my site.
Is this as simple as leaving out the _trackPageView call in the google analytics snippet below or am I asking for trouble?
var _gaq = _gaq || [];
_gaq.push([ _setAccount , UA-${gaAccount}-1 ]);
_gaq.push([ _trackPageview ]);