Is there a way to define a callback for when _trackPageview completes?
I have the following code to track when a user logs into my site, and to refresh the page afterwards:
pageTracker._trackPageview('/login/complete');
location.reload(true);
The problem with the above code is that _trackPageview attaches an image to the DOM and there’s no guarantee that the image loads before the page refreshes.
Overwriting the current
Image()function in the page is one solution:But I actually think that Malvolio has a better solution using
_gaq.push()that will work for what you need.