tags:

views:

21

answers:

1

I have a website based on wordpress. I want to implement a click tracking system on some of external links. Is there any method of doing so without using any external website or google analytic s. Can't i call some external php script to run when the link is clicked and keep incrementing a variable everytime. Please help . Thanks in advance

+2  A: 

You can link to a script that tracks redirects and redirects the user.

<a href="./out.php?url=http://domain.com"&gt;outbound link</a>

UPDATE: Don't forget to redirect with the status 301 to preserve the PageRank value added to the linked site.

Jan Kuča
thanks so much for your help. can u also suggest how in this external php script i keep updating the external variable?how do i use this global variable?
ayush
You can store the number of redirects to each URL in a database (MySQL, SQLite, CSV file, …). You get the target URL from $_GET['url'].
Jan Kuča