मैन्युअल तरीके से बोली लगाने के लिए एल्गोरिदम बनाएं

एक कस्टम बिडिंग एल्गोरिदम, उपयोगकर्ता की तय की गई बिडिंग लॉजिक के आधार पर बनाया जाता है. इसे बिड की रणनीति के ज़रिए, किसी लाइन आइटम को असाइन करें. इसके बाद, लाइन आइटम विज्ञापन इन्वेंट्री पर बिडिंग करते समय, कस्टम लॉजिक का इस्तेमाल करेगा.

सबसे पहले, कोई एल्गोरिदम टाइप चुनें और एल्गोरिदम संसाधन बनाएं.

कस्टम बिडिंग वाले एल्गोरिदम का कोई टाइप चुनना

एल्गोरिदम का टाइप तय करता है कि एल्गोरिदम में बिडिंग लॉजिक कैसे तय किया जाता है.

Display &Video 360 API की मदद से, इनमें से कोई एक टाइप चुनें:

  • SCRIPT_BASED: अपलोड की गई स्क्रिप्ट से सेट किया गया लॉजिक. स्क्रिप्ट एक टेक्स्ट फ़ाइल होती है, जिसमें Python का बुनियादी सिंटैक्स इस्तेमाल किया जाता है.
  • RULE_BASED: अपलोड किए गए नियम सेट से सेट किया गया लॉजिक. नियम सेट, अपलोड की गई AlgorithmRules JSON फ़ाइल होती है.

CustomBiddingAlgorithm संसाधन बनाना

कस्टम बिडिंग वाला एल्गोरिदम बनाने के लिए, create अनुरोध का इस्तेमाल करें.

कोई विज्ञापन देने वाला व्यक्ति या कंपनी या पार्टनर, किसी एल्गोरिदम का owner हो सकता है. अगर एल्गोरिदम का मालिकाना हक किसी विज्ञापन देने वाले व्यक्ति या कंपनी के पास है, तो इसका इस्तेमाल सिर्फ़ उस विज्ञापन देने वाले व्यक्ति या कंपनी के विज्ञापन कैंपेन में किया जा सकता है. अगर एल्गोरिदम का मालिकाना हक किसी पार्टनर के पास है, तो इसका इस्तेमाल सिर्फ़ उन विज्ञापन देने वाले लोगों या कंपनियों के लिए किया जा सकता है जिनके साथ इसे जान-बूझकर शेयर किया गया है.

कस्टम बिडिंग वाला एल्गोरिदम बनाने का तरीका यहां बताया गया है:

Java

// 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());

Python

# 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"]}.'
)

PHP

// 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']);