Ajax click tracking - The server side script
Home - Tutorials - AJAX basic tutorials
This tutorial demonstrates a simple and easy way how to track your visitors clicks using Ajax and PHP.
Tutorial info:
Name: | Ajax click tracking |
Total steps: | 2 |
Category: | AJAX basic tutorials |
Date: | 2009-05-20 |
Level: | Beginner |
Product: | See complete product |
Viewed: | 49471 |
Bookmark Ajax click tracking
Step 2 - The server side script
Ajax click tracking
As you could see the onClick event triggers the doWork() javascript function on the clickDemo.html file. The doWork() function calls (visits) the server side script clickTrack.php and pass the source and target information as URL parameters. It means we need to process the $_GET array in the PHP code.
If we get the variables then we can simply write them into a text file and that's it. The code is small and simple:
Code:
<?php ?>
Now we are ready. There are of course lot of improvement possibilities but it is up to you.
Previous Step of Ajax click tracking
Tags: ajax click tracking, click recording, ajax, click, tracking, recording
Ajax click tracking - Table of contents |
---|
Step 1 - Ajax click tracking |
Step 2 - The server side script |