Traffic Exchange Toolbox
Exchange Owner Information
Affiliate Goal TrackingIf you run an affiliate program, many of your affiliates will want to know where their signups are coming from. With TEtoolbox it's easy! Simply install the following codes into your system, and our tracking will automatically show them which splash pages and which advertising sources provided the results. That way they can focus on advertising YOUR program in the most effective way, bringing you MORE signups and them more commissions ;-)
Tracking Part 1This section of code will go in your main configuration file. It's important to have this code there so it's referenced by all your referral links, and by the signup process. This simply remembers a tracking code which is displayed on your thank you page.
();
if(isset($_GET["tet"])){
("tet",$_GET["tet"],time()+86400*30,"/",$HTTP_HOST,"0");
$tet = $_SESSION["tet"] = $_GET["tet"];
}elseif (isset($_SESSION["tet"])) {
$tet = $_SESSION["tet"];
}
elseif (isset($_COOKIE["tet"])) {
$_SESSION["tet"] = $tet = $_COOKIE["tet"];
}
?>
Tracking Part 2This section of code will go in your thank you page. It'll display the tracking image if available. The image is a 1x1 pixel image and will not be noticable to your customers.
if ($tet != "") {
echo " ";
}
?>
List Rotator URLsIf your software cannot read TERP headers, you can use the form below to grab a list of URLs a rotator is rotating. Simply copy and paste the rotator URL and it will return the URLs for you. Please note that we will try to keep rotators clean, but due to the nature of the internet we cannot guarantee this.
TERP CompatableOur rotators are TERP Compatable. TERP (Traffic Exchange Redirect Protocol) allows your traffic exchange software to read the URLs from the rotator.
The following code (PHP) will read the TERP header and return the rotator list url. Your software simply needs to then grab the list from that url.
function getListURL($url) {
## Returns -1 if no TERP-List header found
## Returns -2 if error retrieving page
$url = str_replace("http://","",$url);
$listurl = -1;
if (strstr($url, '/')) {
$base = substr($url, 0, strpos($url,'/'));
$page = substr($url, strpos($url,'/'));
} else {
$base = $url;
$page = "/";
}
$fp = ($base, 80, $errno, $errstr, 30);
if (!$fp) {
$listurl = -2;
} else {
$out = "GET $page HTTP/1.1\r\n";
$out .= "Host: $base\r\n";
$out .= "Connection: Close\r\n\r\n";
fwrite($fp, $out);
while (!feof($fp)) {
$line = fgets($fp, 128);
if (strstr($line, "TERP-List")) {
$listurl = trim(str_replace("TERP-List: ","",$line));
break;
}
}
fclose($fp);
}
return $listurl;
}
?>
Traffic Exchange Redirect Protocol (TERP)
The below code is an example of how you would implement TERP on your own rotator or tracking service. Basically the concept is simple, the TERP header gives the URL to a plain text file that has each url in the rotator on a single line.
Code for rotator tracker:
Header("TERP-List: http://www.site.com/list.php?username=$username");
Code for list page:
$query = "SELECT * FROM `websites` WHERE `username`='$username'";
$result = mysql_query($query, $global_dbh);
$cnt = mysql_num_rows($result);
for ($i=0; $i<$cnt; $i++) {
$row = mysql_fetch_array($result);
$urls[] = $row["url"];
}
$urls[] = "http://www.mysite.com/index.php?referer=$username";
echo implode("\n", $urls);
exit();
|