Results 1 to 4 of 4

 

Thread: Local Tracking Cookie Code

  1. #1
    Registered User

    Status
    Offline
    Join Date
    Aug 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts


    Hi,

    I'm not sure if anyone on this forum has done this before but if you have you may be able to help.

    As a merchant we are registered with quite a few affiliate networks and one of them is webgains. If a customer buys from us and redirected to the site from a webgains affiliate through the "source=webgains" attached to the end of the landing page url we need to be able to track this throughout the entire checkout process.

    SO webgains have asked us to implement a local tracking cookie in order to do this. the logic for the cookie is like below:

    if the customer came from a webgains affiliate link then process the webgains code

    else if the customer came from another affiliate then process their code

    else if the customer came from another affiliate then process their code

    etc etc

    This is in order for the sale commission to go to webgains only

    I am trying to implement a PHP cookie in order to do this, the landing page url info is "source=webgains" but I need to know how to track this and apply to the logic above

    the php cookie looks something like this

    setcookie(name, value, expire, path, domain);

    and to retrieve I assume on the checkout success page would be

    <?php

    echo $_COOKIE[" "];

    ?>

    Any help would me much appreciated

  2. #2
    D-Mac's Avatar
    Registered User

    Status
    Offline
    Join Date
    Mar 2004
    Location
    Surrey
    Posts
    1,353
    Thanks
    29
    Thanked 49 Times in 44 Posts
    Here is a basic solution:

    You need two include files. The first is referenced from all landing pages:

    Code:
    <?php
    $source = $_GET['source'];
    if ($source != null)
    {
        $expiry = 60 * 60 * 24 * 30 + time(); // 30 days time
        setcookie('source', $source, $expiry, "/");
    }
    ?>
    The second on the checkout page:

    Code:
    <?php
    if(isset($_COOKIE['source']))
        $source = $_COOKIE['source']; 
    
    if ($source == 'webgains')
        echo "do the webgains thing";
    else if ($source == 'tradedoubler')
        echo "do the tradedoubler thing";
    ?>
    Have fun :-)
    David Macfarlane
    Cost effective web development. Codewise

  3. #3
    srubin's Avatar
    Registered User

    Status
    Offline
    Join Date
    Aug 2008
    Posts
    86
    Thanks
    13
    Thanked 6 Times in 6 Posts
    Thanks D-Mac
    Seth Rubin
    Senior Integration & Support Manager
    Webgains Ltd.

  4. #4
    Registered User

    Status
    Offline
    Join Date
    Aug 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks for the reply, will try it out, seth you probably have a better understanding as well now?



Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Cookie tracking lifetime
    By jimbadger in forum Travel & Leisure
    Replies: 4
    Last Post: 23-05-08, 02:45 PM
  2. Cookie less tracking
    By sean.h.parker in forum Affiliate Marketing Lounge
    Replies: 1
    Last Post: 26-10-06, 01:19 PM
  3. what is the difference between local and not local server
    By tarunB in forum Web Hosting & Security
    Replies: 6
    Last Post: 09-07-06, 11:29 AM
  4. Cookie Tracking
    By Lee_Owen in forum Affiliate Marketing Lounge
    Replies: 3
    Last Post: 26-10-05, 09:24 AM
  5. How to check cookie/tracking
    By Mogga in forum Commission Junction
    Replies: 0
    Last Post: 02-04-05, 08:48 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
To Top

Content Relevant URLs by vBSEO 3.5.0 RC2