some conversions are not tracked

creonline
creonline
Offline
0
Hi,

I use Affiliate tracker for many years now and everything was working properly.
Yesterday, I launched a Facebook campaign, I get some clics that are correctly tracked on the Logs. But conversions are not tracked.
I'm sure that I get some user that have registered after clicking on the Facebook (when I look at the http_referer for these users, I can see the atid used in the Facebook ads: mywebsite.com/regsitration?atid=13), also, I can see their registration IP and I can find it on the Affiliate tracker clic Logs. But, nothing appears on the Conversions.
I get Conversions from other sources, but globally, looks like that not all Conversions are correctly tracked.
Someone could help me with this issue ?

Thanks,
Fab
Responses (3)
  • Accepted Answer

    creonline
    creonline
    Offline
    Tuesday, April 16 2019, 10:43 AM - #Permalink
    0
    I use this code for conversions:

    $user_id = $_GET['uid'];
    $db = JFactory::getDbo();
    $query = $db->getQuery(true);
    $query->select('count(*)');
    $query->from($db->quoteName('#__affiliate_tracker_conversions'));
    $query->where($db->quoteName('user_id') . ' = '. $user_id);
    $db->setQuery($query);
    if($db->loadResult()==0)
    {
    $conversion_data = array(
    "name" => "Inscription",
    "component" => "com_comprofiler",
    "extended_name" => "Inscription validée",
    "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);
    }

    ?>
    The reply is currently minimized Show
  • Accepted Answer

    Wednesday, April 17 2019, 09:12 AM - #Permalink
    0
    I can't verify this code you're using..

    are you sure $user_id = $_GET['uid']; is not empty?
    The reply is currently minimized Show
  • Accepted Answer

    creonline
    creonline
    Offline
    Wednesday, April 17 2019, 07:33 PM - #Permalink
    0
    Yes, I'm sure $user_id = $_GET['uid']; is not empty because some other pieces of code are using it and there's no problem.
    The reply is currently minimized Show
Your Reply