Now Price Tapestry counts all click using jump.php.
I need to count unique click for unique product.
ES:
if an user clicks 3 times on the same product = 1 click
if an user clicks 3 times on 3 different products = 3 clicks
Is it possible?
Thank's a lot
Thank you David, but it counts only the first click (in general), i would count the first click for every product...
Thank's
Ah, sorry - I see the problem. The "id" field isn't being selected from the database. On line 4 of jump.php you have the following code:
$sql = "SELECT merchant,buy_url FROM `".$config_databaseTablePrefix."products` WHERE id=".database_safe($_GET["id"]);
...change this as follows:
$sql = "SELECT id,merchant,buy_url FROM `".$config_databaseTablePrefix."products` WHERE id=".database_safe($_GET["id"]);
That should do the trick!
Cheers,
David.
Hi,
One possible option is to set a cookie for each product ID clicked, and then only count the click if there is no cookie, giving you unique clicks. To do this, look for the following code in jump.php:
database_queryModify($sql,$insertID);
..and change this as follows:
// only execute the SQL if no cookie exists (i.e. first click)
if (!$_COOKIE["clk".$product["id"]])
{
database_queryModify($sql,$insertID);
}
// set the cookie so that the next click is not counted
$expire = time()+(60*60*24*365);
setcookie("clk".$product["id"],1,$expire);
Hope this helps!
Cheers,
David.