กำหนดอัลกอริทึมให้กับทรัพยากรเมื่อพร้อมใช้งาน
ตรวจสอบว่าอัลกอริทึมพร้อมใช้งานหรือไม่
โมเดลอัลกอริทึมต้องได้รับการฝึกฝนด้วยข้อมูลจำนวนหนึ่งขั้นต่ำ ก่อนจึงจะพร้อมใช้งาน
อัลกอริทึมจะฝึกโมเดลสำหรับผู้ลงโฆษณาแต่ละรายที่สามารถใช้โมเดลได้ โมเดลจะได้รับการฝึกฝนด้วยข้อมูลการแสดงผลที่มีอยู่ การฝึกโมเดลอาจใช้เวลา 1-3 วันหลังจากที่ ข้อกำหนดด้านข้อมูลเป็นไปตามที่ผู้ลงโฆษณาต้องการ
ดึงข้อมูลสถานะความพร้อมใช้งานของแต่ละ โมเดล จากอัลกอริทึม
ReadinessState จะกำหนดขั้นตอนถัดไป
ReadinessState | |
|---|---|
READINESS_STATE_NO_VALID_SCRIPT |
ไม่มีสคริปต์ที่ถูกต้อง อัปโหลด สคริปต์ หรือ ไฟล์กฎใหม่ |
READINESS_STATE_EVALUATION_FAILURE |
ไม่มีสคริปต์ที่ประเมินได้ภายในเวลาที่กำหนด อัปโหลด สคริปต์ หรือ ไฟล์กฎใหม่ |
READINESS_STATE_INSUFFICIENT_DATA |
มีข้อมูลไม่เพียงพอภายใต้ผู้ลงโฆษณาที่จะใช้ฝึกโมเดล เรียกใช้แคมเปญต่อไปภายใต้ผู้ลงโฆษณาเพื่อให้เป็นไปตามข้อกำหนดด้านข้อมูลขั้นต่ำ |
READINESS_STATE_TRAINING |
โมเดลกำลังได้รับการฝึกฝนด้วยข้อมูลที่มีอยู่และยังไม่พร้อมให้บริการ รอ 12-24 ชั่วโมงก่อนตรวจสอบว่าโมเดลพร้อมให้บริการหรือไม่ |
READINESS_STATE_ACTIVE |
โมเดลได้รับการฝึกฝนอย่างสมบูรณ์และพร้อมที่จะกำหนดให้กับแคมเปญภายใต้ผู้ลงโฆษณา |
กำหนดอัลกอริทึมให้กับรายการโฆษณา
อัลกอริทึมใช้เพื่อวัดและปรับประสิทธิภาพการเสนอราคา โดยสามารถใช้กับ
กลยุทธ์การเสนอราคาที่เพิ่มประสิทธิภาพเพื่อใช้จ่ายงบประมาณทั้งหมด
หรือบรรลุเป้าหมาย ในกรณีเหล่านี้ ประเภทเป้าหมายด้านประสิทธิภาพของกลยุทธ์จะเป็น
BIDDING_STRATEGY_PERFORMANCE_GOAL_TYPE_CUSTOM_ALGO
วิธีอัปเดตรายการโฆษณาให้ใช้อัลกอริทึมกับกลยุทธ์การเสนอราคาที่เพิ่มประสิทธิภาพเพื่อใช้จ่ายงบประมาณทั้งหมด
Java
// Provide the ID of the advertiser that owns the parent algorithm. long advertiserId = advertiser-id; // Provide the ID of the parent algorithm. long algorithmId = algorithm-id; // Provide the ID of the line item to assign the algorithm to. long lineItemId = line-item-id; // Create the line item structure. LineItem lineItem = new LineItem() .setBidStrategy( new BiddingStrategy() .setMaximizeSpendAutoBid( new MaximizeSpendBidStrategy() .setPerformanceGoalType( "BIDDING_STRATEGY_PERFORMANCE_GOAL_TYPE_CUSTOM_ALGO") .setCustomBiddingAlgorithmId(algorithmId))); // Configure the patch request and set update mask to only update the bid // strategy. LineItems.Patch request = service .advertisers() .lineItems() .patch(advertiserId, lineItemId, lineItem) .setUpdateMask("bidStrategy"); // Update the line item. LineItem response = request.execute(); // Display the new algorithm ID used by the line item. System.out.printf( "Line item %s now uses algorithm ID %s in its bidding strategy.", response.getName(), response.getBidStrategy().getMaximizeSpendAutoBid().getCustomBiddingAlgorithmId());
Python
# Provide the parent advertiser ID of the line item and creative. advertiser_id = advertiser-id # Provide the ID of the creative to assign. algorithm_id = algorithm-id # Provide the ID of the line item to assign the creative to. line_item_id = line-item-id # Build bidding strategy object. bidding_strategy_obj = { "maximizeSpendAutoBid": { "performanceGoalType": ( "BIDDING_STRATEGY_PERFORMANCE_GOAL_TYPE_CUSTOM_ALGO" ), "customBiddingAlgorithmId": algorithm_id, } } # Build line item object. line_item_obj = {"bidStrategy": bidding_strategy_obj} # Build and execute request. line_item_resp = ( service.advertisers() .lineItems() .patch( advertiserId=advertiser_id, lineItemId=line_item_id, updateMask="bidStrategy", body=line_item_obj, ) .execute() ) # Print the algorithm ID now assigned to the line item. print( f'Line Item {line_item_resp["name"]} now uses algorithm ID' f' {line_item_resp["bidStrategy"]["maximizeSpendAutoBid"]["customBiddingAlgorithmId"]}' " in its bidding strategy." )
PHP
// Provide the ID of the advertiser that owns the parent algorithm. $advertiserId = advertiser-id; // Provide the ID of the parent algorithm. $algorithmId = algorithm-id; // Provide the ID of the line item to assign the algorithm to. $lineItemId = line-item-id; // Create the bidding strategy structure. $maxSpendBidStrategy = new Google_ServiceDisplayVideo_MaximizeSpendBidStrategy(); $maxSpendBidStrategy->setPerformanceGoalType('BIDDING_STRATEGY_PERFORMANCE_GOAL_TYPE_CUSTOM_ALGO'); $maxSpendBidStrategy->setCustomBiddingAlgorithmId($algorithmId); $biddingStrategy = new Google_ServiceDisplayVideo_BiddingStrategy(); $biddingStrategy->setMaximizeSpendAutoBid($maxSpendBidStrategy); // Create the line item structure. $lineItem = new Google_Service_DisplayVideo_LineItem(); $lineItem->setBidStrategy($biddingStrategy); $optParams = array('updateMask' => 'bidStrategy'); // Call the API, updating the bid strategy for the identified line // item. try { $result = $this->service->advertisers_lineItems->patch( $advertiserId, $lineItemId, $lineItem, $optParams ); } catch (\Exception $e) { $this->renderError($e); return; } printf( '<p>Line Item %s now uses algorithm ID %s in its bid strategy.</p>', $result['name'], $result['bidStrategy']['maximizeSpendAutoBid']['customBiddingAlgorithmId'] );