알고리즘이 준비되면 리소스에 할당합니다.
알고리즘이 준비되었는지 확인
알고리즘 모델은 준비되기 전에 최소한의 데이터양으로 학습해야 합니다.
알고리즘은 이를 사용할 수 있는 각 광고주에 대해 모델을 학습시킵니다. 모델은 기존 노출 데이터를 기반으로 학습합니다. 광고주가 데이터 요구사항을 충족한 후 모델을 학습하는 데 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입니다.
전체 예산을 지출하도록 최적화하는 입찰 전략을 사용하여 알고리즘을 사용하도록 광고 항목을 업데이트하는 방법은 다음과 같습니다.
자바
// 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'] );