یک الگوریتم پیشنهاد قیمت سفارشی از منطق پیشنهاد قیمت تعریف شده توسط کاربر ساخته شده است. آن را از طریق استراتژی پیشنهاد قیمت آنها به یک ردیف آیتم اختصاص دهید. هنگام پیشنهاد قیمت برای موجودی تبلیغات، ردیف آیتم از آن منطق سفارشی استفاده خواهد کرد.
ابتدا، یک نوع الگوریتم انتخاب کنید و منبع الگوریتم را ایجاد کنید.
یک نوع الگوریتم مناقصه سفارشی انتخاب کنید
نوع الگوریتم، نحوه تعریف منطق پیشنهاد قیمت در الگوریتم را تعیین میکند.
یکی از انواع زیر را که میتوان از طریق Display & Video 360 API ایجاد کرد، انتخاب کنید:
-
SCRIPT_BASED: منطقی که توسط یک اسکریپت آپلود شده تنظیم شده است. این اسکریپت یک فایل متنی است که از سینتکس پایه پایتون استفاده میکند. -
RULE_BASED: منطقی که توسط یک مجموعه قوانین آپلود شده تنظیم شده است. این مجموعه قوانین یک فایل JSONAlgorithmRulesاست که آپلود شده است.
ایجاد منبع CustomBiddingAlgorithm
از یک درخواست create برای ایجاد یک الگوریتم مناقصه سفارشی استفاده کنید.
یک تبلیغکننده یا شریک میتواند owner یک الگوریتم باشد. اگر متعلق به یک تبلیغکننده باشد، فقط میتواند توسط کمپینهای تبلیغاتی تحت آن تبلیغکننده استفاده شود. اگر متعلق به یک شریک باشد، فقط میتواند توسط تبلیغکنندگانی که عمداً با آنها به اشتراک گذاشته شده است، استفاده شود.
در اینجا نحوه ایجاد یک الگوریتم مناقصه سفارشی آورده شده است:
جاوا
// Provide the ID of the advertiser that will own the algorithm. long advertiserId = advertiser-id; // Provide the display name of the algorithm. String displayName = display-name; // Provide the type of custom bidding algorithm. String customBiddingAlgorithmType = custom-bidding-algorithm-type; // Create the custom bidding algorithm structure. CustomBiddingAlgorithm algorithm = new CustomBiddingAlgorithm() .setAdvertiserId(advertiserId) .setDisplayName(displayName) .setEntityStatus("ENTITY_STATUS_ACTIVE") .setCustomBiddingAlgorithmType(customBiddingAlgorithmType); // Create the algorithm. CustomBiddingAlgorithm response = service.customBiddingAlgorithms().create(algorithm).execute(); // Display the new custom bidding algorithm ID. System.out.printf( "Custom Bidding Algorithm was created with the ID %s.", response.getCustomBiddingAlgorithmId());
پایتون
# Provide the ID of the advertiser that will own the algorithm. advertiser_id = advertiser-id # Provide the display name of the algorithm. display_name = display-name # Provide the type of custom bidding algorithm. custom_bidding_algo_type = custom-bidding-algorithm-type # Build CustomBiddingAlgorithm object. custom_bidding_algorithm_obj = { "advertiserId": advertiser_id, "displayName": display_name, "entityStatus": "ENTITY_STATUS_ACTIVE", "customBiddingAlgorithmType": custom_bidding_algo_type, } # Build and execute request. algorithm_response = ( service.customBiddingAlgorithms() .create(body=custom_bidding_algorithm_obj) .execute() ) # Print ID of new custom bidding algorithm. print( "Custom bidding algorithm was created with ID " f'{algorithm_response["customBiddingAlgorithmId"]}.' )
پی اچ پی
// Provide the ID of the advertiser that will own the algorithm. $advertiserId = advertiser-id; // Provide the display name of the algorithm. $displayName = display-name; // Provide the type of custom bidding algorithm. $customBiddingAlgorithmType = custom-bidding-algorithm-type; // Create the custom bidding algorithm structure. $algorithm = new Google_Service_DisplayVideo_CustomBiddingAlgorithm(); $algorithm->setAdvertiserId($advertiserId); $algorithm->setDisplayName($displayName); $algorithm->setEntityStatus('ENTITY_STATUS_ACTIVE'); $algorithm->setCustomBiddingAlgorithmType($customBiddingAlgorithmType); // Call the API, creating the advertiser. try { $result = $this->service->customBiddingAlgorithms->create($algorithm); } catch (\Exception $e) { $this->renderError($e); return; } // Print ID of new custom bidding algorithm. printf('<p>Custom Bidding Algorithm was created with the ID %s.</p>', $result['customBiddingAlgorithmId']);