I need to track a dynamic button that redirects to another url. I need to track everytime this happens and know exactly to what url the user is beeing redirected.
The button code:
<a target="_blank" href="/out.php?url=<?php echo urlencode($this->product['from'])?>">
<img src="http://xxx.com/data/images/buy.jpg" alt="buy"/>
</a>
File "out.php"
<?php
$url = urldecode($_GET['url']);
header("Location: ".$url);
exit;?>
I want that for example if a user clicks on buy, it redirects to "out.php" and shows a message like "U are beeing redirected in a few seconds" and then sends to the url.
I need this in order to track via analytics how many times the user landed on that page and where they came from, getting some metrics about outbound clicks.
Anyone knows how to do it?
Thanks in advance!!