Jump to content

Affiliate links not being tracked


bigwave

Recommended Posts

Hello,

 

For some reason when you use an affiliate link, it shows that you got a visitor but it never tracks the sale.

 

The * is the original from WHMCS. I had modified it and that's when it stopped working but I have put it back to normal now and it's still not tracking the sales.

 

Please let me know what could be wrong to cause it not to track the sales. I will list the * code below just in case it's something wrong there.

 

 

<?php
/**
* Affiliate Cookie Tracking + Redirection Handler
*
* @package    WHMCS
* @author     WHMCS Limited <development@whmcs.com>
* @copyright  Copyright (c) WHMCS Limited 2005-2013
* @license    http://www.whmcs.com/license/ WHMCS Eula
* @version    $Id$
* @link       http://www.whmcs.com/
*/

define("CLIENTAREA",true);

require("init.php");

// if affiliate id is present, update visitor count & set cookie
if ($aff = $whmcs->get_req_var('aff')) {
   update_query("tblaffiliates",array("visitors"=>"+1"),array("id"=>$aff));
   WHMCS_Cookie::set('AffiliateID',$aff,'3m');
}

// if product id passed in, redirect to order form
if ($pid = $whmcs->get_req_var('pid')) redir("a=add&pid=".(int)$pid,"cart.php");

// if product group id passed in, redirect to product group
if ($gid = $whmcs->get_req_var('gid')) redir("gid=".(int)$gid,"cart.php");

// if register = true, redirect to registration form
if ($whmcs->get_req_var('register')) redir("","register.php");

// if gocart = true, redirect to cart with request params
if ($whmcs->get_req_var('gocart')) {
   $reqvars = '';
   foreach ($_GET AS $k=>$v) $reqvars .= $k.'='.urlencode($v).'&';
   redir($reqvars,"cart.php");
}

// perform redirect
header("HTTP/1.1 301 Moved Permanently");
header("Location: ".$whmcs->get_config('Domain'),true,301);

Link to comment
Share on other sites

  • WHMCS Support Manager

Hi,

First please ensure the order contains a product and said product does not have a custom commission rate set to 0.00.

 

When attempting to test this, please ensure you are logged out of the admin area and the client area. Make sire the order is not being made under the affiliate's account.

WHMCS has measures in place to prevent self-referrals and you might be accidentally falling foul of these in your tests.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated