Where can I get an automatic PPC conversion tracking script?

Discussion in 'ClickBank' started by rolf, Apr 5, 2009.

  1. #1
    Rather than paste the conversion tracking code for all my PPC affiliates on my download page, does anyone know where I can get an automatic script that will allow affiliates to send traffic to a specific link to get the tracking done automatically?

    thanks

    PS like the one swerd has (I presume is proprietary) (http://forums.digitalpoint.com/showthread.php?p=10896055)
     
    rolf, Apr 5, 2009 IP
  2. TigerPublishing

    TigerPublishing Member

    Messages:
    451
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    35
    #2
    Here's the basic idea. On your landing page:

    
    if ($_GET["g"])
      set_cookie("mysite_google_tracking", $_GET["g"], time() + 3600*24*30, "/"); // 30 day cookie
    
    if ($_GET["g"] || $_GET["hop"]) {
      header("Location: http://www.mysite.com"); // remove ?hop=&g=
      exit;
    }
    
    Code (markup):
    On your thank you page:

    
    if (isset($_COOKIE["mysite_google_tracking"])) {
      echo "
        google tracking JavaScript code...
        var googleID_whatever = '".$_COOKIE["mysite_google_tracking"]."';
        google tracking JavaScript code...
      ";
    }
    
    Code (markup):
    Obviously you'll need to replace in the JavaScript which Google provides. There's a part where your Google ID is included, and that's the bit you need to swap in with the ID from the affiliate. You can do the same with Yahoo! and MSN or any other networks.
     
    TigerPublishing, Apr 5, 2009 IP
  3. inzpiration

    inzpiration Active Member

    Messages:
    1,082
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    80
    #3
    Of course not, many big CB product use this, it's not property of anyone ;)
     
    inzpiration, Apr 6, 2009 IP
  4. rolf

    rolf Active Member

    Messages:
    1,449
    Likes Received:
    25
    Best Answers:
    0
    Trophy Points:
    90
    #4
    Thanks for that, I now see how that works. Just simple php get function.

    How does Clickbank handle this with the download url specified? Do you have to set pass variables or something? I've never done that.
     
    rolf, Apr 6, 2009 IP
  5. TigerPublishing

    TigerPublishing Member

    Messages:
    451
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    35
    #5
    @rolf: not sure what you mean... the PHP set_cookie() function stores a cookie on the customer's computer, so when they land on your thank you page (after being redirected by Clickbank), the tracking ID is ready to be included.

    Does that make sense?
     
    TigerPublishing, Apr 6, 2009 IP
  6. rolf

    rolf Active Member

    Messages:
    1,449
    Likes Received:
    25
    Best Answers:
    0
    Trophy Points:
    90
    #6
    Oh yes, silly me. I didn't realise about the cookie. Thanks.
     
    rolf, Apr 6, 2009 IP