Warrior Forum - The #1 Digital Marketing Forum & Marketplace

Warrior Forum - The #1 Digital Marketing Forum & Marketplace (https://www.warriorforum.com/)
-   Programming (https://www.warriorforum.com/programming/)
-   -   Is it possible to do conversion tracking inside/with a PHP redirect? (https://www.warriorforum.com/programming/43992-possible-do-conversion-tracking-inside-php-redirect.html)

Kelly Verge 9th January 2009 10:47 AM

Is it possible to do conversion tracking inside/with a PHP redirect?
 
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.

aGor 9th January 2009 11:21 AM

Re: Is it possible to do conversion tracking inside/with a PHP redirect?
 
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

Vesson 22nd January 2009 12:29 AM

Re: Is it possible to do conversion tracking inside/with a PHP redirect?
 
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... :-)

snidge 22nd January 2009 04:17 AM

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

Originally Posted by Kelly Verge (Post 405862)
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.


All times are GMT -6. The time now is 02:52 PM.