Is it possible to do conversion tracking inside/with a PHP redirect?

3 replies
I usually use the following type of url:

Code:
http://mysite.com/link/product/
...which points to a folder with a simple PHP redirect like this:

Code:
<?php
header( 'Location: http://cb_nick.cb_product.hop.clickbank.net/?tid=source1' ) ;
?>
Is it possible to do any type of stat counting within this type of redirect? I'm playing with a split test idea, and this would be very helpful.
#conversion #inside or with #php #redirect #tracking
  • Profile picture of the author aGor
    Yeah, you can track how many times the site has been visited (how many who have clicked the link)

    <?php
    $filename = "stats.txt";
    $clicks = file_get_contents($filename);
    $clicks++;
    $fp = fopen($filename, "w");
    fwrite($fp, $clicks);
    fclose($fp);

    header("Location: put-your-url-here");
    ?>

    Create a file named stats.txt and upload it to the same folder as this script, then CHMOD it to 777, and then your set!

    Hope this was helpful!

    EDIT: I forgot to mention that the number of times the link has been clicked is recorded in stats.txt
    {{ DiscussionBoard.errors[405946].message }}
  • Profile picture of the author Vesson
    I've got the same question, and I use the exact same technique as you, Kelly.

    Given clickbank already tells us how many hops we get & we can use tids to work out where they came from, I think we need to use 301 or 302 redirects, which I'm trying to work out right now in cpanel!

    I'll let you know how I go... but at the moment I think i'm gonna do this:

    1. Create a new page to replace the direct .php link. I'll call it /recommends/product1.html
    2. Put the google website optimizer code in that html file.
    3. Set a redirect from /recommends/product1.html (not sure which type?) to /recommends/product1.php, which sends them along to the aff sales page.

    Anyone actually know what they're talking about? I sure don't... :-)
    {{ DiscussionBoard.errors[446185].message }}
  • Profile picture of the author snidge
    Originally Posted by Kelly Verge View Post

    I usually use the following type of url:

    Code:
    http://mysite.com/link/product/
    ...which points to a folder with a simple PHP redirect like this:

    Code:
    <?php
    header( 'Location: http://cb_nick.cb_product.hop.clickbank.net/?tid=source1' ) ;
    ?>
    Is it possible to do any type of stat counting within this type of redirect? I'm playing with a split test idea, and this would be very helpful.
    I'm not sure if they brought it back yet but Firefox left out the header Location in one of their releases a few years back. I have avoided using that since and went with boring HTML redirects.

    Just wanted to bring that up in case it's still a problem and you are losing sales because of this silly mistake.
    Signature

    Check out my WSO for 60% off my autoresponder, Bulk Mailer, Opt In Software.
    60% OFF Mail List Management Software! Multiple List Capabilities!

    {{ DiscussionBoard.errors[446547].message }}

Trending Topics