当前位置: 首页>>代码示例>>PHP>>正文


PHP Tracking::getTrackingEventType方法代码示例

本文整理汇总了PHP中Tracking::getTrackingEventType方法的典型用法代码示例。如果您正苦于以下问题:PHP Tracking::getTrackingEventType方法的具体用法?PHP Tracking::getTrackingEventType怎么用?PHP Tracking::getTrackingEventType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Tracking的用法示例。


在下文中一共展示了Tracking::getTrackingEventType方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: TrackingInventory

$totalImpression = $totalUniqueImpression = $totalClick = $totalUniqueClick = $totalImpressionOver = $totalClickOver = $totalUniqueImpressionOver = $totalUniqueClickOver = $totalByEvent = 0;
if (!empty($flightTracking)) {
    $totalImpression = $flightTracking['total_impression'];
    $totalUniqueImpression = $flightTracking['total_unique_impression'];
    $totalClick = $flightTracking['total_click'];
    $totalUniqueClick = $flightTracking['total_unique_click'];
    //over report
    $totalImpressionOver = $flightTracking['total_impression_over'];
    $totalUniqueImpressionOver = $flightTracking['total_unique_impression_over'];
    $totalClickOver = $flightTracking['total_click_over'];
    $totalUniqueClickOver = $flightTracking['total_unique_click_over'];
    $TrackingInventory = new TrackingInventory();
    if (isset($flight->event) && $flight->event != '') {
        $event = $flight->event;
    } else {
        $event = Tracking::getTrackingEventType($flight->cost_type);
    }
    $key = "total_{$event}";
    $keyOver = "total_{$event}_over";
    $totalByEvent = $flightTracking[$key] + $flightTracking[$keyOver];
}
?>
                                     		<td class="bg-default">Total Impression</td>
                                     		<td width="30%">
                                     			<span class="badge badge-info">{{number_format($totalImpression + $totalImpressionOver)}}</span>
                                     			@if ($totalImpressionOver)
													<span class="blue">({{number_format($totalImpressionOver)}})</span>
												@endif
											</td>
                                  		</tr>
                                  		<tr>
开发者ID:huycao,项目名称:yoplatform,代码行数:31,代码来源:showPreview.blade.php

示例2: getProcessPreview

 function getProcessPreview($totalImpression)
 {
     $process = 0;
     $TrackingInventory = new TrackingInventory();
     if (isset($this->event) && $this->event != '') {
         $event = $this->event;
     } else {
         $event = Tracking::getTrackingEventType($this->cost_type);
     }
     $rate = $event == 'impression' ? 1000 : 1;
     $flightInventory = $this->total_inventory * $rate;
     if ($flightInventory > 0) {
         $process = round($totalImpression / $flightInventory * 100, 2);
     }
     return $process;
 }
开发者ID:huycao,项目名称:yoplatform,代码行数:16,代码来源:FlightBaseModel.php

