Skip to content

Google Analytics with AJAX calls

Right so been playing around with Google Analytics, and one of the problem I had was that I can’t track AJAX calls, since they do not reload the page, and even if the ajaxed in content has GA it will not be executed anyway.

Google’s own documentation, as well as a few blogs out there suggests the use of


But ever since Google moved to ajax async tracker, this no longer works, instead do the following:

_gaq.push(['_trackPageview', URL);

Basically we want to call this to add a new page onto the tracker’s send queue everytime we ajax in a content we want to track.

Posted in Technology. Tagged with .