1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Tracking sales by referrers

Discussion in 'General Scripting Chat' started by lovetospooge, Jun 4, 2012.

  1. lovetospooge

    lovetospooge Junior Member

    Joined:
    Jul 24, 2011
    Messages:
    171
    Likes Received:
    91
    Location:
    Cape Town, ZA
    Hey

    How can I track from witch referring website a sale is coming from?


    Example:

    I'm advertising on the follow sites:

    adsite1.com
    adsite2.com
    adsite3.com


    How can I see from witch referring site the sale came from, also I am using paypal as my payment processor.


    Thanks.
     
  2. t0.sh

    t0.sh Registered Member

    Joined:
    Jun 6, 2012
    Messages:
    55
    Likes Received:
    24
    Location:
    UVB-76
    So, you're advertising your website on someone else's website and you want to see where you traffic came from? You could always do this:

    Code:
    <?php
    $url = $_GET['url'];
    ?> 
    
    Put this in your header file or on your index file somewhere and change the advertising link to something like [my_site_link]/index.php?url=[ad_url], then carry that variable over to the page where your sale is tracked.
     
  3. n30nGUY

    n30nGUY Newbie

    Joined:
    May 25, 2012
    Messages:
    33
    Likes Received:
    5
    You'll want to have a bit of PHP code that runs on every page to check for an external referrer. If it exists, store it in the session and then store that value against the order when placed.

    If you need to track for longer than one browser session you'll need to set a cookie.

    On my iPhone at the mo, but if you need a code example I can post later.