Exemplo n.º 1
0
 protected function logImpressionsStatisticsData($tld, $total_bids, $spend_offered_in_bids)
 {
     if ($this->RtbBidRequest != null) {
         /*
          * CREATE AN HOURLY TALLY OF INCOMING RTB BIDS
          * FROM BOTH LOCAL PUBS AND REMOTE SSP RTB SITE ID
          * CHANNELS IN ORDER TO PROVIDE THE SITE SCOUT
          * RTB CHANNEL CHOOSER FUNCTIONALITY IN AN EXCEL LIKE
          * GRID LAYOUT WITH THE DAILY IMPS IN A SORTABLE COLUMN
          */
         $buyside_partner_name = $this->rtb_ssp_friendly_name;
         $rtb_channel_site_domain = $tld;
         $auction_bids_counter = $total_bids;
         $rtb_ids = \util\WorkflowHelper::getIdsFromRtbRequest($this->RtbBidRequest);
         $rtb_channel_site_id = $rtb_ids["rtb_channel_site_id"];
         $rtb_channel_site_name = $rtb_ids["rtb_channel_site_name"];
         $rtb_channel_publisher_name = $rtb_ids["rtb_channel_publisher_name"];
         $rtb_channel_site_iab_category = $rtb_ids["rtb_channel_site_iab_category"];
         $impressions_offered_counter = $rtb_ids["impressions_offered_counter"];
         $floor_price_if_any = 0;
         if (isset($this->RtbBidRequest->RtbBidRequestImpList) && is_array($this->RtbBidRequest->RtbBidRequestImpList)) {
             foreach ($this->RtbBidRequest->RtbBidRequestImpList as $RtbBidRequestImp) {
                 if (isset($RtbBidRequestImp->bidfloor) && $RtbBidRequestImp->bidfloor > $floor_price_if_any) {
                     $floor_price_if_any = floatval($RtbBidRequestImp->bidfloor);
                 }
             }
         }
         $method_params = array("buyside_partner_name" => $buyside_partner_name, "rtb_channel_site_id" => $rtb_channel_site_id, "rtb_channel_site_name" => $rtb_channel_site_name, "rtb_channel_site_domain" => $rtb_channel_site_domain, "rtb_channel_site_iab_category" => $rtb_channel_site_iab_category, "rtb_channel_publisher_name" => $rtb_channel_publisher_name, "impressions_offered_counter" => $impressions_offered_counter, "auction_bids_counter" => $auction_bids_counter, "spend_offered_in_bids" => $spend_offered_in_bids, "floor_price_if_any" => $floor_price_if_any);
         if ($this->is_local_request === true) {
             /*
              * In the local context, $rtb_channel_site_id is the PublisherWebsiteID
              */
             $PrivateExchangeRtbChannelDailyStatsFactory = \_factory\PrivateExchangeRtbChannelDailyStats::get_instance();
             $PrivateExchangeRtbChannelDailyStatsFactory->incrementPrivateExchangeRtbChannelDailyStatsCached($this->config, $method_params);
         } else {
             $SspRtbChannelDailyStatsFactory = \_factory\SspRtbChannelDailyStats::get_instance();
             $SspRtbChannelDailyStatsFactory->incrementSspRtbChannelDailyStatsCached($this->config, $method_params);
         }
     }
 }