Richard Parnaby-King

Web Developer – PHP, Zend Framework and Actionscript 3

Posted on | | 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.
[javascript]

[/javascript]

To submit a custom page, have the call-back of the ajax form request echo the following code:
[javascript]

[/javascript]

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:

Comments

  • ABOUT

    Having fifteen years of programming experience in PHP, Zend Framework and ActionScript3, I have a very strong working knowledge of object orientated programming.

    I am a PC Gamer! Playing FPS, RTS, RPG and the occasional MMO since 1996 I have a huge number of a variety of fast-paced games.

  • Recent Posts

  • Categories

  • RSS SUBSCRIBE TO OUR FEED