Tracking AJAX requests in Google Analytics is easy as described in the Google help center. When we use the Grails
pageTracker._trackPageview('/formsubmitted') and the "page" formsubmitted will show up in the Google Analytics reports.
The following snippet shows how we can use the
onSuccess attribute to execute this code:
<g:formRemote name="formname" method="GET" url="[action:'handleSubmit']" onSuccess="if (pageTracker) pageTracker._trackPageView('/reservation');"> ... form fields here ... </g:formRemote>