Tracking links?

Discussion in 'HTML & Website Design' started by babyb, Jun 18, 2007.

  1. #1
    Hey everyone,

    I was hoping to have trackin links so that all of my sales peoples customers could be tracked to each sale howcan i do this thanks if this isnt a webdesign subject please say but i think it is.


    example mysite.com/saleperson1 some 1 goesvia the link bys something i know this guys got the sale


    That is what im looking fr
     
    babyb, Jun 18, 2007 IP
  2. arcticsoft

    arcticsoft Guest

    Messages:
    10
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    More of a web development solution. This is something you would need to do via php or asp to track by salesperson in a db. not something to be solved in the desing of a site.
     
    arcticsoft, Jun 18, 2007 IP
  3. Will Morgan

    Will Morgan Peon

    Messages:
    70
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #3
    So something like an affiliate link?

    Assuming your pages are parsed by PHP (either by a .php extension or an .htaccess AddHandler line), something similar to this should give you a good foundation:

    <?php
    /* At the top of the page - AT THE TOP! */
    $referer = $_GET['s']; // So the URL would be like www.yoursite.com/?s=johndoe
    
    setcookie('yoursite_refer', $referer, time() + (86400*2), '/', '.yoursite.com');
    /* Above line sets the cookie called yoursite_refer for 2 days with the value of the referer in there. */
    
    // The rest of the site goes below!
    ?>
    PHP:
    And then when you're adding the customer details into the database, maybe do something like this:

    <?php
    if(isset($_COOKIE['yoursite_refer'])) {
    // insert the cookie's value into the referer field
    }
    else {
    // just insert the normal query as usual
    }
    ?>
    PHP:
    I hope this helps! :)
     
    Will Morgan, Jun 19, 2007 IP