creonline
creonline
Offline
0
Hi,

I'm testing Affiliate Tracker and I have a problem:

I have set the custom tracking code in a module that is displayed on the page the user see when he confirm his email (community builder):

http://www.myurl.fr/index.php?option=com_comprofiler&task=confirm&confirmcode=[cbactivation]&uid=[user_id]&Itemid=721

In my module I have the code:

{source}
$user_id = $_GET['uid'];
$conversion_data = array(
"name" => "Registration",
"component" => "com_comprofiler",
"extended_name" => "Registration OK",
"type" => 1,
"value" => 1 ,
"reference_id" => 234,
"approved" => 1,
);

require_once(JPATH_SITE.DIRECTORY_SEPARATOR.'components'.DIRECTORY_SEPARATOR.'com_affiliatetracker'.DIRECTORY_SEPARATOR.'helpers'.DIRECTORY_SEPARATOR.'helpers.php');
AffiliateHelper::create_conversion($conversion_data, $user_id);

?>
{/source}

My issue is if I refresh the page many times, the conversion will be counted many times. So I would like to allow only one conversion for a user_id. If a user_id have already been counted, he can't generate a new conversion again.

How can I do this ?

Thanks,
Fab
Responses (1)
  • Accepted Answer

    Sunday, March 27 2016, 11:13 AM - #Permalink
    0
    hello

    the API will just save the conversion. It's your job to make sure it only records it once. So, before you call the function create_conversion, you will have to check if that particular conversion has already been stored before....
    The reply is currently minimized Show
Your Reply