0

I want to track visitors coming from affiliate websites to my shopping cart. I see they have affiliate tracking, but I cant seem to find documentation. i tried adding ?tracking=idhere to URLs but its not working. I have added an affiliate and set the commission rate but still nothing.

Update: Using Version 1.5.2.1. I basically need a howto on affiliate tracking. I've never used it or opencart for very long. I can see any decent documentation. Is affiliate tracking built in or do I need a 3rd party extension for what I want.

Update 2: I dumped the $_SESSION variable on the cart page, and the tracking code isn't there.

Array
(
    [language] => en
    [currency] => USD
    [cart] => Array
        (
            [51] => 1
        )

    [captcha] => 93e639
    [vouchers] => Array
        (
        )

)
madphp
  • 1,716
  • 5
  • 31
  • 72

1 Answers1

0

Tracking isn't done through sessions, it's done through a cookie. You can see the cookie code in the index.php file

if (isset($request->get['tracking']) && !isset($request->cookie['tracking'])) {
    setcookie('tracking', $request->get['tracking'], time() + 3600 * 24 * 1000, '/');
}

This is then captured during the checkout process, which you can see in

/catalog/controller/checkout/confirm.php

If this isn't working, then you are either not putting the correct id for an affiliate, or cookies aren't being saved/read correctly for some reason

Jay Gilford
  • 15,141
  • 5
  • 37
  • 56
  • i figured out what was wrong. It was working, i didn't know commissions had to be manually added for each affiliate. I will probably want to automate this at some stage, even if its a cronjob. No sweat. Thanks! – madphp May 21 '12 at 17:54
  • Cool. There are some mods available in the extension store which will automate the points for you at checkout – Jay Gilford May 22 '12 at 20:57