Posted on | May 3, 2012 | No Comments
Using Google Analytics it is possible to track pages as though a user had visited it, even if the page does not exist. This is useful for, for example, ajax form submissions – instead of redirecting to a thank-you page, you can leave the user on the same page and track a custom page (that does not exist) in Google Analytics.
Below is the minimum configuration needed to track a page asynchronously.
To submit a custom page, have the call-back of the ajax form request echo the following code:
If you are not using an ajax request to submit a form, e.g. you are submitting the form to the same page, then simply add the above code after the Google Analytics code.
Posted By:Richard Parnaby-King