public function parse_request(&$Logger, \buyrtb\parsers\openrtb\OpenRTBParser &$Parser, \model\openrtb\RtbBidRequestBanner &$RtbBidRequestBanner, &$ad_impression_banner) { // Parse Dimensions try { \buyrtb\parsers\openrtb\parselets\common\banner\ParseDimensions::execute($Logger, $Parser, $RtbBidRequestBanner, $ad_impression_banner); } catch (Exception $e) { throw new Exception($e->getMessage(), $e->getCode(), $e->getPrevious()); } // Banner ID \util\ParseHelper::parse_item($RtbBidRequestBanner, $ad_impression_banner, "id"); // Parse Above the Fold try { \buyrtb\parsers\openrtb\parselets\common\banner\ParseAboveTheFold::execute($Logger, $Parser, $RtbBidRequestBanner, $ad_impression_banner); } catch (Exception $e) { throw new Exception($e->getMessage(), $e->getCode(), $e->getPrevious()); } // Blocked Creative Types \util\ParseHelper::parse_item_list($RtbBidRequestBanner, $ad_impression_banner, "btype"); // Blocked Creative Attributes \util\ParseHelper::parse_item_list($RtbBidRequestBanner, $ad_impression_banner, "battr"); // Supported Mime Types \util\ParseHelper::parse_item_list($RtbBidRequestBanner, $ad_impression_banner, "mimes"); // Is In Top Most DOM Document ( not in IFRAME ) \util\ParseHelper::parse_item($RtbBidRequestBanner, $ad_impression_banner, "topframe"); // Expandable Ad Properties ( IAB Rising Stars ) \util\ParseHelper::parse_item_list($RtbBidRequestBanner, $ad_impression_banner, "expdir"); // Supported API Frameworks \util\ParseHelper::parse_item_list($RtbBidRequestBanner, $ad_impression_banner, "api"); }
public static function execute(&$Logger, \buyrtb\parsers\openrtb\OpenRTBParser &$Parser, \model\openrtb\RtbBidRequest &$RtbBidRequest, \model\openrtb\RtbBidRequestGeo &$RtbBidRequestGeo, &$geo) { // location latitude \util\ParseHelper::parse_item($RtbBidRequestGeo, $geo, "lat"); // location longitude \util\ParseHelper::parse_item($RtbBidRequestGeo, $geo, "lon"); // location country \util\ParseHelper::parse_item($RtbBidRequestGeo, $geo, "country"); // location state or region \util\ParseHelper::parse_item($RtbBidRequestGeo, $geo, "region"); // location state or region fips \util\ParseHelper::parse_item($RtbBidRequestGeo, $geo, "regionfips104"); // location metro area code // http://code.google.com/apis/adwords/docs/appendix/metrocodes.htm \util\ParseHelper::parse_item($RtbBidRequestGeo, $geo, "metro"); // location city code // http://www.unece.org/cefact/locode/service/location.htm \util\ParseHelper::parse_item($RtbBidRequestGeo, $geo, "city"); // location zip \util\ParseHelper::parse_item($RtbBidRequestGeo, $geo, "zip"); // location geo data source \util\ParseHelper::parse_item($RtbBidRequestGeo, $geo, "type"); if (isset($RtbBidRequestGeo->country)) { $Logger->log[] = "Geo Data Country: " . $RtbBidRequestGeo->country; } if (isset($RtbBidRequestGeo->region)) { $Logger->log[] = "Geo Data Region: " . $RtbBidRequestGeo->region; } if (isset($RtbBidRequestGeo->city)) { $Logger->log[] = "Geo Data City: " . $RtbBidRequestGeo->city; } }
public static function execute(&$Logger, \sellrtb\parsers\openrtb\OpenRTBParser &$Parser, \model\openrtb\RtbBidResponse &$RtbBidResponse) { /* * Initialize Data */ /* * Get the incoming bid request data from the * HTTP RESPONSE * * If the required fields are not there throw an exception * to the caller */ $Logger->min_log[] = "POST: " . $Parser->raw_post; if ($Parser->raw_post) { $Parser->json_response = json_decode($Parser->raw_post, true); } else { $Parser->json_response = null; } if ($Parser->json_response === null) { throw new Exception($Parser->expeption_missing_min_bid_request_params . ": JSON RESPONSE DATA"); } $Logger->log[] = "RESPONSE: " . print_r($Parser->json_response, true); \util\ParseHelper::parse_with_exception($RtbBidResponse, $Parser->json_response, $Parser->expeption_missing_min_bid_request_params . ": id", "id"); \util\ParseHelper::parse_item($RtbBidResponse, $Parser->json_response, "bidid"); \util\ParseHelper::parse_item($RtbBidResponse, $Parser->json_response, "cur"); \util\ParseHelper::parse_item($RtbBidResponse, $Parser->json_response, "customdata"); \util\ParseHelper::parse_item($RtbBidResponse, $Parser->json_response, "nbr"); }
public static function execute(&$Logger, \buyrtb\parsers\openrtb\OpenRTBParser &$Parser, \model\openrtb\RtbBidRequest &$RtbBidRequest) { /* * Initialize Data */ /* * Get the incoming bid request data from the * HTTP REQUEST * * If the required fields are not there throw an exception * to the caller */ /* * mobile, rich media, ect.. * mobile web, phone, tablet, native iOS or native Android */ if ($Parser->raw_post === null) { $Parser->raw_post = file_get_contents('php://input'); } $Logger->min_log[] = "POST: " . $Parser->raw_post; if ($Parser->raw_post) { $Parser->json_post = json_decode($Parser->raw_post, true); } else { $Parser->json_post = null; } $Parser->bid_request_mobile = 0; if ($Parser->json_post === null) { throw new Exception($Parser->expeption_missing_min_bid_request_params . ": JSON POST DATA"); } $Logger->log[] = "POST: " . print_r($Parser->json_post, true); \util\ParseHelper::parse_with_exception($RtbBidRequest, $Parser->json_post, $Parser->expeption_missing_min_bid_request_params . ": id", "id"); }
public static function execute(&$Logger, \buyrtb\parsers\openrtb\OpenRTBParser &$Parser, \model\openrtb\native\request\RtbBidRequestNativeTitle &$RtbBidRequestNativeTitle, &$rtb_native_title) { // Title try { \util\ParseHelper::parse_with_exception($RtbBidRequestNativeTitle, $rtb_native_title, $Parser->expeption_missing_min_bid_request_params . ": len", "len"); } catch (Exception $e) { throw new Exception($e->getMessage(), $e->getCode(), $e->getPrevious()); } }
public static function execute(&$Logger, \buyrtb\parsers\openrtb\OpenRTBParser &$Parser, \model\openrtb\native\request\RtbBidRequestNativeVideo &$RtbBidRequestNativeVideo, &$rtb_native_video) { // get list of supported mime types for video content \util\ParseHelper::parse_list_with_exception($RtbBidRequestNativeVideo, $rtb_native_video, $Parser->expeption_missing_min_bid_request_params . ": video mimes", "mimes"); \util\ParseHelper::parse_with_exception($RtbBidRequestNativeVideo, $rtb_native_video, $Parser->expeption_missing_min_bid_request_params . ": video minduration", "minduration"); \util\ParseHelper::parse_with_exception($RtbBidRequestNativeVideo, $rtb_native_video, $Parser->expeption_missing_min_bid_request_params . ": video maxduration", "maxduration"); // Protocol List \util\ParseHelper::parse_list_with_exception($RtbBidRequestNativeVideo, $rtb_native_video, $Parser->expeption_missing_min_bid_request_params . ": video protocols", "protocols"); }
public static function execute(&$Logger, \buyrtbfidelity\parsers\openrtb\OpenRTBParser &$Parser, \model\openrtb\RtbBidRequest &$RtbBidRequest, \model\openrtb\RtbBidRequestSegment &$RtbBidRequestSegment, &$segment) { // segment id \util\ParseHelper::parse_item($RtbBidRequestSegment, $segment, "id"); // segment name \util\ParseHelper::parse_item($RtbBidRequestSegment, $segment, "name"); // segment value \util\ParseHelper::parse_item($RtbBidRequestSegment, $segment, "value"); }
public static function execute(&$Logger, \buyrtbfidelity\parsers\openrtb\OpenRTBParser &$Parser, \model\openrtb\RtbBidRequest &$RtbBidRequest, \model\openrtb\RtbBidRequestImpExtensions &$RtbBidRequestImpExtensions, &$rtb_imp_extensions) { /* * The attribute strictbannersize of type integer will be provided in the placeholder object Impression.ext * in the bid request as to convey following information beyond the standard defined in the OpenRTB 2.0 * specification: if 1, only a banner of exactly the size as specified in Banner.w and Banner.h will be accepted. * If 0 or omitted, a banner of the size as specified or smaller will be accepted. */ \util\ParseHelper::parse_item($RtbBidRequestImpExtensions, $rtb_imp_extensions, "strictbannersize"); }
public function parse_request(&$Logger, \buyrtb\parsers\openrtb\OpenRTBParser &$Parser, \model\openrtb\native\request\RtbBidRequestNative &$RtbBidRequestNative, &$ad_impression_native) { // get list of supported mime types for video content // Version \util\ParseHelper::parse_item($RtbBidRequestNative, $ad_impression_native, "ver"); // Layout /* * 1 Content Wall * 2 App Wall * 3 News Feed * 4 Chat List * 5 Carousel * 6 Content Stream * 7 Grid adjoining the content * 500+ Reserved for Exchange specific layouts. */ \util\ParseHelper::parse_item($RtbBidRequestNative, $ad_impression_native, "layout"); // Ad unit /* * 1 Paid Search Units * 2 Recommendation Widgets * 3 Promoted Listings * 4 In-Ad (IAB Standard) with Native Element Units * 5 Custom / "Can't Be Contained" * 500+ Reserved for Exchange specific layouts. */ \util\ParseHelper::parse_item($RtbBidRequestNative, $ad_impression_native, "adunit"); // The number of identical placements in this Layout \util\ParseHelper::parse_item($RtbBidRequestNative, $ad_impression_native, "plcmtcnt"); /* * see the IAB Core Six layout types * http://www.iab.net/media/file/IAB-Native-Advertising-Playbook2.pdf */ \util\ParseHelper::parse_item($RtbBidRequestNative, $ad_impression_native, "seq"); // A required array of companion RtbBidRequestNativeAsset objects if (isset($ad_impression_native["assets"]) && is_array($ad_impression_native["assets"]) && count($ad_impression_native["assets"])) { $last_exception = null; foreach ($ad_impression_native["assets"] as $asset) { // this is a native asset $RtbBidRequestNativeAsset = new \model\openrtb\native\request\RtbBidRequestNativeAsset(); try { \buyrtb\parsers\openrtb\parselets\common\native\ParseAsset::execute($Logger, $Parser, $RtbBidRequestNativeAsset, $asset); } catch (Exception $e) { $last_exception = $e; continue; } $RtbBidRequestNative->RtbBidRequestAssetList[] = $RtbBidRequestNativeAsset; } if (!count($RtbBidRequestNative->RtbBidRequestAssetList)) { throw new Exception("At least one assets object in the Native object is required: LAST MESSAGE: " . $last_exception->getMessage(), $last_exception->getCode(), $last_exception->getPrevious()); } } else { throw new Exception("At least one assets object in the Native object is required"); } }
public function parse_request(&$Logger, \buyrtbfidelity\parsers\openrtb\OpenRTBParser &$Parser, \model\openrtb\RtbBidRequestVideo &$RtbBidRequestVideo, &$ad_impression_video) { // get list of supported mime types for video content \util\ParseHelper::parse_list_with_exception($RtbBidRequestVideo, $ad_impression_video, $Parser->expeption_missing_min_bid_request_params . ": video mimes", "mimes"); \util\ParseHelper::parse_with_exception($RtbBidRequestVideo, $ad_impression_video, $Parser->expeption_missing_min_bid_request_params . ": video minduration", "minduration"); \util\ParseHelper::parse_with_exception($RtbBidRequestVideo, $ad_impression_video, $Parser->expeption_missing_min_bid_request_params . ": video maxduration", "maxduration"); // Protocol \util\ParseHelper::parse_item($RtbBidRequestVideo, $ad_impression_video, "protocol"); // Protocol List \util\ParseHelper::parse_item_list($RtbBidRequestVideo, $ad_impression_video, "protocols"); // Video Player Width \util\ParseHelper::parse_item($RtbBidRequestVideo, $ad_impression_video, "w"); // Video Player Height \util\ParseHelper::parse_item($RtbBidRequestVideo, $ad_impression_video, "h"); // Video Start Delay \util\ParseHelper::parse_item($RtbBidRequestVideo, $ad_impression_video, "startdelay"); // Video Linearity \util\ParseHelper::parse_item($RtbBidRequestVideo, $ad_impression_video, "linearity"); // Video Sequence Index \util\ParseHelper::parse_item($RtbBidRequestVideo, $ad_impression_video, "sequence"); // Blocked Creative Attributes \util\ParseHelper::parse_item_list($RtbBidRequestVideo, $ad_impression_video, "battr"); // Maximum Video extension beyond the max duration \util\ParseHelper::parse_item($RtbBidRequestVideo, $ad_impression_video, "maxextended"); // Minimum Video Bitrate \util\ParseHelper::parse_item($RtbBidRequestVideo, $ad_impression_video, "minbitrate"); // Maximum Video Bitrate \util\ParseHelper::parse_item($RtbBidRequestVideo, $ad_impression_video, "maxbitrate"); // Flag which allows letterboxing \util\ParseHelper::parse_item($RtbBidRequestVideo, $ad_impression_video, "boxingallowed"); // Allowed Playback Methods \util\ParseHelper::parse_item_list($RtbBidRequestVideo, $ad_impression_video, "playbackmethod"); // Allowed Delivery Methods \util\ParseHelper::parse_item_list($RtbBidRequestVideo, $ad_impression_video, "delivery"); // Video Position in Page \util\ParseHelper::parse_item($RtbBidRequestVideo, $ad_impression_video, "pos"); // If present, an array of companion RtbBidRequestBanner objects if (isset($ad_impression_video["companionad"]) && is_array($ad_impression_video["companionad"]) && count($ad_impression_video["companionad"])) { $DisplayParser = new \buyrtbfidelity\parsers\openrtb\DisplayParser(); foreach ($ad_impression_video["companionad"] as $companionad) { // this is a banner $RtbBidRequestBanner = new \model\openrtb\RtbBidRequestBanner(); $DisplayParser->parse_request($Logger, $this, $RtbBidRequestBanner, $companionad); $RtbBidRequestVideo->RtbBidRequestBannerList[] = $RtbBidRequestBanner; } } // A List of Supported API Frameworks \util\ParseHelper::parse_item_list($RtbBidRequestVideo, $ad_impression_video, "api"); // A List of Supported Companion Types \util\ParseHelper::parse_item_list($RtbBidRequestVideo, $ad_impression_video, "companiontype"); }
public static function execute(&$Logger, \buyrtbfidelity\parsers\openrtb\OpenRTBParser &$Parser, \model\openrtb\RtbBidRequest &$RtbBidRequest, \model\openrtb\RtbBidRequestExtensions &$RtbBidRequestExtensions, &$rtb_extensions) { // Flag to mark Opera Mini traffic as such \util\ParseHelper::parse_item($RtbBidRequestExtensions, $rtb_extensions, "operaminibrowser"); // Flag to mark the coppa value, see http://business.ftc.gov/privacy-and-security/childrens-privacy \util\ParseHelper::parse_item($RtbBidRequestExtensions, $rtb_extensions, "coppa"); // udi object if (isset($rtb_extensions["udi"])) { $udi = $rtb_extensions["udi"]; $RtbBidRequestExtensionsUdi = new \model\openrtb\RtbBidRequestExtensionsUdi(); \buyrtbfidelity\parsers\openrtb\parselets\common\ParseUdi::execute($Logger, $Parser, $RtbBidRequest, $RtbBidRequestExtensionsUdi, $udi); $RtbBidRequestExtensions->RtbBidRequestExtensionsUdi = $RtbBidRequestExtensionsUdi; } }
public static function execute(&$Logger, \buyrtb\parsers\openrtb\OpenRTBParser &$Parser, \model\openrtb\RtbBidRequest &$RtbBidRequest, \model\openrtb\RtbBidRequestDirectDeals &$RtbBidRequestDirectDeals, &$direct_deal) { // Deal ID \util\ParseHelper::parse_with_exception($RtbBidRequestDirectDeals, $direct_deal, $Parser->expeption_missing_min_bid_request_params . ": direct deal id", "id"); // Deal Bid Floor \util\ParseHelper::parse_item($RtbBidRequestDirectDeals, $direct_deal, "bidfloor"); // Deal Bid Floor Currency \util\ParseHelper::parse_item($RtbBidRequestDirectDeals, $direct_deal, "bidfloorcur"); // Deal Buyer Seats allowed to bid \util\ParseHelper::parse_item_list($RtbBidRequestDirectDeals, $direct_deal, "wseat"); // Deal Advertiser Domains allowed to bid \util\ParseHelper::parse_item_list($RtbBidRequestDirectDeals, $direct_deal, "wadomain"); // Deal Auction type ( second price or first price ) \util\ParseHelper::parse_item($RtbBidRequestDirectDeals, $direct_deal, "at"); }
public static function execute(&$Logger, \buyrtb\parsers\openrtb\OpenRTBParser &$Parser, \model\openrtb\RtbBidRequestBanner &$RtbBidRequestBanner, &$ad_impression_banner) { /* * Get Width and Height */ \util\ParseHelper::parse_with_exception($RtbBidRequestBanner, $ad_impression_banner, $Parser->expeption_missing_min_bid_request_params . ": imp_banner_w", "w"); \util\ParseHelper::parse_with_exception($RtbBidRequestBanner, $ad_impression_banner, $Parser->expeption_missing_min_bid_request_params . ": imp_banner_h", "h"); // Width Max \util\ParseHelper::parse_item($RtbBidRequestBanner, $ad_impression_banner, "wmax"); // Height Max \util\ParseHelper::parse_item($RtbBidRequestBanner, $ad_impression_banner, "hmax"); // Width Min \util\ParseHelper::parse_item($RtbBidRequestBanner, $ad_impression_banner, "wmin"); // Height Min \util\ParseHelper::parse_item($RtbBidRequestBanner, $ad_impression_banner, "hmin"); }
public static function execute(&$Logger, \buyrtb\parsers\openrtb\OpenRTBParser &$Parser, \model\openrtb\RtbBidRequest &$RtbBidRequest, \model\openrtb\RtbBidRequestData &$RtbBidRequestData, &$data) { // data id \util\ParseHelper::parse_item($RtbBidRequestData, $data, "id"); // data name \util\ParseHelper::parse_item($RtbBidRequestData, $data, "name"); // data segment objects if (isset($data["segment"]) && is_array($data["segment"])) { $data_segment_list = $data["segment"]; foreach ($data_segment_list as $data_segment) { $RtbBidRequestSegment = new \model\openrtb\RtbBidRequestSegment(); \buyrtb\parsers\openrtb\parselets\common\ParseSegment::execute($Logger, $Parser, $RtbBidRequest, $RtbBidRequestSegment, $data_segment); $RtbBidRequestData->RtbBidRequestSegmentList[] = $RtbBidRequestSegment; } } }
public static function execute(&$Logger, \sellrtb\parsers\openrtb\OpenRTBParser &$Parser, \model\openrtb\RtbBidResponse &$RtbBidResponse) { if (!isset($Parser->json_response["seatbid"]) || !is_array($Parser->json_response["seatbid"]) || !count($Parser->json_response["seatbid"])) { throw new Exception($Parser->expeption_missing_min_bid_request_params . ": seatbid is empty"); } $RtbBidResponse->RtbBidResponseSeatBidList = array(); foreach ($Parser->json_response["seatbid"] as $seatbid) { $RtbBidResponseSeatBid = new \model\openrtb\RtbBidResponseSeatBid(); \util\ParseHelper::parse_item($RtbBidResponseSeatBid, $seatbid, "seat"); \util\ParseHelper::parse_item($RtbBidResponseSeatBid, $seatbid, "group"); try { \sellrtb\parsers\openrtb\parselets\common\ParseBids::execute($Logger, $Parser, $RtbBidResponseSeatBid, $seatbid); $RtbBidResponse->RtbBidResponseSeatBidList[] = $RtbBidResponseSeatBid; } catch (Exception $e) { // throw new Exception($e->getMessage(), $e->getCode(), $e->getPrevious()); } } }
public static function execute(&$Logger, \buyrtb\parsers\openrtb\OpenRTBParser &$Parser, \model\openrtb\RtbBidRequest &$RtbBidRequest, \model\openrtb\RtbBidRequestPmp &$RtbBidRequestPmp, &$pmp) { // Private Auction ? \util\ParseHelper::parse_item($RtbBidRequestPmp, $pmp, "private_auction"); // PMP deals if (isset($pmp["deals"]) && is_array($pmp["deals"])) { $pmp_deals_list = $pmp["deals"]; foreach ($pmp_deals_list as $pmp_deal) { try { $RtbBidRequestDirectDeals = new \model\openrtb\RtbBidRequestDirectDeals(); \buyrtb\parsers\openrtb\parselets\common\imp\ParseDirectDeals::execute($Logger, $Parser, $RtbBidRequest, $RtbBidRequestDirectDeals, $pmp_deal); $RtbBidRequestUser->RtbBidRequestDirectDealsList[] = $RtbBidRequestDirectDeals; } catch (Exception $e) { throw new Exception($e->getMessage(), $e->getCode(), $e->getPrevious()); } } } }
public static function execute(&$Logger, \buyrtbfidelity\parsers\openrtb\OpenRTBParser &$Parser, \model\openrtb\RtbBidRequest &$RtbBidRequest, \model\openrtb\RtbBidRequestExtensionsUdi &$RtbBidRequestExtensionsUdi, &$udi) { // android id \util\ParseHelper::parse_item($RtbBidRequestExtensionsUdi, $udi, "androidid"); // md5 hashed android id \util\ParseHelper::parse_item($RtbBidRequestExtensionsUdi, $udi, "androididmd5"); // sha1 hashed android id \util\ParseHelper::parse_item($RtbBidRequestExtensionsUdi, $udi, "androididsha1"); // Hardware ID. As of today only commonly used on Android. \util\ParseHelper::parse_item($RtbBidRequestExtensionsUdi, $udi, "imei"); // md5 hashed imei \util\ParseHelper::parse_item($RtbBidRequestExtensionsUdi, $udi, "imeimd5"); // sha1 hashed imei \util\ParseHelper::parse_item($RtbBidRequestExtensionsUdi, $udi, "imeisha1"); // md5 hash of the iOS UDID \util\ParseHelper::parse_item($RtbBidRequestExtensionsUdi, $udi, "udidmd5"); // sha1 hash of the iOS UDID \util\ParseHelper::parse_item($RtbBidRequestExtensionsUdi, $udi, "udidsha1"); // md5 hash of the string representation (lowercase separated by colons) of the WiFi mac address \util\ParseHelper::parse_item($RtbBidRequestExtensionsUdi, $udi, "macmd5"); // sha1 hash of the string representation (lowercase separated by colons) of the WiFi mac address \util\ParseHelper::parse_item($RtbBidRequestExtensionsUdi, $udi, "macsha1"); // sha1 hash of the byte array of the WiFi mac address (iOS) or sha1 of the Android Id string \util\ParseHelper::parse_item($RtbBidRequestExtensionsUdi, $udi, "odin"); // Open-source identification scheme created by marketing company Appsfire \util\ParseHelper::parse_item($RtbBidRequestExtensionsUdi, $udi, "openudid"); // Privacy aware unique identifier on iOS6 and above. Replacement for UDID. \util\ParseHelper::parse_item($RtbBidRequestExtensionsUdi, $udi, "idfa"); // md5 hash of the unique identifier on iOS 6 or above \util\ParseHelper::parse_item($RtbBidRequestExtensionsUdi, $udi, "idfamd5"); // sha1 hash of the unique identifier on iOS 6 or above \util\ParseHelper::parse_item($RtbBidRequestExtensionsUdi, $udi, "idfasha1"); // Opt-in for IDFA (Apple Advertising Id) \util\ParseHelper::parse_item($RtbBidRequestExtensionsUdi, $udi, "idfatracking"); // Privacy aware unique identifier on Android. Replaces Android ID \util\ParseHelper::parse_item($RtbBidRequestExtensionsUdi, $udi, "googleadid"); // Opt-Out for googleadid \util\ParseHelper::parse_item($RtbBidRequestExtensionsUdi, $udi, "googlednt"); // a deviceid sent from BlackBerry 10 SDKs \util\ParseHelper::parse_item($RtbBidRequestExtensionsUdi, $udi, "bbid"); // a deviceid sent from WindowsPhone \util\ParseHelper::parse_item($RtbBidRequestExtensionsUdi, $udi, "wpid"); }
public static function execute(&$Logger, \buyrtb\parsers\openrtb\OpenRTBParser &$Parser, \model\openrtb\native\request\RtbBidRequestNativeImage &$RtbBidRequestNativeImage, &$rtb_native_image) { // Image Type /* * 1 Icon image * 2 Logo image for the brand/app. * 3 Large image preview for the ad * 500+ Reserved for Exchange specific layouts. */ \util\ParseHelper::parse_item($RtbBidRequestNativeImage, $rtb_native_image, "type"); // Width of the image in pixels. \util\ParseHelper::parse_item($RtbBidRequestNativeImage, $rtb_native_image, "w"); // The minimum requested width of the image in pixels. \util\ParseHelper::parse_item($RtbBidRequestNativeImage, $rtb_native_image, "wmin"); // Height of the image in pixels. \util\ParseHelper::parse_item($RtbBidRequestNativeImage, $rtb_native_image, "h"); // The minimum requested height of the image in pixels. \util\ParseHelper::parse_item($RtbBidRequestNativeImage, $rtb_native_image, "hmin"); // get list of supported mime types for images \util\ParseHelper::parse_item_list($RtbBidRequestNativeImage, $rtb_native_image, "mimes"); }
public static function execute(&$Logger, \buyrtb\parsers\openrtb\OpenRTBParser &$Parser, \model\openrtb\native\request\RtbBidRequestNativeData &$RtbBidRequestNativeData, &$rtb_native_data) { // Data Asset Type /* * 1 Sponsored By message where response should contain the brand name of the sponsor. * 2 Descriptive text associated with the product or service being advertised. * 3 Rating of the product being offered to the user. For example an app's rating in an app store from 0-5. * 4 Number of social ratings or "likes" of the product being offered to the user. * 5 Number downloads/installs of this product * 6 Price for product / app / in-app purchase. Value should include currency symbol in localised format. * 7 Sale price that can be used together with price to indicate a discounted price compared to a regular price. Value should include currency symbol in localised format. * 8 Phone number * 9 Address * 10 Additional descriptive text associated with the product or service being advertised * 11 Display URL for the text ad * 12 CTA description - descriptive text describing a 'call to action' button for the destination URL. * 500+ Reserved for Exchange specific layouts. */ \util\ParseHelper::parse_item($RtbBidRequestNativeData, $rtb_native_data, "type"); // Maximum length of the text in response \util\ParseHelper::parse_item($RtbBidRequestNativeData, $rtb_native_data, "len"); }
public static function execute(&$Logger, \buyrtbfidelity\parsers\openrtb\OpenRTBParser &$Parser, \model\openrtb\RtbBidRequest &$RtbBidRequest, \model\openrtb\RtbBidRequestUser &$RtbBidRequestUser, &$rtb_user) { // User ID \util\ParseHelper::parse_item($RtbBidRequestUser, $rtb_user, "id"); // BuyerID, alternative to User ID \util\ParseHelper::parse_item($RtbBidRequestUser, $rtb_user, "buyeruid"); // Year of Birth \util\ParseHelper::parse_item($RtbBidRequestUser, $rtb_user, "yob"); // User Keywords Meta /* * Apparently Neal and Jim not sure on this one, * saying it could be a string or an array of strings */ if (isset($rtb_user["keywords"])) { if (is_array($rtb_user["keywords"])) { \util\ParseHelper::parse_item_list($RtbBidRequestUser, $rtb_user, "keywords"); } else { \util\ParseHelper::parse_item($RtbBidRequestUser, $rtb_user, "keywords"); } } // Custom Data \util\ParseHelper::parse_item($RtbBidRequestUser, $rtb_user, "customdata"); // geo object if (isset($rtb_user["geo"])) { $geo = $rtb_user["geo"]; $RtbBidRequestGeo = new \model\openrtb\RtbBidRequestGeo(); \buyrtbfidelity\parsers\openrtb\parselets\common\ParseGeo::execute($Logger, $Parser, $RtbBidRequest, $RtbBidRequestGeo, $geo); $RtbBidRequestUser->RtbBidRequestGeo = $RtbBidRequestGeo; } // user data objects if (isset($rtb_user["data"]) && is_array($rtb_user["data"])) { $user_data_list = $rtb_user["data"]; foreach ($user_data_list as $user_data) { $RtbBidRequestData = new \model\openrtb\RtbBidRequestData(); \buyrtbfidelity\parsers\openrtb\parselets\common\ParseData::execute($Logger, $Parser, $RtbBidRequest, $RtbBidRequestData, $user_data); $RtbBidRequestUser->RtbBidRequestDataList[] = $RtbBidRequestData; } } }
public static function execute(&$Logger, \buyrtb\parsers\openrtb\OpenRTBParser &$Parser, \model\openrtb\native\request\RtbBidRequestNativeAsset &$RtbBidRequestNativeAsset, &$rtb_native_asset) { // ID \util\ParseHelper::parse_item($RtbBidRequestNativeAsset, $rtb_native_asset, "id"); // Set to 1 if asset is required \util\ParseHelper::parse_item($RtbBidRequestNativeAsset, $rtb_native_asset, "required"); /* * asset object may contain only one of title, img, data or video. */ $has_element = false; if (isset($rtb_native_asset["title"])) { $title = $rtb_native_asset["title"]; $RtbBidRequestNativeAsset->RtbBidRequestNativeTitle = new \model\openrtb\native\request\RtbBidRequestNativeTitle(); \buyrtb\parsers\openrtb\parselets\common\native\ParseTitle::execute($Logger, $Parser, $RtbBidRequestNativeAsset->RtbBidRequestNativeTitle, $title); $has_element = true; } if (isset($rtb_native_asset["img"])) { $image = $rtb_native_asset["img"]; $RtbBidRequestNativeAsset->RtbBidRequestNativeImage = new \model\openrtb\native\request\RtbBidRequestNativeImage(); \buyrtb\parsers\openrtb\parselets\common\native\ParseImage::execute($Logger, $Parser, $RtbBidRequestNativeAsset->RtbBidRequestNativeImage, $image); $has_element = true; } if (isset($rtb_native_asset["video"])) { $video = $rtb_native_asset["video"]; $RtbBidRequestNativeAsset->RtbBidRequestNativeVideo = new \model\openrtb\native\request\RtbBidRequestNativeVideo(); \buyrtb\parsers\openrtb\parselets\common\native\ParseVideo::execute($Logger, $Parser, $RtbBidRequestNativeAsset->RtbBidRequestNativeVideo, $video); $has_element = true; } if (isset($rtb_native_asset["data"])) { $data = $rtb_native_asset["data"]; $RtbBidRequestNativeAsset->RtbBidRequestNativeData = new \model\openrtb\native\request\RtbBidRequestNativeData(); \buyrtb\parsers\openrtb\parselets\common\native\ParseData::execute($Logger, $Parser, $RtbBidRequestNativeAsset->RtbBidRequestNativeData, $data); $has_element = true; } if ($has_element === false) { throw new \Exception("Native Asset object must have at least one Title, Image, Video or Data object"); } }
private static function getRtbBidResponseBidList(\model\openrtb\RtbBidResponseSeatBid &$RtbBidResponseSeatBid) { $bid_list = array(); foreach ($RtbBidResponseSeatBid->RtbBidResponseBidList as $RtbBidResponseBid) { $bid = array(); \util\ParseHelper::setArrayParam($RtbBidResponseBid, $bid, 'id'); \util\ParseHelper::setArrayParam($RtbBidResponseBid, $bid, 'impid'); \util\ParseHelper::setArrayParam($RtbBidResponseBid, $bid, 'price'); \util\ParseHelper::setArrayParam($RtbBidResponseBid, $bid, 'adid'); \util\ParseHelper::setArrayParam($RtbBidResponseBid, $bid, 'nurl'); \util\ParseHelper::setArrayParam($RtbBidResponseBid, $bid, 'adm'); \util\ParseHelper::setArrayParam($RtbBidResponseBid, $bid, 'adomain'); \util\ParseHelper::setArrayParam($RtbBidResponseBid, $bid, 'lurl'); \util\ParseHelper::setArrayParam($RtbBidResponseBid, $bid, 'cid'); \util\ParseHelper::setArrayParam($RtbBidResponseBid, $bid, 'crid'); \util\ParseHelper::setArrayParam($RtbBidResponseBid, $bid, 'attr'); \util\ParseHelper::setArrayParam($RtbBidResponseBid, $bid, 'dealid'); \util\ParseHelper::setArrayParam($RtbBidResponseBid, $bid, 'h'); \util\ParseHelper::setArrayParam($RtbBidResponseBid, $bid, 'w'); $bid_list[] = (object) $bid; } return $bid_list; }
public static function execute(&$Logger, \sellrtb\parsers\openrtb\OpenRTBParser &$Parser, \model\openrtb\RtbBidResponseSeatBid &$RtbBidResponseSeatBid, $seatbid) { if (!isset($seatbid["bid"]) || !is_array($seatbid["bid"]) || !count($seatbid["bid"])) { throw new Exception($Parser->expeption_missing_min_bid_request_params . ": bid is empty"); } foreach ($seatbid["bid"] as $bid) { $RtbBidResponseBid = new \model\openrtb\RtbBidResponseBid(); \util\ParseHelper::parse_with_exception($RtbBidResponseBid, $bid, $Parser->expeption_missing_min_bid_request_params . ": bid id", "id"); \util\ParseHelper::parse_with_exception($RtbBidResponseBid, $bid, $Parser->expeption_missing_min_bid_request_params . ": bid impid", "impid"); \util\ParseHelper::parse_with_exception($RtbBidResponseBid, $bid, $Parser->expeption_missing_min_bid_request_params . ": bid price", "price"); \util\ParseHelper::parse_item($RtbBidResponseBid, $bid, "adid"); \util\ParseHelper::parse_item($RtbBidResponseBid, $bid, "nurl"); \util\ParseHelper::parse_item($RtbBidResponseBid, $bid, "adm"); \util\ParseHelper::parse_item($RtbBidResponseBid, $bid, "adomain"); \util\ParseHelper::parse_item($RtbBidResponseBid, $bid, "lurl"); \util\ParseHelper::parse_item($RtbBidResponseBid, $bid, "cid"); \util\ParseHelper::parse_item($RtbBidResponseBid, $bid, "crid"); \util\ParseHelper::parse_item($RtbBidResponseBid, $bid, "attr"); \util\ParseHelper::parse_item($RtbBidResponseBid, $bid, "dealid"); \util\ParseHelper::parse_item($RtbBidResponseBid, $bid, "h"); \util\ParseHelper::parse_item($RtbBidResponseBid, $bid, "w"); $RtbBidResponseSeatBid->RtbBidResponseBidList[] = $RtbBidResponseBid; } }
public function parse_request($config, $is_local, $rtb_ssp_friendly_name, $raw_post = null) { $this->config = $config; $this->raw_post = $raw_post; // prepare the logger $logger = \rtbbuyv22\RtbBuyV22Logger::get_instance(); // prepare the response object $this->RtbBidRequest = new \model\openrtb\RtbBidRequest(); $this->RtbBidRequest->is_local_request = $is_local; $this->RtbBidRequest->ssp_exchange_name = $rtb_ssp_friendly_name; // Initialize Data try { \buyrtb\parsers\openrtb\parselets\common\Init::execute($logger, $this, $this->RtbBidRequest); } catch (Exception $e) { throw new Exception($e->getMessage(), $e->getCode(), $e->getPrevious()); } // Parse Currency try { \buyrtb\parsers\openrtb\parselets\common\ParseCurrency::execute($logger, $this, $this->RtbBidRequest); } catch (Exception $e) { throw new Exception($e->getMessage(), $e->getCode(), $e->getPrevious()); } // Parse Second Price \util\ParseHelper::parse_item($this->RtbBidRequest, $this->json_post, "at"); // Parse Max Timeout on RTB Bid Response \util\ParseHelper::parse_item($this->RtbBidRequest, $this->json_post, "tmax"); // Parse Allowed Buyer Seat IDs \util\ParseHelper::parse_item_list($this->RtbBidRequest, $this->json_post, "wseat"); // Parse All Available impressions for this publisher boolean \util\ParseHelper::parse_item($this->RtbBidRequest, $this->json_post, "allimps"); // Parse Blocked Advertiser Categories \util\ParseHelper::parse_item_list($this->RtbBidRequest, $this->json_post, "bcat"); // Parse Blocked TLDs for this RTB request, Publisher Black Listed \util\ParseHelper::parse_item_list($this->RtbBidRequest, $this->json_post, "badv"); // Parse Site if (isset($this->json_post["site"])) { $ad_campaign_site = $this->json_post["site"]; $RtbBidRequestSite = new \model\openrtb\RtbBidRequestSite(); try { \buyrtb\parsers\openrtb\parselets\common\ParseWebsite::execute($logger, $this, $this->RtbBidRequest, $RtbBidRequestSite, $ad_campaign_site); $this->RtbBidRequest->RtbBidRequestSite = $RtbBidRequestSite; } catch (Exception $e) { throw new Exception($e->getMessage(), $e->getCode(), $e->getPrevious()); } } // Parse App if (isset($this->json_post["app"])) { $rtb_app = $this->json_post["app"]; $RtbBidRequestApp = new \model\openrtb\RtbBidRequestApp(); try { \buyrtb\parsers\openrtb\parselets\common\ParseApp::execute($logger, $this, $this->RtbBidRequest, $RtbBidRequestApp, $rtb_app); $this->RtbBidRequest->RtbBidRequestApp = $RtbBidRequestApp; } catch (Exception $e) { throw new Exception($e->getMessage(), $e->getCode(), $e->getPrevious()); } } // Parse User if (isset($this->json_post["user"])) { $rtb_user = $this->json_post["user"]; $RtbBidRequestUser = new \model\openrtb\RtbBidRequestUser(); try { \buyrtb\parsers\openrtb\parselets\common\ParseUser::execute($logger, $this, $this->RtbBidRequest, $RtbBidRequestUser, $rtb_user); $this->RtbBidRequest->RtbBidRequestUser = $RtbBidRequestUser; } catch (Exception $e) { throw new Exception($e->getMessage(), $e->getCode(), $e->getPrevious()); } } // Parse Device $RtbBidRequestDevice = new \model\openrtb\RtbBidRequestDevice(); if (isset($this->json_post["device"])) { $device = $this->json_post["device"]; try { \buyrtb\parsers\openrtb\parselets\common\device\ParseDevice::execute($logger, $this, $this->RtbBidRequest, $RtbBidRequestDevice, $device); $logger->log[] = "Is Mobile: " . $RtbBidRequestDevice->devicetype != 2; } catch (Exception $e) { throw new Exception($e->getMessage(), $e->getCode(), $e->getPrevious()); } } $this->RtbBidRequest->RtbBidRequestDevice = $RtbBidRequestDevice; // Parse Regs if (isset($this->json_post["regs"])) { $ad_regs = $this->json_post["regs"]; $RtbBidRequestRegulations = new \model\openrtb\RtbBidRequestRegulations(); try { \buyrtb\parsers\openrtb\parselets\common\ParseRegs::execute($logger, $this, $this->RtbBidRequest, $RtbBidRequestRegulations, $ad_regs); $this->RtbBidRequest->RtbBidRequestRegulations = $RtbBidRequestRegulations; } catch (Exception $e) { throw new Exception($e->getMessage(), $e->getCode(), $e->getPrevious()); } } // process all ad impressions if (!isset($this->json_post["imp"][0])) { throw new Exception($this->expeption_missing_min_bid_request_params . ": at least 1 imp object"); } $ad_impression_list = $this->json_post["imp"]; foreach ($ad_impression_list as $ad_impression) { $RtbBidRequestImp = new \model\openrtb\RtbBidRequestImp(); // Parse Imp ID try { \util\ParseHelper::parse_with_exception($RtbBidRequestImp, $ad_impression, $this->expeption_missing_min_bid_request_params . ": imp_id", "id"); } catch (Exception $e) { throw new Exception($e->getMessage(), $e->getCode(), $e->getPrevious()); } // Parse Imp Display Manager \util\ParseHelper::parse_item($RtbBidRequestImp, $ad_impression, "displaymanager"); // Parse Imp Display Manager Version \util\ParseHelper::parse_item($RtbBidRequestImp, $ad_impression, "displaymanagerver"); // Parse Imp Is Interstitial \util\ParseHelper::parse_item($RtbBidRequestImp, $ad_impression, "instl"); // Parse SSP tag id DOM parent of RTB Auction Ad Zone in Publisher web page \util\ParseHelper::parse_item($RtbBidRequestImp, $ad_impression, "tagid"); // Parse Imp Floor Price \util\ParseHelper::parse_item($RtbBidRequestImp, $ad_impression, "bidfloor"); // Parse Imp Floor Currency \util\ParseHelper::parse_item($RtbBidRequestImp, $ad_impression, "bidfloorcur"); // Parse Imp https:// SSL flag \util\ParseHelper::parse_item($RtbBidRequestImp, $ad_impression, "secure"); // Parse Imp IFRAME Buster list \util\ParseHelper::parse_item_list($RtbBidRequestImp, $ad_impression, "secure"); // Parse Private Markplace (PMP) if (isset($ad_impression["pmp"])) { $pmp = $ad_impression["pmp"]; $RtbBidRequestPmp = new \model\openrtb\RtbBidRequestPmp(); try { \buyrtb\parsers\openrtb\parselets\common\imp\ParsePrivateMarketPlace::execute($logger, $this, $this->RtbBidRequest, $RtbBidRequestPmp, $pmp); $RtbBidRequestImp->RtbBidRequestPmp = $RtbBidRequestPmp; } catch (Exception $e) { throw new Exception($e->getMessage(), $e->getCode(), $e->getPrevious()); } } if (isset($ad_impression["banner"])) { // this is a banner $ad_impression_banner = $ad_impression["banner"]; $RtbBidRequestImp->media_type = "banner"; $RtbBidRequestImp->RtbBidRequestBanner = new \model\openrtb\RtbBidRequestBanner(); $DisplayParser = new \buyrtb\parsers\openrtb\DisplayParser(); $DisplayParser->parse_request($logger, $this, $RtbBidRequestImp->RtbBidRequestBanner, $ad_impression_banner); } elseif (isset($ad_impression["video"])) { // this is a video $ad_impression_video = $ad_impression["video"]; $RtbBidRequestImp->media_type = "video"; $RtbBidRequestImp->RtbBidRequestVideo = new \model\openrtb\RtbBidRequestVideo(); $VideoParser = new \buyrtb\parsers\openrtb\VideoParser(); $VideoParser->parse_request($logger, $this, $RtbBidRequestImp->RtbBidRequestVideo, $ad_impression_video); } elseif (!empty($ad_impression["native"]["request"])) { // this is a native ad $ad_impression_native_raw = json_decode($ad_impression["native"]["request"], true); if (empty($ad_impression_native_raw["native"])) { throw new Exception($this->expeption_missing_min_bid_request_params . ": decoded native object is missing in the imp"); } $ad_impression_native = $ad_impression_native_raw["native"]; $RtbBidRequestImp->media_type = "native"; $RtbBidRequestImp->RtbBidRequestNative = new \model\openrtb\native\request\RtbBidRequestNative(); $NativeParser = new \buyrtb\parsers\openrtb\NativeParser(); $NativeParser->parse_request($logger, $this, $RtbBidRequestImp->RtbBidRequestNative, $ad_impression_native); } else { throw new Exception($this->expeption_missing_min_bid_request_params . ": at least one banner or video object in the imp"); } $this->RtbBidRequest->RtbBidRequestImpList[] = $RtbBidRequestImp; } return $this->RtbBidRequest; }
public static function execute(&$Logger, \buyrtbfidelity\parsers\openrtb\OpenRTBParser &$Parser, \model\openrtb\RtbBidRequest &$RtbBidRequest, \model\openrtb\RtbBidRequestDevice &$RtbBidRequestDevice, &$device) { $RtbBidRequestDevice->devicetype = DEVICE_DESKTOP; if (!isset($Parser->json_post["device"])) { return; } $default_device = $Parser->json_post["device"]; // do not track bit \util\ParseHelper::parse_item($RtbBidRequestDevice, $default_device, "dnt"); // User Agent. If URL encoded, decode if (isset($default_device["ua"])) { \util\ParseHelper::parse_item($RtbBidRequestDevice, $default_device, "ua"); if (strpos($RtbBidRequestDevice->ua, '%20') !== false) { $RtbBidRequestDevice->ua = urldecode($RtbBidRequestDevice->ua); } } /* * NginAd requires the User's IP Address * for black listing purposes and for fill ratios * against the MD5 checksum. * * The OpenRTB spec states it's optional */ \util\ParseHelper::parse_with_exception($RtbBidRequestDevice, $default_device, $Parser->expeption_missing_min_bid_request_params . ": device_ip", "ip"); // geo object if (isset($default_device["geo"])) { $geo = $default_device["geo"]; $RtbBidRequestGeo = new \model\openrtb\RtbBidRequestGeo(); \buyrtbfidelity\parsers\openrtb\parselets\common\ParseGeo::execute($Logger, $Parser, $RtbBidRequest, $RtbBidRequestGeo, $geo); $RtbBidRequestDevice->RtbBidRequestGeo = $RtbBidRequestGeo; } // device id SHA1 \util\ParseHelper::parse_item($RtbBidRequestDevice, $default_device, "didsha1"); // device id MD5 \util\ParseHelper::parse_item($RtbBidRequestDevice, $default_device, "didmd5"); // platform device id SHA1 \util\ParseHelper::parse_item($RtbBidRequestDevice, $default_device, "dpidsha1"); // platform device id MD5 \util\ParseHelper::parse_item($RtbBidRequestDevice, $default_device, "dpidmd5"); // mac address SHA1 \util\ParseHelper::parse_item($RtbBidRequestDevice, $default_device, "macsha1"); // mac address MD5 \util\ParseHelper::parse_item($RtbBidRequestDevice, $default_device, "macmd5"); // IPv6 address \util\ParseHelper::parse_item($RtbBidRequestDevice, $default_device, "ipv6"); // mobile ISP carrier \util\ParseHelper::parse_item($RtbBidRequestDevice, $default_device, "carrier"); // language code ( alpha-2/ISO 639-1 ) \util\ParseHelper::parse_item($RtbBidRequestDevice, $default_device, "language"); // Device OEM make \util\ParseHelper::parse_item($RtbBidRequestDevice, $default_device, "make"); // Device OEM model \util\ParseHelper::parse_item($RtbBidRequestDevice, $default_device, "model"); // OS name \util\ParseHelper::parse_item($RtbBidRequestDevice, $default_device, "os"); // OS version \util\ParseHelper::parse_item($RtbBidRequestDevice, $default_device, "osv"); // Bit Flag for Javascript Enabled \util\ParseHelper::parse_item($RtbBidRequestDevice, $default_device, "js"); // Connection type id \util\ParseHelper::parse_item($RtbBidRequestDevice, $default_device, "connectiontype"); // device type id if (!empty($default_device["devicetype"])) { $RtbBidRequestDevice->devicetype = intval($default_device["devicetype"]); } elseif (isset($RtbBidRequestDevice->model)) { if (\mobileutil\MobileDeviceType::isPhone($RtbBidRequestDevice->model) === true) { $RtbBidRequestDevice->devicetype = DEVICE_MOBILE; } elseif (\mobileutil\MobileDeviceType::isTablet($RtbBidRequestDevice->model) === true) { $RtbBidRequestDevice->devicetype = DEVICE_TABLET; } } if ($RtbBidRequestDevice->devicetype == DEVICE_DESKTOP && isset($RtbBidRequestDevice->ua) && $RtbBidRequestDevice->ua != null) { $detect = new \mobileutil\MobileDetect(null, $RtbBidRequestDevice->ua); if ($detect->isTablet()) { $RtbBidRequestDevice->devicetype = DEVICE_TABLET; } elseif ($detect->isMobile()) { $RtbBidRequestDevice->devicetype = DEVICE_MOBILE; } } // adobe flash version \util\ParseHelper::parse_item($RtbBidRequestDevice, $default_device, "flashver"); // native ads unique id \util\ParseHelper::parse_item($RtbBidRequestDevice, $default_device, "ifa"); }
/** * * @return \Zend\View\Model\ViewModel */ public function editlineitemAction() { $id = $this->getEvent()->getRouteMatch()->getParam('param1'); if ($id == null) { die("Invalid Banner ID"); } $initialized = $this->initialize(); if ($initialized !== true) { return $initialized; } $is_preview = $this->getRequest()->getQuery('ispreview'); // verify if ($is_preview == "true") { $is_preview = \transformation\TransformPreview::doesPreviewBannerExist($id, $this->auth); } $banner_preview_id = ""; if ($is_preview == true) { // ACL PREVIEW PERMISSIONS CHECK transformation\CheckPermissions::checkEditPermissionInsertionOrderLineItemPreview($id, $this->auth, $this->config_handle); $InsertionOrderLineItemVideoRestrictionsPreviewFactory = \_factory\InsertionOrderLineItemVideoRestrictionsPreview::get_instance(); $params = array(); $params["InsertionOrderLineItemPreviewID"] = $id; $InsertionOrderLineItemVideoRestrictions = $InsertionOrderLineItemVideoRestrictionsPreviewFactory->get_row($params); $InsertionOrderLineItemPreviewFactory = \_factory\InsertionOrderLineItemPreview::get_instance(); $params = array(); $params["Active"] = 1; $params["InsertionOrderLineItemPreviewID"] = $id; $banner_preview_id = $id; $InsertionOrderLineItem = $InsertionOrderLineItemPreviewFactory->get_row($params); $PmpDealPublisherWebsiteToInsertionOrderLineItemPreviewFactory = \_factory\PmpDealPublisherWebsiteToInsertionOrderLineItemPreview::get_instance(); $params = array(); $params["InsertionOrderLineItemPreviewID"] = $banner_preview_id; $PmpDealPublisherWebsiteToInsertionOrderLineItemList = $PmpDealPublisherWebsiteToInsertionOrderLineItemPreviewFactory->get($params); $SspRtbChannelToInsertionOrderLineItemPreviewFactory = \_factory\SspRtbChannelToInsertionOrderLineItemPreview::get_instance(); $params = array(); $params["InsertionOrderLineItemPreviewID"] = $banner_preview_id; $SspRtbChannelToInsertionOrderLineItemList = $SspRtbChannelToInsertionOrderLineItemPreviewFactory->get($params); } else { // ACL PERMISSIONS CHECK transformation\CheckPermissions::checkEditPermissionInsertionOrderLineItem($id, $this->auth, $this->config_handle); $InsertionOrderLineItemVideoRestrictionsFactory = \_factory\InsertionOrderLineItemVideoRestrictions::get_instance(); $params = array(); $params["InsertionOrderLineItemID"] = $id; $InsertionOrderLineItemVideoRestrictions = $InsertionOrderLineItemVideoRestrictionsFactory->get_row($params); $InsertionOrderLineItemFactory = \_factory\InsertionOrderLineItem::get_instance(); $params = array(); $params["Active"] = 1; $params["InsertionOrderLineItemID"] = $id; $InsertionOrderLineItem = $InsertionOrderLineItemFactory->get_row($params); $PmpDealPublisherWebsiteToInsertionOrderLineItemFactory = \_factory\PmpDealPublisherWebsiteToInsertionOrderLineItem::get_instance(); $params = array(); $params["InsertionOrderLineItemID"] = $id; $PmpDealPublisherWebsiteToInsertionOrderLineItemList = $PmpDealPublisherWebsiteToInsertionOrderLineItemFactory->get($params); $SspRtbChannelToInsertionOrderLineItemFactory = \_factory\SspRtbChannelToInsertionOrderLineItem::get_instance(); $params = array(); $params["InsertionOrderLineItemID"] = $id; $SspRtbChannelToInsertionOrderLineItemList = $SspRtbChannelToInsertionOrderLineItemFactory->get($params); } if ($InsertionOrderLineItem == null) { die("Invalid {$InsertionOrderLineItem} ID"); } $campaignid = isset($InsertionOrderLineItem->InsertionOrderID) ? $InsertionOrderLineItem->InsertionOrderID : ""; $bannerid = isset($InsertionOrderLineItem->InsertionOrderLineItemID) ? $InsertionOrderLineItem->InsertionOrderLineItemID : ""; $campaignpreviewid = isset($InsertionOrderLineItem->InsertionOrderPreviewID) ? $InsertionOrderLineItem->InsertionOrderPreviewID : ""; $bannerpreviewid = isset($InsertionOrderLineItem->InsertionOrderLineItemPreviewID) ? $InsertionOrderLineItem->InsertionOrderLineItemPreviewID : ""; $bannername = $InsertionOrderLineItem->Name; $startdate = date('m/d/Y', strtotime($InsertionOrderLineItem->StartDate)); $enddate = date('m/d/Y', strtotime($InsertionOrderLineItem->EndDate)); $current_mobile = $InsertionOrderLineItem->IsMobile; if ($InsertionOrderLineItem->IsMobile == 2) { $size_list = \util\BannerOptions::$iab_mobile_tablet_banner_options; } elseif ($InsertionOrderLineItem->IsMobile > 0) { $size_list = \util\BannerOptions::$iab_mobile_phone_banner_options; } else { $size_list = \util\BannerOptions::$iab_banner_options; } $height = $InsertionOrderLineItem->Height; $width = $InsertionOrderLineItem->Width; $weight = $InsertionOrderLineItem->Weight; $bidamount = $InsertionOrderLineItem->BidAmount; $adtag = $InsertionOrderLineItem->AdTag; $landingpagetld = $InsertionOrderLineItem->LandingPageTLD; $current_iabsize = $InsertionOrderLineItem->IABSize; $ImpressionType = $InsertionOrderLineItem->ImpressionType; if ($ImpressionType == 'image') { preg_match('/< *img[^>]*src *= *["\']?([^"\']*)/i', $adtag, $matches); if (!isset($matches[1])) { die("Required Field: <img src= attribute was missing"); } preg_match('/href=[\'"]?([^\\s\\>\'"]*)[\'"\\>]/', $adtag, $matches); if (!isset($matches[1])) { die("Required Field: <a href= attribute was missing"); } } $current_mimes = array(); $current_apis_supported = array(); $current_protocols = array(); $current_delivery_methods = array(); $current_playback_methods = array(); $current_start_delay = ""; $current_linearity = ""; $impression_type = "banner"; if ($InsertionOrderLineItemVideoRestrictions != null) { $current_mimes_raw = $InsertionOrderLineItemVideoRestrictions->MimesCommaSeparated; $current_apis_supported_raw = $InsertionOrderLineItemVideoRestrictions->ApisSupportedCommaSeparated; $current_protocols_raw = $InsertionOrderLineItemVideoRestrictions->ProtocolsCommaSeparated; $current_delivery_methods_raw = $InsertionOrderLineItemVideoRestrictions->DeliveryCommaSeparated; $current_playback_methods_raw = $InsertionOrderLineItemVideoRestrictions->PlaybackCommaSeparated; $current_start_delay = $InsertionOrderLineItemVideoRestrictions->StartDelay; $current_linearity = $InsertionOrderLineItemVideoRestrictions->Linearity; $current_mimes = array(); if ($current_mimes_raw) { $current_mimes = explode(',', $current_mimes_raw); } $current_apis_supported = array(); if ($current_apis_supported_raw) { $current_apis_supported = explode(',', $current_apis_supported_raw); } $current_protocols = array(); if ($current_protocols_raw) { $current_protocols = explode(',', $current_protocols_raw); } $current_delivery_methods = array(); if ($current_delivery_methods_raw) { $current_delivery_methods = explode(',', $current_delivery_methods_raw); } $current_playback_methods = array(); if ($current_playback_methods_raw) { $current_playback_methods = explode(',', $current_playback_methods_raw); } } $is_vast_url = \util\ParseHelper::isVastURL($adtag); $vast_type = $is_vast_url == true ? "url" : "xml"; $imageurl = ""; $landingpageurl = ""; if ($ImpressionType == "image") { preg_match('/< *img[^>]*src *= *["\']?([^"\']*)/i', $adtag, $matches); if (isset($matches[1])) { $imageurl = $matches[1]; } preg_match('/href=[\'"]?([^\\s\\>\'"]*)[\'"\\>]/', $adtag, $matches); if (isset($matches[1])) { $landingpageurl = $matches[1]; } } return new ViewModel(array('imageurl' => $imageurl, 'landingpageurl' => $landingpageurl, 'campaignid' => $campaignid, 'bannerid' => $bannerid, 'pmp_deal_list' => $PmpDealPublisherWebsiteToInsertionOrderLineItemList, 'ssp_channel_list' => $SspRtbChannelToInsertionOrderLineItemList, 'campaignpreviewid' => $campaignpreviewid, 'bannerpreviewid' => $bannerpreviewid, 'ispreview' => $is_preview == true ? '1' : '0', 'bannername' => $bannername, 'startdate' => $startdate, 'enddate' => $enddate, 'current_mobile' => $current_mobile, 'mobile_options' => \util\BannerOptions::$mobile_options, 'size_list' => $size_list, 'height' => $height, 'width' => $width, 'weight' => $weight, 'bidamount' => $bidamount, 'adtag' => $adtag, 'vast_type' => $vast_type, 'landingpagetld' => $landingpagetld, 'current_iabsize' => $current_iabsize, 'bread_crumb_info' => $this->getBreadCrumbInfoFromBanner($bannerid, $bannerpreviewid, $is_preview), 'user_id_list' => $this->user_id_list_demand_customer, 'center_class' => 'centerj', 'user_identity' => $this->identity(), 'true_user_name' => $this->auth->getUserName(), 'header_title' => 'Edit Insertion Order', 'is_super_admin' => $this->is_super_admin, 'effective_id' => $this->auth->getEffectiveIdentityID(), 'impersonate_id' => $this->ImpersonateID, 'ImpressionType' => $ImpressionType, 'linearity' => \util\BannerOptions::$linearity, 'start_delay' => \util\BannerOptions::$start_delay, 'playback_methods' => \util\BannerOptions::$playback_methods, 'delivery_methods' => \util\BannerOptions::$delivery_methods, 'apis_supported' => \util\BannerOptions::$apis_supported, 'protocols' => \util\BannerOptions::$protocols, 'mimes' => \util\BannerOptions::$mimes, 'current_mimes' => $current_mimes, 'current_apis_supported' => $current_apis_supported, 'current_protocols' => $current_protocols, 'current_delivery_methods' => $current_delivery_methods, 'current_playback_methods' => $current_playback_methods, 'current_start_delay' => $current_start_delay, 'current_linearity' => $current_linearity, 'impression_type' => $impression_type)); }
private static function getRtbBidRequestRegulations(&$RtbBidRequestRegulations) { $regs = array(); \util\ParseHelper::setArrayParam($RtbBidRequestRegulations, $regs, 'coppa'); return (object) $regs; }
public function process_rtb_ping_statistics(&$AuctionPopo) { /* * COLLECT STATS FOR THE BID LOGS */ $bids_total = 0; $bids_won = 0; $bids_lost = 0; $bid_errors = 0; $spend_total_gross = 0; $spend_total_private_exchange_gross = 0; $spend_total_net = 0; $error_list = array(); foreach ($this->RTBPingerList as $RTBPinger) { $SellSidePartnerHourlyBids = new \model\SellSidePartnerHourlyBids(); $SellSidePartnerHourlyBids->SellSidePartnerID = $RTBPinger->partner_id; $SellSidePartnerHourlyBids->PublisherAdZoneID = $this->PublisherAdZoneID; $SellSidePartnerHourlyBids->BidsWonCounter = 0; $SellSidePartnerHourlyBids->BidsLostCounter = 0; $SellSidePartnerHourlyBids->BidsErrorCounter = 0; $SellSidePartnerHourlyBids->SpendTotalGross = 0; $SellSidePartnerHourlyBids->SpendTotalPrivateExchangeGross = 0; $SellSidePartnerHourlyBids->SpendTotalNet = 0; if ($RTBPinger->ping_success == true) { $bids_total += $RTBPinger->total_bids; if ($RTBPinger->won_auction === true) { $bids_won += $RTBPinger->won_bids; $bids_lost += $RTBPinger->lost_bids; $SellSidePartnerHourlyBids->BidsWonCounter = $RTBPinger->won_bids; if ($AuctionPopo->is_second_price_auction === true) { $SellSidePartnerHourlyBids->SpendTotalGross = floatval($AuctionPopo->second_price_winning_bid_price) / 1000; $SellSidePartnerHourlyBids->SpendTotalPrivateExchangeGross = floatval($AuctionPopo->second_price_winning_adjusted_amount_before_private_exchange_markup_bid_price) / 1000; } else { $SellSidePartnerHourlyBids->SpendTotalGross = floatval($RTBPinger->winning_bid) / 1000; $SellSidePartnerHourlyBids->SpendTotalPrivateExchangeGross = floatval($RTBPinger->winning_amount_before_private_exchange_markup_bid) / 1000; } $spend_total_gross = $SellSidePartnerHourlyBids->SpendTotalGross; $spend_total_private_exchange_gross = $SellSidePartnerHourlyBids->SpendTotalPrivateExchangeGross; // Subtract Global Ad Exchange Publisher markup $mark_down = floatval($SellSidePartnerHourlyBids->SpendTotalGross) * floatval($this->publisher_markup_rate); $adusted_amount_before_private_exchange_markup = floatval($SellSidePartnerHourlyBids->SpendTotalGross) - floatval($mark_down); $SellSidePartnerHourlyBids->SpendTotalPrivateExchangeGross = $adusted_amount_before_private_exchange_markup; $spend_total_private_exchange_gross = $SellSidePartnerHourlyBids->SpendTotalPrivateExchangeGross; // Subtract Private Ad Exchange Publisher markup $mark_down_private_exchange = floatval($SellSidePartnerHourlyBids->SpendTotalPrivateExchangeGross) * floatval($this->private_exchange_publisher_markup_rate); $adusted_amount = floatval($adusted_amount_before_private_exchange_markup) - floatval($mark_down_private_exchange); $SellSidePartnerHourlyBids->SpendTotalNet = $adusted_amount; $spend_total_net = $SellSidePartnerHourlyBids->SpendTotalNet; } else { $bids_lost += $RTBPinger->lost_bids; $SellSidePartnerHourlyBids->BidsLostCounter = $RTBPinger->lost_bids; } } else { $bid_errors++; $SellSidePartnerHourlyBids->BidsErrorCounter = 1; $error_list[] = "PartnerID: " . $RTBPinger->partner_id . " Error Message: " . $RTBPinger->ping_error_message; } \util\CachedStatsWrites::incrementSellSideBidsCounterCached($this->config, $SellSidePartnerHourlyBids); } $PublisherHourlyBids = new \model\PublisherHourlyBids(); $PublisherHourlyBids->PublisherAdZoneID = $this->PublisherAdZoneID; $PublisherHourlyBids->AuctionCounter = 1; $PublisherHourlyBids->BidsWonCounter = $bids_won; $PublisherHourlyBids->BidsLostCounter = $bids_lost; $PublisherHourlyBids->BidsErrorCounter = $bid_errors; $PublisherHourlyBids->SpendTotalGross = $spend_total_gross; $PublisherHourlyBids->SpendTotalPrivateExchangeGross = $spend_total_private_exchange_gross; $PublisherHourlyBids->SpendTotalNet = $spend_total_net; if ($AuctionPopo->ImpressionType == "video" && $AuctionPopo->auction_was_won && \util\ParseHelper::isVastURL($AuctionPopo->winning_ad_tag) === true) { /* * If this is a video impression record the winning auction * information when the VASTAdTagURI is loaded from the * publisher's video player. */ $PublisherHourlyBidsCopy = new \model\PublisherHourlyBids(); $PublisherHourlyBidsCopy->PublisherAdZoneID = $this->PublisherAdZoneID; $PublisherHourlyBidsCopy->AuctionCounter = 0; $PublisherHourlyBidsCopy->BidsWonCounter = 1; $PublisherHourlyBidsCopy->BidsLostCounter = 0; $PublisherHourlyBidsCopy->BidsErrorCounter = 0; $PublisherHourlyBidsCopy->SpendTotalGross = $spend_total_gross; $PublisherHourlyBidsCopy->SpendTotalPrivateExchangeGross = $spend_total_private_exchange_gross; $PublisherHourlyBidsCopy->SpendTotalNet = $spend_total_net; $AuctionPopo->vast_publisher_imp_obj = $PublisherHourlyBidsCopy; /* * Record the general impression auction information here now. */ $PublisherHourlyBids->BidsWonCounter = 0; $PublisherHourlyBids->SpendTotalGross = 0; $PublisherHourlyBids->SpendTotalPrivateExchangeGross = 0; $PublisherHourlyBids->SpendTotalNet = 0; } \util\CachedStatsWrites::incrementPublisherBidsCounterCached($this->config, $PublisherHourlyBids); $log_header = "----------------------------------------------------------------\n"; $log_header .= "NEW BID RESPONSE, WEBSITE: " . $this->WebDomain . ", PubZoneID: " . $this->PublisherAdZoneID . ", AD: " . $this->AdName; \rtbsellv22\RtbSellV22Logger::get_instance()->log[] = $log_header; $log_header = "NEW BID RESPONSE, WEBSITE: " . $this->WebDomain . ", PubZoneID: " . $this->PublisherAdZoneID . ", AD: " . $this->AdName; \rtbsellv22\RtbSellV22Logger::get_instance()->min_log[] = $log_header; $log = "----------------------------------------------------------------"; $log .= "\nDate: " . date('m-d-Y H:i:s'); $log .= "\nTotal Bids: " . $bids_total; $log .= "\nBids Won: " . $bids_won; $log .= "\nBids Lost: " . $bids_lost; $log .= "\nBid Errors: " . $bid_errors; $log .= "\nError List: " . implode(",", $error_list); foreach ($this->skipped_partner_list as $skipped_partner) { $log .= "\nSkipped Partner: " . $skipped_partner; } $log .= "\n----------------------------------------------------------------\n"; \rtbsellv22\RtbSellV22Logger::get_instance()->log[] = $log; \rtbsellv22\RtbSellV22Logger::get_instance()->min_log[] = $log; }
public static function execute(&$Logger, \buyrtbsmaato\parsers\openrtb\OpenRTBParser &$Parser, \model\openrtb\RtbBidRequest &$RtbBidRequest, \model\openrtb\RtbBidRequestApp &$RtbBidRequestApp, &$rtb_app) { // ID \util\ParseHelper::parse_item($RtbBidRequestApp, $rtb_app, "id"); // App Name \util\ParseHelper::parse_item($RtbBidRequestApp, $rtb_app, "name"); // App Domain \util\ParseHelper::parse_item($RtbBidRequestApp, $rtb_app, "domain"); // App Categories \util\ParseHelper::parse_item_list($RtbBidRequestApp, $rtb_app, "cat"); self::fix_iab_categories($RtbBidRequestApp, "cat"); // App Subsection Categories \util\ParseHelper::parse_item_list($RtbBidRequestApp, $rtb_app, "sectioncat"); self::fix_iab_categories($RtbBidRequestApp, "sectioncat"); // App Categories for the page/view the ad zone for this impression is fired off from \util\ParseHelper::parse_item_list($RtbBidRequestApp, $rtb_app, "pagecat"); self::fix_iab_categories($RtbBidRequestApp, "pagecat"); // Version of app \util\ParseHelper::parse_item($RtbBidRequestApp, $rtb_app, "ver"); // App Bundle \util\ParseHelper::parse_item($RtbBidRequestApp, $rtb_app, "bundle"); // Flag for Privacy Policy \util\ParseHelper::parse_item($RtbBidRequestApp, $rtb_app, "privacypolicy"); // Is App Paid? \util\ParseHelper::parse_item($RtbBidRequestApp, $rtb_app, "paid"); /* * Publisher Object */ if (isset($rtb_app["publisher"])) { $RtbBidRequestPublisher = new \model\openrtb\RtbBidRequestPublisher(); $default_site_publisher = $rtb_app["publisher"]; // Publisher ID \util\ParseHelper::parse_item($RtbBidRequestPublisher, $default_site_publisher, "id"); // Publisher Name \util\ParseHelper::parse_item($RtbBidRequestPublisher, $default_site_publisher, "name"); // Publisher Categories \util\ParseHelper::parse_item_list($RtbBidRequestPublisher, $default_site_publisher, "cat"); self::fix_iab_categories($RtbBidRequestPublisher, "cat"); // Publisher Domain \util\ParseHelper::parse_item($RtbBidRequestPublisher, $default_site_publisher, "domain"); $RtbBidRequestApp->RtbBidRequestPublisher = $RtbBidRequestPublisher; } /* * Site Content Object */ if (isset($rtb_app["content"])) { $RtbBidRequestContent = new \model\openrtb\RtbBidRequestContent(); $default_site_content = $rtb_app["content"]; // Site Content ID \util\ParseHelper::parse_item($RtbBidRequestContent, $default_site_content, "id"); // Episode Number \util\ParseHelper::parse_item($RtbBidRequestContent, $default_site_content, "episode"); // Title \util\ParseHelper::parse_item($RtbBidRequestContent, $default_site_content, "title"); // Content Series \util\ParseHelper::parse_item($RtbBidRequestContent, $default_site_content, "series"); // Content Season \util\ParseHelper::parse_item($RtbBidRequestContent, $default_site_content, "season"); // Content Original URL \util\ParseHelper::parse_item($RtbBidRequestContent, $default_site_content, "url"); // Content Categories \util\ParseHelper::parse_item_list($RtbBidRequestContent, $default_site_content, "cat"); self::fix_iab_categories($RtbBidRequestContent, "cat"); // Content Video Quality \util\ParseHelper::parse_item($RtbBidRequestContent, $default_site_content, "videoquality"); // Content Video Quality \util\ParseHelper::parse_item($RtbBidRequestContent, $default_site_content, "videoquality"); // Content Keywords Meta /* * Apparently Neal and Jim not sure on this one, * saying it could be a string or an array of strings */ if (isset($default_site_content["keywords"])) { if (is_array($default_site_content["keywords"])) { \util\ParseHelper::parse_item_list($RtbBidRequestContent, $default_site_content, "keywords"); } else { \util\ParseHelper::parse_item($RtbBidRequestContent, $default_site_content, "keywords"); } } // Content Rating \util\ParseHelper::parse_item($RtbBidRequestContent, $default_site_content, "contentrating"); // User Rating \util\ParseHelper::parse_item($RtbBidRequestContent, $default_site_content, "userrating"); // Context of Content \util\ParseHelper::parse_item($RtbBidRequestContent, $default_site_content, "context"); // Flag Indicating if Content is Live \util\ParseHelper::parse_item($RtbBidRequestContent, $default_site_content, "livestream"); // Flag Indicating if Content Source is Direct or Indirect \util\ParseHelper::parse_item($RtbBidRequestContent, $default_site_content, "sourcerelationship"); /* * Site Content Video Producer Object */ if (isset($default_site_content["producer"])) { $RtbBidRequestProducer = new \model\openrtb\RtbBidRequestProducer(); $default_site_content_producer = $default_site_content["producer"]; // Video Producer ID \util\ParseHelper::parse_item($RtbBidRequestProducer, $default_site_content_producer, "id"); // Video Producer Name \util\ParseHelper::parse_item($RtbBidRequestProducer, $default_site_content_producer, "name"); // Video Producer Categories \util\ParseHelper::parse_item_list($RtbBidRequestProducer, $default_site_content_producer, "cat"); self::fix_iab_categories($RtbBidRequestProducer, "cat"); // Video Producer Domain \util\ParseHelper::parse_item($RtbBidRequestProducer, $default_site_content_producer, "domain"); $RtbBidRequestContent->RtbBidRequestProducer = $RtbBidRequestProducer; } // Length of Content \util\ParseHelper::parse_item($RtbBidRequestContent, $default_site_content, "len"); // QAG Media Rating of Content \util\ParseHelper::parse_item($RtbBidRequestContent, $default_site_content, "qagmediarating"); // QAG Video Addendum Embeddable Flag \util\ParseHelper::parse_item($RtbBidRequestContent, $default_site_content, "embeddable"); // Content Language \util\ParseHelper::parse_item($RtbBidRequestContent, $default_site_content, "language"); $RtbBidRequestApp->RtbBidRequestContent = $RtbBidRequestContent; } // Website Keywords Meta /* * Apparently Neal and Jim not sure on this one, * saying it could be a string or an array of strings */ if (isset($rtb_app["keywords"])) { if (is_array($rtb_app["keywords"])) { \util\ParseHelper::parse_item_list($RtbBidRequestApp, $rtb_app, "keywords"); } else { \util\ParseHelper::parse_item($RtbBidRequestApp, $rtb_app, "keywords"); } } // The URL for the App Store for this App \util\ParseHelper::parse_item($RtbBidRequestApp, $rtb_app, "storeurl"); }
public static function execute(&$Logger, \buyrtb\parsers\openrtb\OpenRTBParser &$Parser, \model\openrtb\RtbBidRequest &$RtbBidRequest, \model\openrtb\RtbBidRequestSite &$RtbBidRequestSite, &$ad_campaign_site) { // ID \util\ParseHelper::parse_item($RtbBidRequestSite, $ad_campaign_site, "id"); // Site Name \util\ParseHelper::parse_item($RtbBidRequestSite, $ad_campaign_site, "name"); // Site Domain \util\ParseHelper::parse_item($RtbBidRequestSite, $ad_campaign_site, "domain"); // Site Categories \util\ParseHelper::parse_item_list($RtbBidRequestSite, $ad_campaign_site, "cat"); self::fix_iab_categories($RtbBidRequestSite, "cat"); // Site Subsection Categories \util\ParseHelper::parse_item_list($RtbBidRequestSite, $ad_campaign_site, "sectioncat"); self::fix_iab_categories($RtbBidRequestSite, "sectioncat"); // Site Page Categories for the page the ad zone for this impression is fired off from \util\ParseHelper::parse_item_list($RtbBidRequestSite, $ad_campaign_site, "pagecat"); self::fix_iab_categories($RtbBidRequestSite, "pagecat"); // URL of the Page the ad zone for this impression is fired off from \util\ParseHelper::parse_item($RtbBidRequestSite, $ad_campaign_site, "page"); // Flag for Privacy Policy \util\ParseHelper::parse_item($RtbBidRequestSite, $ad_campaign_site, "privacypolicy"); // Referrer URL which caused navigation to the page the impression is displayed on \util\ParseHelper::parse_item($RtbBidRequestSite, $ad_campaign_site, "ref"); // SEO URL which caused the user to land on the page the impression is displayed on \util\ParseHelper::parse_item($RtbBidRequestSite, $ad_campaign_site, "search"); /* * Publisher Object */ if (isset($ad_campaign_site["publisher"])) { $RtbBidRequestPublisher = new \model\openrtb\RtbBidRequestPublisher(); $default_site_publisher = $ad_campaign_site["publisher"]; // Publisher ID \util\ParseHelper::parse_item($RtbBidRequestPublisher, $default_site_publisher, "id"); // Publisher Name \util\ParseHelper::parse_item($RtbBidRequestPublisher, $default_site_publisher, "name"); // Publisher Categories \util\ParseHelper::parse_item_list($RtbBidRequestPublisher, $default_site_publisher, "cat"); self::fix_iab_categories($RtbBidRequestPublisher, "cat"); // Publisher Domain \util\ParseHelper::parse_item($RtbBidRequestPublisher, $default_site_publisher, "domain"); $RtbBidRequestSite->RtbBidRequestPublisher = $RtbBidRequestPublisher; } /* * Site Content Object */ if (isset($ad_campaign_site["content"])) { $RtbBidRequestContent = new \model\openrtb\RtbBidRequestContent(); $default_site_content = $ad_campaign_site["content"]; // Site Content ID \util\ParseHelper::parse_item($RtbBidRequestContent, $default_site_content, "id"); // Episode Number \util\ParseHelper::parse_item($RtbBidRequestContent, $default_site_content, "episode"); // Title \util\ParseHelper::parse_item($RtbBidRequestContent, $default_site_content, "title"); // Content Series \util\ParseHelper::parse_item($RtbBidRequestContent, $default_site_content, "series"); // Content Season \util\ParseHelper::parse_item($RtbBidRequestContent, $default_site_content, "season"); // Content Original URL \util\ParseHelper::parse_item($RtbBidRequestContent, $default_site_content, "url"); // Content Categories \util\ParseHelper::parse_item_list($RtbBidRequestContent, $default_site_content, "cat"); self::fix_iab_categories($RtbBidRequestContent, "cat"); // Content Video Quality \util\ParseHelper::parse_item($RtbBidRequestContent, $default_site_content, "videoquality"); // Content Video Quality \util\ParseHelper::parse_item($RtbBidRequestContent, $default_site_content, "videoquality"); // Content Keywords Meta /* * Apparently Neal and Jim not sure on this one, * saying it could be a string or an array of strings */ if (isset($default_site_content["keywords"])) { if (is_array($default_site_content["keywords"])) { \util\ParseHelper::parse_item_list($RtbBidRequestContent, $default_site_content, "keywords"); } else { \util\ParseHelper::parse_item($RtbBidRequestContent, $default_site_content, "keywords"); } } // Content Rating \util\ParseHelper::parse_item($RtbBidRequestContent, $default_site_content, "contentrating"); // User Rating \util\ParseHelper::parse_item($RtbBidRequestContent, $default_site_content, "userrating"); // Context of Content \util\ParseHelper::parse_item($RtbBidRequestContent, $default_site_content, "context"); // Flag Indicating if Content is Live \util\ParseHelper::parse_item($RtbBidRequestContent, $default_site_content, "livestream"); // Flag Indicating if Content Source is Direct or Indirect \util\ParseHelper::parse_item($RtbBidRequestContent, $default_site_content, "sourcerelationship"); /* * Site Content Video Producer Object */ if (isset($default_site_content["producer"])) { $RtbBidRequestProducer = new \model\openrtb\RtbBidRequestProducer(); $default_site_content_producer = $default_site_content["producer"]; // Video Producer ID \util\ParseHelper::parse_item($RtbBidRequestProducer, $default_site_content_producer, "id"); // Video Producer Name \util\ParseHelper::parse_item($RtbBidRequestProducer, $default_site_content_producer, "name"); // Video Producer Categories \util\ParseHelper::parse_item_list($RtbBidRequestProducer, $default_site_content_producer, "cat"); self::fix_iab_categories($RtbBidRequestProducer, "cat"); // Video Producer Domain \util\ParseHelper::parse_item($RtbBidRequestProducer, $default_site_content_producer, "domain"); $RtbBidRequestContent->RtbBidRequestProducer = $RtbBidRequestProducer; } // Length of Content \util\ParseHelper::parse_item($RtbBidRequestContent, $default_site_content, "len"); // QAG Media Rating of Content \util\ParseHelper::parse_item($RtbBidRequestContent, $default_site_content, "qagmediarating"); // QAG Video Addendum Embeddable Flag \util\ParseHelper::parse_item($RtbBidRequestContent, $default_site_content, "embeddable"); // Content Language \util\ParseHelper::parse_item($RtbBidRequestContent, $default_site_content, "language"); $RtbBidRequestSite->RtbBidRequestContent = $RtbBidRequestContent; } // Website Keywords Meta /* * Apparently Neal and Jim not sure on this one, * saying it could be a string or an array of strings */ if (isset($ad_campaign_site["keywords"])) { if (is_array($ad_campaign_site["keywords"])) { \util\ParseHelper::parse_item_list($RtbBidRequestSite, $ad_campaign_site, "keywords"); } else { \util\ParseHelper::parse_item($RtbBidRequestSite, $ad_campaign_site, "keywords"); } } }