public function getUrl($cloaked = true)
 {
     $tracking_variables = array();
     $tracking_variables[$this->option('var_v1')->value] = $this->option('default_var_v1')->value;
     $tracking_variables[$this->option('var_v2')->value] = $this->option('default_var_v2')->value;
     $tracking_variables[$this->option('var_v3')->value] = $this->option('default_var_v3')->value;
     $tracking_variables[$this->option('var_v4')->value] = $this->option('default_var_v4')->value;
     $tracking_variables[$this->option('var_kw')->value] = $this->option('default_var_kw')->value;
     $tracking_variable_string = '';
     if ($tracking_variables) {
         $tracking_variable_string = bt_build_http_query($tracking_variables);
     }
     if ($this->cloaker_id && $cloaked) {
         $cloaker = CloakerModel::model()->getRowFromPk($this->cloaker_id);
         if ($cloaker) {
             return $cloaker->getUrl() . '/' . $this->slug . '?' . $tracking_variable_string;
         }
     }
     if ($this->type == 1) {
         return 'http://' . getTrackingDomain() . '/tracker/lp/' . $this->get('campaign_id') . '?' . $tracking_variable_string;
     }
     return 'http://' . getTrackingDomain() . '/tracker/direct/' . $this->get('campaign_id') . '?' . $tracking_variable_string;
 }
    $destination_url = 'http://' . getTrackingDomain() . '/tracking202/redirect/dl.php?t202id=' . $tracker_id_public . $tracking_variable_string . 't202kw=';
    $html['destination_url'] = htmlentities($destination_url, ENT_QUOTES, 'UTF-8');
    printf('<br></br><small><strong>Destination URL:</strong></small><br/>
            <span class="infotext">This is the destination URL you should use in your PPC campaigns. 
            This destination URL stores your above settings,
            so when someone goes through this destination URL we know the CPC, the PPC account, 
			the Ad Copy and everything else you have set above to this unique tracking destination URL.<br/>
			If you modify your PPC campaign from the above settings, 
			always make sure to update it with a new tracking202 destination.
            You should have a unique tracking202 destination URL for each different above configuration you use.<br/>
            In order to track keywords, make sure immediately following &t202kw= you insert your dynamic keyword.
            For example: &t202kw={keyword}</span><br></br>
            <textarea class="form-control" rows="2" style="background-color: #f5f5f5; font-size: 12px;">%s</textarea>', $html['destination_url']);
}
if ($_POST['tracker_type'] == 2) {
    $destination_url = 'http://' . getTrackingDomain() . '/tracking202/redirect/rtr.php?t202id=' . $tracker_id_public . $tracking_variable_string . 't202kw=';
    $html['destination_url'] = htmlentities($destination_url, ENT_QUOTES, 'UTF-8');
    printf('<br></br><small><strong>Destination URL:</strong></small><br/>
            <span class="infotext">This is the destination URL you should use in your PPC campaigns. 
            This destination URL stores your above settings,
            so when someone goes through this destination URL we know the CPC, the PPC account, 
			the Ad Copy and everything else you have set above to this unique tracking destination URL.<br/>
			If you modify your PPC campaign from the above settings, 
			always make sure to update it with a new tracking202 destination.
            You should have a unique tracking202 destination URL for each different above configuration you use.<br/>
            In order to track keywords, make sure immediately following &t202kw= you insert your dynamic keyword.
            For example: &t202kw={keyword}</span><br></br>
            <textarea class="form-control" rows="2" style="background-color: #f5f5f5; font-size: 12px;">%s</textarea>', $html['destination_url']);
}
if ($_POST['method_of_promotion'] == 'landingpage' or $_POST['tracker_type'] == 1) {
    $destination_url = $parsed_url['scheme'] . '://' . $parsed_url['host'] . $parsed_url['path'] . '?';
	</div>

</div>
', $unSecuredUniversalPixelJS, $unSecuredUniversalPixel);
?>
	</div>
</div>

<script type="text/javascript">
$(document).ready(function() {
    $("#secure-pixels input:radio").on("change.radiocheck", function () {
		change_pixel_data();
    });

    $('#amount_value').keyup(function () { change_pixel_data(); });
    $('#subid_value').keyup(function () { change_pixel_data(); });
	load_aff_network_id();

	
});

function change_pixel_data(){
	pixel_data_changed("<?php 
echo getTrackingDomain();
?>
");
}
</script>

<?php 
template_bottom($server_row);
function registerDailyEmail($time, $timezone, $hash)
{
    $protocol = stripos($_SERVER['SERVER_PROTOCOL'], 'https') === true ? 'https://' : 'http://';
    $domain = $protocol . '' . getTrackingDomain();
    $domain = base64_encode($domain);
    $date = new DateTime($time . ':00:00', new DateTimeZone($timezone));
    $date->setTimezone(new DateTimeZone('America/Los_Angeles'));
    //Initiate curl
    $ch = curl_init();
    // Set the url
    curl_setopt($ch, CURLOPT_URL, 'http://my.tracking202.com/api/v2/' . $hash . '/' . $domain . '/' . $date->format('H'));
    // Disable SSL verification
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
    // Will return the response, if false it print the response
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    // Execute
    $result = curl_exec($ch);
    //close connection
    curl_close($ch);
}
 public function getUrl()
 {
     return 'http://' . getTrackingDomain() . '/tracker/offer/' . $this->id();
 }
		contact the live support and we can walk you through the process.</p>';
$count = 0;
while ($count < $_POST['counter'] + 1) {
    $count++;
    $aff_campaign_id = $_POST['aff_campaign_id_' . $count];
    if ($aff_campaign_id != 0) {
        $mysql['aff_campaign_id'] = mysql_real_escape_string($aff_campaign_id);
        $aff_campaign_sql = "SELECT aff_campaign_id_public, aff_campaign_name FROM 202_aff_campaigns WHERE aff_campaign_id='" . $mysql['aff_campaign_id'] . "'";
        $aff_campaign_result = mysql_query($aff_campaign_sql) or record_mysql_error($aff_campaign_sql);
        $aff_campaign_row = mysql_fetch_assoc($aff_campaign_result);
        //for each real campaign selected, display the code to be used for it
        $outbound_php = '<?php
  
  // ------------------------------------------------------------------- 
  //
  // Tracking202 PHP Redirection, created on ' . date('D M, Y', time()) . '
  //
  // This PHP code is to be used for the following setup:
  // ' . $aff_campaign_row['aff_campaign_name'] . ' on ' . $landing_page_row['landing_page_url'] . '
  //                       
  // -------------------------------------------------------------------
  
  $tracking202outbound = \'http://' . getTrackingDomain() . '/tracking202/redirect/off.php?acip=' . $aff_campaign_row['aff_campaign_id_public'] . '&pci=\'.$_COOKIE[\'tracking202pci\']; 
 
  header(\'location: \'.$tracking202outbound);
  
?>';
        $html['outbound_php'] = htmlentities($outbound_php);
        printf('<p><textarea class="code_snippet large">%s</textarea></p>', $html['outbound_php']);
    }
}
    }
}
//echo error
echo $error['text_ad_id'] . $error['ppc_network_id'] . $error['ppc_account_id'] . $error['cpc'] . $error['click_cloaking'] . $error['cloaking_url'];
//show tracking code
$mysql['landing_page_id'] = mysql_real_escape_string($_POST['landing_page_id']);
$landing_page_sql = "SELECT * FROM `202_landing_pages` WHERE `landing_page_id`='" . $mysql['landing_page_id'] . "'";
$landing_page_result = mysql_query($landing_page_sql) or record_mysql_error($landing_page_sql);
$landing_page_row = mysql_fetch_assoc($landing_page_result);
$parsed_url = parse_url($landing_page_row['landing_page_url']);
?>
<p><u>Make sure you test out all the links to make sure they work yourself before running them live.</u></p><?php 
if ($_POST['method_of_promotion'] == 'landingpage') {
    $affiliate_link = 'http://' . getTrackingDomain() . '/tracking202/redirect/lp.php?lpip=' . $landing_page_row['landing_page_id_public'];
    $html['affiliate_link'] = htmlentities($affiliate_link);
    $javascript_code = '<script src="http://' . getTrackingDomain() . '/tracking202/static/landing.php?lpip=' . $landing_page_row['landing_page_id_public'] . '" type="text/javascript"></script>';
    $html['javascript_code'] = htmlentities($javascript_code);
    printf('<p><b>Inbound Javascript Landing Page Code:</b>
            This is the javascript code should be put right above your &#60;&#47;body&#62; tag on <u>only</u> the page(s) where your PPC visitors will first arrive to.
			This code is not supposed to be placed on every single page on your website. For example this <u>is not</u> to be placed in a template file that is to be included on everyone of your pages.<br/><br/>
            This code is supposed to be only placed on the first page(s), that an incoming PPC visitor would be sent to.  
            Tracking202 is not designed to be a webpage analytics, this is specifically javascript code only to track visitors coming in.</p>
            <p><textarea class="code_snippet">%s</textarea></p>', $html['javascript_code']);
    $outbound_php = '<?php
  
  // ------------------------------------------------------------------- 
  //
  // Tracking202 PHP Redirection, created on ' . date('D M, Y', time()) . '
  //
  // This PHP code is to be used for the following landing page.
  // ' . $landing_page_row['landing_page_url'] . '
Beispiel #8
0
include_once $_SERVER['DOCUMENT_ROOT'] . '/202-config/connect.php';
$hash = "SELECT install_hash FROM 202_users WHERE user_id = '1'";
$result = $db->query($hash);
$row = $result->fetch_assoc();
if ($row['install_hash'] != $_GET['hash']) {
    die("Unautorized!");
}
$database = DB::getInstance();
$db = $database->getConnection();
$user_sql = 'SELECT user_email, user_daily_email FROM 202_users LEFT JOIN 202_users_pref USING (user_id) WHERE user_id = 1';
$user_result = $db->query($user_sql);
$user_row = $user_result->fetch_assoc();
if (!$user_row['user_daily_email']) {
    die;
}
$data = array('to' => $user_row['user_email'], 'domain' => getTrackingDomain(), 'campaigns' => array());
$ids = array();
$time['from_today'] = mktime(0, 0, 0, date('m', time()), date('d', time()), date('Y', time()));
$time['to_today'] = mktime(23, 59, 59, date('m', time()), date('d', time()), date('Y', time()));
$time['from_yesterday'] = mktime(0, 0, 0, date('m', time() - 86400), date('d', time() - 86400), date('Y', time() - 86400));
$time['to_yesterday'] = mktime(23, 59, 59, date('m', time() - 86400), date('d', time() - 86400), date('Y', time() - 86400));
$sql_today = "SELECT \n\t\t\t2ca.aff_campaign_id,\n\t\t\t2ca.aff_campaign_name,\n\t\t\tCOUNT(*) AS clicks,\n\t\t\tSUM(2cr.click_out) AS click_throughs,\n\t\t\t(COUNT(*)/SUM(2cr.click_out))*100 AS ctr,\n\t\t\tSUM(2c.click_lead) AS leads,\n\t\t\t(SUM(2c.click_lead)/COUNT(*))*100 as su_ratio,\n\t\t\tSUM(2c.click_payout*2c.click_lead) AS income,\n\t\t\tSUM(2c.click_cpc) AS cost,\n\t\t\t(SUM(2c.click_payout*2c.click_lead)-SUM(2c.click_cpc)) AS net,\n\t\t\t((SUM(2c.click_payout*2c.click_lead)-SUM(2c.click_cpc))/SUM(2c.click_cpc)*100 ) as roi \n\t\t\tFROM 202_clicks AS 2c\n\t\t\tLEFT JOIN 202_clicks_record AS 2cr USING (click_id)\n\t\t\tLEFT JOIN 202_aff_campaigns AS 2ca USING (aff_campaign_id)\n\t\t\tWHERE 2c.click_time >= " . $time['from_today'] . "\n\t\t\tAND 2c.click_time <= " . $time['to_today'] . "\n\t\t\tGROUP BY 2ca.aff_campaign_id\n\t\t\tORDER BY net DESC\n\t\t\tLIMIT 5";
$result_today = $db->query($sql_today);
if ($result_today->num_rows > 0) {
    while ($row_today = $result_today->fetch_assoc()) {
        $columns_today = array();
        $ids[] = $row_today['aff_campaign_id'];
        foreach ($row_today as $key => $value) {
            if ($key == 'aff_campaign_id' || $key == 'aff_campaign_name') {
                $columns_today[$key] = $value;
            } else {
				</div>
			</div>
		</div>
	</div>

	<div class="col-xs-8">
		<strong><small>Prosper202 Incoming Webhook URL Is:</small></strong><br>
		<div class="row">

			<form class="form-horizontal" role="form" method="post" action="">

			<div class="col-xs-9">

				<small>
					<em><?php 
echo $strProtocol . '' . getTrackingDomain();
?>
/tracking202/static/slack.php</em>
				</small>

					<div class="form-group" style="margin-top: 20px;">
						<label for="user_slack_incoming_webhook" class="col-xs-12 control-label" style="text-align:left">Slack Incoming Webhook URL:</label>
						<div class="col-xs-12">
						    <input type="text" class="form-control input-sm" id="user_slack_incoming_webhook" name="user_slack_incoming_webhook" value="">
						</div>
						 <div class="col-xs-6">
						 <br>
						<button class="btn btn-xs btn-p202 btn-block" type="submit">Update Webhook Url</button>				
					</div>
					</div>
			</div>
    $outbound_javascript = '
<!DOCTYPE html>
<html>
<head>
	<title>GO</title>
</head>
<body>

<!-- PLACE OTHER LANDING PAGE CLICK THROUGH CONVERSION TRACKING PIXELS HERE -->
	
<!-- NOW THE TRACKING202 REDIRECTS OUT -->
<script type="text/javascript">
if (readCookie(\'tracking202outbound\') != \'\') {
	window.location=readCookie(\'tracking202outbound\');
} else {
	window.location=\'http://' . getTrackingDomain() . '/tracking202/redirect/lp.php?lpip=' . $landing_page_row['landing_page_id_public'] . '\';
}
	
function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(\';\');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==\' \') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return false;
}
</script>
</body>
</html>';
			    <div class="col-sm-6 col-sm-offset-6">
					<button class="btn btn-xs btn-p202 btn-block" type="submit">Delete data</button>				    
				</div>
			</div>
		</form>
	</div>
</div>
<div class="row form_seperator">
	<div class="col-xs-12"></div>
</div>

<div class="row account">
	<div class="col-xs-12">
		<h6>MaxMind ISP/Carrier Lookup</h6>
		<span class="infotext">To turn on ISP/Carrier lookup feature, you need to buy MaxMind ISP database and upload (GeoIPISP.dat file) to <code><?php 
echo getTrackingDomain() . '/202-config/geo/';
?>
</code> folder.<br/>(Settings will take place after 5 minutes in live traffic)</span>
	</div>

	<div class="col-xs-12">
		<form class="form-horizontal" id="maxmindisp" role="form" style="margin-top:25px; margin-bottom:25px;">
		  <div class="form-group">
                  <label for="inputEmail3" class="col-sm-2 control-label">ISP/Carrier Lookup:</label>
                  <div class="col-sm-10">
                    <label id="on-label" class="radio radio-inline">
                      <input type="radio" name="maxmind-isp" id="on" value="true" data-toggle="radio" <?php 
if ($user_row['maxmind_isp'] == true) {
    echo "checked";
}
?>