I need to track every time a user clicks on a dynamic button. Also I need to know what product is he clicking. Now I have this button:
<div class="buy">
<a target="_blank" href="<?php echo $this->product['from']; ?>">
<img src="http://example.com/data/images/buy.jpg" alt="buy">
</a>
</div>
Href sends the user to another site to buy the product. How can i track this on PHP?
If the
hrefis linking to another page that is not on your own server, you can go with an ajax-solution, like @coder1984 proposed, or you can create a proxy php script. That means:href="myproxy.php?url=<?php echo $this->product['from']; ?>"