অ্যালগরিদম নির্ধারণ করুন

অ্যালগরিদমটি প্রস্তুত হয়ে গেলে সেটিকে একটি রিসোর্সে বরাদ্দ করুন।

Check if the algorithm is ready

একটি অ্যালগরিদম মডেল প্রস্তুত হওয়ার আগে অবশ্যই ন্যূনতম পরিমাণ ডেটার উপর প্রশিক্ষিত হতে হবে।

অ্যালগরিদমগুলো প্রতিটি বিজ্ঞাপনদাতার জন্য একটি করে মডেলকে প্রশিক্ষণ দেয়, যারা এগুলো ব্যবহার করতে পারে। মডেলগুলো বিদ্যমান ইম্প্রেশন ডেটার উপর ভিত্তি করে প্রশিক্ষিত হয়। বিজ্ঞাপনদাতার পক্ষ থেকে ডেটার প্রয়োজনীয়তা পূরণ হওয়ার পর একটি মডেলকে প্রশিক্ষণ দিতে ১-৩ দিন সময় লাগতে পারে।

অ্যালগরিদম থেকে প্রতিটি মডেলের প্রস্তুতি অবস্থা সংগ্রহ করুন। ReadinessState পরবর্তী পদক্ষেপগুলো নির্ধারণ করে:

ReadinessState
READINESS_STATE_NO_VALID_SCRIPT কোনো বৈধ স্ক্রিপ্ট নেই। একটি নতুন স্ক্রিপ্ট বা রুলস ফাইল আপলোড করুন।
READINESS_STATE_EVALUATION_FAILURE নির্ধারিত সময়ের মধ্যে মূল্যায়ন করার মতো কোনো স্ক্রিপ্ট নেই। একটি নতুন স্ক্রিপ্ট বা রুলস ফাইল আপলোড করুন।
READINESS_STATE_INSUFFICIENT_DATA মডেলটিকে প্রশিক্ষণ দেওয়ার জন্য বিজ্ঞাপনদাতার অধীনে পর্যাপ্ত পরিমাণ ডেটা উপলব্ধ নেই। ন্যূনতম ডেটার প্রয়োজনীয়তা পূরণ করতে বিজ্ঞাপনদাতার অধীনে ক্যাম্পেইনগুলো চালানো চালিয়ে যান।
READINESS_STATE_TRAINING মডেলটি বিদ্যমান ডেটার উপর প্রশিক্ষণ নিচ্ছে এবং পরিবেশনের জন্য প্রস্তুত নয়। মডেলটি পরিবেশনের জন্য প্রস্তুত হয়েছে কিনা তা পরীক্ষা করার আগে ১২-২৪ ঘণ্টা অপেক্ষা করুন।
READINESS_STATE_ACTIVE মডেলটি সম্পূর্ণরূপে প্রশিক্ষিত এবং বিজ্ঞাপনদাতার প্রচারণায় নিযুক্ত হওয়ার জন্য প্রস্তুত।

Assign algorithm to line item

An algorithm is used to measure and adjust bidding performance. It can be used with bid strategies that optimize towards spending the whole budget or meeting a goal . In these cases, the strategy performance goal type would be 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());

পাইথন

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

পিএইচপি

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