More Related Content
Similar to Clickbooth Performance Exchange - CB Rotation How To (20)
Clickbooth Performance Exchange - CB Rotation How To
- 6. Installing and Configuring the CB PHP Script
Once an offer group is generated, you will get a PHP script. This script has two parts:
1. Initialization
<?php
// BEGIN CONFIGURATION
$url_params = array(
'lid' => 9244,
'ua' => $_SERVER['HTTP_USER_AGENT'],
'ip' => $_SERVER['REMOTE_ADDR'],
'subid1' => '',
);
// END CONFIGURATION
// BEGIN API CALLS don't change
$url = 'http://ai.smartrlinks.com/i?lid={lid}&ua={ua}&ip={ip}&subid1={subid1}';
foreach($url_params as $key => $param){
$url = str_replace("{". $key ."}", urlencode($param), $url);
}
try{
$content = file_get_contents($url);
$data = json_decode($content, true);
$img_url = $data['data']['image_url'];
$click_url = $data['data']['click_url'];
$name = $data['data']['name'];
} catch (Exception $e) {
$img_url = "http://servedby.clickboothlnk.com/img/teeth/teethtray.jpg";
$click_url = "http://c.px9y20.com?x=6223339991434721245&s={linkid}&pbc={clickid}";
$name = "Teeth Whitening System";
}
// END API CALLS don't change
$click_url .= '&subid2=&subid3=&subid4=&subid5=';
/**
* If you wish to use 3rd party tracker software, uncomment the line this and put your tracked
offer page URL in $tracker_url
* Tracker will then need to redirect to url above (ai.smartrlinks.com) and pass the {iid}
back to it
* Examples, assuming subid2 is used to transfer the clickid/token
* CPV Labs http://ai.smartrlinks.com/c/aff?lid=9244&subid2=
* Voluum http://ai.smartrlinks.com/c/aff?lid=9244&subid2={clickid}
* Thrive Tracker http://ai.smartrlinks.com/c/aff?lid=9244&subid2={subid}
*/
/*
// $tracker_url = 'http://url_to_your_tracker_url/?&iid={iid}'; // Uncomment for CPV Labs
// $tracker_url = 'http://url_to_your_tracker_url/?&var2={iid}'; // Uncomment for Voluum
$params = array();
$url_params = parse_url($click_url, PHP_URL_QUERY);
- 7. parse_str($url_params, $params);
foreach($params as $key => $param){
$click_url = str_replace("{". $key ."}", urlencode($param), $tracker_url);
}
*/
/*
The following variables are available for your use
<?php echo $click_url; ?> redirection URL, something like
http://ai.smartrlinks.com/c/aff?lid=12345&iid=AAAAAAAAAAAAAAAAA
If you are using Thrive tracker, instead of using $click_url, you need to use your LP Code and
add the following <?php echo '&iid='.$params['iid']; ?> at the end of it
Example: <a style="display: inlineblock;"
href="http://attila.thrivetracker.com/path/out.php?esub=1&sxid=<?php echo
(isset($_GET['sxid'])) ? $_GET['sxid'] : 0 ?><?php echo '&iid='.$params['iid']; ?>">
<?php echo $img_url; ?> url to the image. Feel free to size it as you see fit. Maximum
recommended resolution is 300x300
<?php echo $name; ?> product name. You can use this in text, throughout your page
*/
?>
Helpful Tip for Load Balancer/Proxy Users: Change the variables 'ua' and 'ip' to pass the
User Agent and IP Address of the visitor (instead of server).
For Voluum users: In order to have all clicks redirect through your system,
you need to uncomment the following code and update the $tracker_url to
point to your url
/*
$tracker_url = 'http://url_to_your_tracker_url/?&var2={iid}'; // Uncomment
for Voluum
$params = array();
$url_params = parse_url($click_url, PHP_URL_QUERY);
parse_str($url_params, $params);
foreach($params as $key => $param){
$click_url = str_replace("{". $key ."}", urlencode($param),
$tracker_url);
}
*/
And then in your tracking software, use the URL like this
http://ai.smartrlinks.com/c/aff?lid=####&subid2={clickid}
- 8.
What this does is forwards the value of {iid} to your tracker as iid and then your
Voluum will add that value when redirecting back to ai.smartrlinks.com.
It also assumes that subid2 is used for storing Voluum’s clickid, which is then
later used in CB’s postback configuration
If your system uses some other variables names, please make changes as you
see fit or contact your Account Manager for help.
For Thrive Tracker users: In order to have all clicks redirect through your
system, you shouldn’t use $click_url, but instead, use your Thrive LP Code and
add <?php echo '&iid='.$params['iid']; ?> at the end of it.
This would look like:
<a style="display: inlineblock;"
href="http://attila.thrivetracker.com/path/out.php?esub=1&sxid=<?php echo
(isset($_GET['sxid'])) ? $_GET['sxid'] : 0 ?><?php echo
'&iid='.$params['iid']; ?>">
And then in Thrive, use the following URL as Offer URL
http://ai.smartrlinks.com/c/aff?lid=####&subid2={subid}
(make sure to use the proper link id in lid)
assumes that subid2 is used for storing Thrive’s clickid, which is then later
used in CB’s postback configuration
If your system uses some other variables names, please make changes as you
see fit or contact your Account Manager for help.
For CPV Lab users: In order to have all clicks redirect through your system,
you need to uncomment the following code and update the $tracker_url to
point to your url
/*
$tracker_url = 'http://url_to_your_tracker_url/?&iid={iid}'; // Uncomment
for CPV Labs
$params = array();
$url_params = parse_url($click_url, PHP_URL_QUERY);
parse_str($url_params, $params);
foreach($params as $key => $param){
$click_url = str_replace("{". $key ."}", urlencode($param),
$tracker_url);
}
*/