示例3: deliveredAdStatus

 /**
  * check delivery status and condition of requested flight
  */
 public function deliveredAdStatus($adID, $flightWebsite, $flight, $dateRange)
 {
     $trackingModel = new Tracking();
     //kiểm tra độ tuổi
     if ($flight->age && !$this->checkAge(json_decode($flight->age), \Input::get('age'))) {
         return self::RESPONSE_TYPE_AGE_LIMIT;
     }
     //kiểm tra giới tính
     if ($flight->sex && !$this->checkGender($flight->sex, \Input::get('g'))) {
         return self::RESPONSE_TYPE_GENDER_LIMIT;
     }
     //kiểm tra vị trí địa lí
     if ($flight->country && $flight->province && !$this->checkGeo($flight->country, $flight->province)) {
         return self::RESPONSE_TYPE_GEO_LIMIT;
     }
     //kiểm tra frequency capping
     /*if( $flight->frequency_cap && (!$this->checkFrequencyCap($flight->id, $flight->frequency_cap) || Cookie::get(md5("FrequencyCap:$flightWebsite->id")) ) ){
     			return self::RESPONSE_TYPE_FREQUENCY_CAPPED;
     		}*/
     if (!empty($dateRange) && (!$this->checkFrequencyCap($flight, $dateRange) || Cookie::get(md5("FrequencyCap:{$flightWebsite->id}")))) {
         return self::RESPONSE_TYPE_FREQUENCY_CAPPED;
     }
     // TODO : kiểm tra channel
     if ($flight->cost_type == 'cpm' || $flight->cost_type == 'cpc') {
         $event = Tracking::getTrackingEventType($flight->cost_type);
         $overReport = FALSE;
         $checkInventory = $this->checkInventory($flight, $flightWebsite, $event, $dateRange);
         if ($checkInventory !== TRUE) {
             //full inventory trong ngày
             // $checkOverInventory = $this->checkOverInventory($flight, $flightWebsite, $event);
             // if($checkOverInventory !== TRUE){
             return $checkInventory;
             // }
             // else{
             // 	$overReport = TRUE;
             // }
         } else {
             $checkOvrInventory = $this->checkOverInventory($flight, $flightWebsite, $event);
             pr($checkOvrInventory);
             if ($checkOvrInventory === TRUE) {
                 $overReport = TRUE;
             }
         }
     }
     // WHEN READY TO DELIVERY
     //if( $flight->frequency_cap ){
     if (!empty($dateRange)) {
         $todayCapped = $trackingModel->getTodayFreCap($flight);
         $now = strtotime(date('Y-m-d 00:00:00'));
         foreach ($dateRange as $date) {
             if (strtotime($date->start) <= $now && strtotime($date->end) >= $now) {
                 if ($date->frequency_cap > 0 && $todayCapped >= $date->frequency_cap - 1 && $date->frequency_cap_time > 0) {
                     $trackingModel->rememberFrequencyCap($flightWebsite->id, $date->frequency_cap_time);
                     $trackingModel->setTimeFreeCap($flight, $date->frequency_cap_time);
                 }
             }
         }
         /*if(  $todayCapped >= $flight->frequency_cap_free &&  $flight->frequency_cap_time > 0 ){
         			$trackingModel->rememberFrequencyCap($flightWebsite->id, $flight->frequency_cap_time);
         		}*/
     }
     return $overReport ? self::DELIVERY_STATUS_OVER_REPORT : self::DELIVERY_STATUS_OK;
 }
开发者ID:huycao,项目名称:yoplatform,代码行数:66,代码来源:Delivery.php

