Algoritma bidding kustom dibuat dari logika bidding yang ditentukan oleh pengguna. Tetapkan ke item baris melalui strategi biddingnya. Saat mengajukan bid pada inventaris iklan, item baris akan menggunakan logika kustom tersebut.
Pertama, pilih jenis algoritma dan buat resource algoritma.
Memilih jenis Algoritma Bidding Kustom
Jenis algoritma menentukan cara logika bidding ditentukan dalam algoritma.
Pilih salah satu jenis berikut yang dapat dibuat melalui Display & Video 360 API:
SCRIPT_BASED: Logika yang ditetapkan oleh skrip yang diupload. Skrip adalah file teks yang menggunakan sintaksis Python dasar.RULE_BASED: Logika yang ditetapkan oleh ruleset yang diupload. Rangkaian aturan adalah file JSONAlgorithmRulesyang diupload.
Buat resource CustomBiddingAlgorithm
Gunakan permintaan create untuk membuat algoritma bidding kustom.
Pengiklan atau partner dapat menjadi owner algoritma. Jika dimiliki oleh pengiklan, aset hanya dapat digunakan oleh kampanye iklan di bawah pengiklan tersebut. Jika dimiliki oleh partner, item tersebut hanya dapat digunakan oleh pengiklan yang
secara sengaja dibagikan kepadanya.
Berikut cara membuat algoritma bidding kustom:
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']);