एल्गोरिदम असाइन करना

एल्गोरिदम तैयार होने के बाद, उसे किसी संसाधन को असाइन करें.

देखें कि एल्गोरिदम तैयार है या नहीं

एल्गोरिदम मॉडल को तैयार होने से पहले, कम से कम डेटा पर ट्रेन करना ज़रूरी है.

एल्गोरिदम, विज्ञापन देने वाले हर व्यक्ति या कंपनी के लिए एक मॉडल को ट्रेन करते हैं, ताकि वे इसका इस्तेमाल कर सकें. मॉडल को मौजूदा इंप्रेशन डेटा के आधार पर ट्रेन किया जाता है. विज्ञापन देने वाले व्यक्ति या कंपनी की ओर से डेटा से जुड़ी ज़रूरी शर्तें पूरी करने के बाद, मॉडल को ट्रेनिंग देने में एक से तीन दिन लग सकते हैं.

एल्गोरिदम से, हर मॉडल के तैयार होने की स्थिति को वापस पाएं. 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']
);