कस्टम बिडिंग एल्गोरिदम, उपयोगकर्ता के तय किए गए बिडिंग लॉजिक के आधार पर बनाया जाता है. बिडिंग की रणनीति के ज़रिए, इसे लाइन आइटम को असाइन करें. विज्ञापन इन्वेंट्री पर बिडिंग करते समय, लाइन आइटम उस कस्टम लॉजिक का इस्तेमाल करेगा.
सबसे पहले, एल्गोरिदम का टाइप चुनें और एल्गोरिदम रिसोर्स बनाएं.
कस्टम बिडिंग के एल्गोरिदम का टाइप चुनना
एल्गोरिदम टाइप से यह तय होता है कि एल्गोरिदम में बिडिंग लॉजिक कैसे तय किया जाता है.
Display & Video 360 API की मदद से बनाए जा सकने वाले, यहां दिए गए टाइप में से कोई एक चुनें:
SCRIPT_BASED: अपलोड की गई स्क्रिप्ट से सेट किया गया लॉजिक. स्क्रिप्ट एक टेक्स्ट फ़ाइल होती है, जिसमें Python के बुनियादी सिंटैक्स का इस्तेमाल किया जाता है.RULE_BASED: अपलोड किए गए ruleset से सेट किया गया लॉजिक. नियमों का सेट, अपलोड की गईAlgorithmRulesJSON फ़ाइल है.
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']);