示例4: trackEvent

 public function trackEvent()
 {
     ignore_user_abort(true);
     $this->layout = null;
     $response = null;
     $responseType = '';
     $expandFields = array();
     $deliveryStatus = '';
     $event = strtolower(Input::get('evt', ''));
     $requestType = Input::get('rt', Delivery::REQUEST_TYPE_TRACKING_BEACON);
     $checksum = Input::get('cs', '');
     $flightWebsiteID = Input::get('fpid', 0);
     $zoneID = Input::get('zid', 0);
     $isOverReport = Input::get('ovr');
     //custom code for VIB 068 Relaunch form complete tracking
     if (Input::get('wid') == 48 && $event == 'complete') {
         $flightWebsiteID = 172;
         $event = "impression";
     }
     $trackingModel = new Tracking();
     $deliveryModel = new Delivery();
     //ghi log trước khi xử lý
     $logPreProcess = $trackingModel->logPreProcess($requestType, Input::get());
     if ($logPreProcess) {
         //kiểm tra referrer
         $hostReferer = $trackingModel->getRequestReferer();
         $responseType = $trackingModel->checkPreProcess($requestType, $hostReferer, $zoneID);
         if (empty($responseType)) {
             $adZone = $deliveryModel->getAdzone($zoneID);
             if ($adZone) {
                 if (isSameDomain($hostReferer, getWebDomain($adZone->site->url)) || isLocal()) {
                     $flightWebsite = $deliveryModel->getFullFlightWebsite($flightWebsiteID);
                     if ($flightWebsite) {
                         //checksum
                         if ($flightWebsite->flight->ad_format_id == Delivery::TRACKING_CODE_ADID) {
                             $responseType = Delivery::RESPONSE_TYPE_TRACKING_BEACON_SUCCESS;
                         } elseif ($trackingModel->isValidTrackingBeacon($checksum, $event)) {
                             $responseType = Delivery::RESPONSE_TYPE_TRACKING_BEACON_SUCCESS;
                             //set cookie for retargeting
                             $trackingModel->rememberRetarget($flightWebsite->flight->campaign_id, $event);
                         } else {
                             $responseType = Delivery::RESPONSE_TYPE_CHECKSUM_ERROR;
                         }
                     }
                     //else invalid
                 }
             }
         }
         if (empty($responseType)) {
             $responseType = Delivery::RESPONSE_TYPE_INVALID;
         } elseif ($responseType == Delivery::RESPONSE_TYPE_TRACKING_BEACON_SUCCESS) {
             $expandFields = array('flight_id' => $flightWebsite->flight_id, 'ad_format_id' => $adZone->ad_format_id, 'ad_id' => $flightWebsite->flight->ad_id, 'campaign_id' => $flightWebsite->flight->campaign_id, 'publisher_ad_zone_id' => $adZone->id, 'flight_website_id' => $flightWebsite->id, 'website_id' => $flightWebsite->website_id);
             $expandFields['checksum'] = $checksum;
             $eventChecksum = $event;
             $trackingModel->setChecksumTrackingEvent($checksum, $event);
             //udpate inventory
             //$inventoryMetric = $trackingModel->getTrackingEventType($flightWebsite->flight->cost_type);
             $inventoryMetric = $trackingModel->getTrackingEventType($flightWebsite->flight->cost_type);
             if ($event == $inventoryMetric) {
                 $trackingModel->updateInventory($flightWebsite->flight->id, $flightWebsite->id, $inventoryMetric, $isOverReport);
             }
             if (isset($flightWebsite->flight->event) && $flightWebsite->flight->event != '') {
                 $flightEvent = $flightWebsite->flight->event;
             } else {
                 // Truong hop nhung flight truoc day khong co setting event
                 $flightEvent = $inventoryMetric;
             }
             if ($event == $flightEvent) {
                 //incre today capped this ad by 1
                 $trackingModel->incFreCap($flightWebsite->flight);
             }
             //update tracking summary
             $rawTrackingSummary = new RawTrackingSummary();
             $rawTrackingSummary->addSummary($event, $flightWebsite->website_id, $adZone->id, $adZone->ad_format_id, $flightWebsite->flight_id, $flightWebsite->id, $flightWebsite->flight->ad_id, $flightWebsite->flight->campaign_id);
             $uniqueEvent = '';
             //unique impression
             if ($event == 'impression') {
                 $uniqueEvent = 'unique_impression';
                 $expandFields['unique_impression'] = $trackingModel->isUniqueImpression($flightWebsite->id);
             }
             //unique click
             if ($event == 'click') {
                 $uniqueEvent = 'unique_click';
                 $expandFields['unique_click'] = $trackingModel->isUniqueClick($flightWebsite->id);
             }
             //add summary unique click or impression
             if (!empty($expandFields[$uniqueEvent])) {
                 $rawTrackingSummary->addSummary($uniqueEvent, $flightWebsite->website_id, $adZone->id, $adZone->ad_format_id, $flightWebsite->flight_id, $flightWebsite->id, $flightWebsite->flight->ad_id, $flightWebsite->flight->campaign_id);
             }
         }
     }
     //ghi log process
     $logAfterProcess = $trackingModel->logAfterProcess($responseType, $expandFields, $logPreProcess);
     //response to client
     pr($expandFields);
     pr($responseType, 1);
     if ($event == 'click' && Input::get('to')) {
         //redirect to ad's destination url on click event
         return Redirect::to(urldecode(Input::get('to')));
     } else {
//.........这里部分代码省略.........
开发者ID:huycao,项目名称:yoplatform,代码行数:101,代码来源:DeliveryController.php


注:本文中的Tracking::getTrackingEventType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。