बिडिंग की रणनीति असाइन या अपडेट करना

होटल विज्ञापनों के मामले में, अलग-अलग कैंपेन के लिए बिडिंग की रणनीति असाइन की जा सकती है.

होटल विज्ञापनों के लिए बिडिंग की रणनीतियां चुनने के बारे में जानकारी, होटल विज्ञापनों के लिए बिडिंग से जुड़ी खास जानकारी में देखी जा सकती है. बिडिंग की रणनीतियों को जानने के बाद, Google Ads API का इस्तेमाल करके होटल कैंपेन की बिडिंग की रणनीतियों को असाइन और अपडेट किया जा सकता है.

बिडिंग की रणनीति असाइन करना

नए होटल कैंपेन बनाने के लिए रणनीति तय करने के लिए, यह तरीका अपनाएं:

  1. कोई campaign_bidding_strategy चुनें. होटल विज्ञापनों के लिए, नीचे दी गई रणनीतियों का इस्तेमाल किया जा सकता है:

    • commission (हर कन्वर्ज़न या हर बार ठहरने पर)
    • percent_cpc (बेहतर सीपीसी के साथ काम करता है)
    • manual_cpc (बेहतर सीपीसी के साथ काम करता है)
  2. फ़ील्ड के नाम और वैल्यू का वह जोड़ा तय करें जिसका इस्तेमाल आपको चुनी गई रणनीति के लिए करना है. उदाहरण के लिए, percent_cpc रणनीति के लिए, enhanced_cpc_enabled को true पर सेट किया जा सकता है.

  3. नया कैंपेन बनाते समय रणनीति सेट करें. उदाहरण के लिए, Java में, Campaign इंस्टेंस के बिल्डर से, campaign_bidding_strategy फ़ील्ड के लिए सेटर मेथड को कॉल करें (तरीका का नाम कन्वेंशन setcampaign_bidding_strategy है).

    commission कार्यनीति के लिए, नया कैंपेन बनाते समय PaymentMode को सेट करने वाला एक अतिरिक्त स्टेटमेंट जोड़ना न भूलें.

इस उदाहरण में नया कैंपेन बनाते समय, percent_cpc बिडिंग की रणनीति सेट करने का तरीका बताया गया है:

Java

// Creates the campaign.
Campaign campaign =
    Campaign.newBuilder()
        .setName("Interplanetary Cruise #" + getPrintableDateTime())
        // Configures settings related to hotel campaigns including advertising channel type
        // and hotel setting info.
        .setAdvertisingChannelType(AdvertisingChannelType.HOTEL)
        .setHotelSetting(hotelSettingInfo)
        // Recommendation: Sets the campaign to PAUSED when creating it to prevent
        // the ads from immediately serving. Set to ENABLED once you've added
        // targeting and the ads are ready to serve
        .setStatus(CampaignStatus.PAUSED)
        // Sets the bidding strategy to Percent CPC. Only Manual CPC and Percent CPC can be used
        // for hotel campaigns.
        .setPercentCpc(
            PercentCpc.newBuilder().setCpcBidCeilingMicros(cpcBidCeilingMicroAmount).build())
        // Sets the budget.
        .setCampaignBudget(budgetResourceName)
        // Adds the networkSettings configured above.
        .setNetworkSettings(networkSettings)
        .build();
      

C#

// Create a campaign.
Campaign campaign = new Campaign()
{
    Name = "Interplanetary Cruise Campaign #" + ExampleUtilities.GetRandomString(),

    // Configure settings related to hotel campaigns including advertising channel type
    // and hotel setting info.
    AdvertisingChannelType = AdvertisingChannelType.Hotel,
    HotelSetting = new HotelSettingInfo()
    {
        HotelCenterId = hotelCenterAccountId
    },

    // Recommendation: Set the campaign to PAUSED when creating it to prevent
    // the ads from immediately serving. Set to ENABLED once you've added
    // targeting and the ads are ready to serve.
    Status = CampaignStatus.Paused,

    // Sets the bidding strategy to PercentCpc. Only Manual CPC and Percent CPC can
    // be used for hotel campaigns.
    PercentCpc = new PercentCpc()
    {
        CpcBidCeilingMicros = cpcBidCeilingMicroAmount
    },

    // Set the budget.
    CampaignBudget = budgetResourceName,

    // Configure the campaign network options. Only Google Search is allowed for
    // hotel campaigns.
    NetworkSettings = new NetworkSettings()
    {
        TargetGoogleSearch = true
    }
};
      

PHP

// Creates a campaign.
$campaign = new Campaign([
    'name' => 'Interplanetary Cruise Campaign #' . Helper::getPrintableDatetime(),
    // Configures settings related to hotel campaigns including advertising channel type
    // and hotel setting info.
    'advertising_channel_type' => AdvertisingChannelType::HOTEL,
    'hotel_setting' => new HotelSettingInfo(['hotel_center_id' => $hotelCenterAccountId]),
    // Recommendation: Set the campaign to PAUSED when creating it to prevent
    // the ads from immediately serving. Set to ENABLED once you've added
    // targeting and the ads are ready to serve.
    'status' => CampaignStatus::PAUSED,
    // Sets the bidding strategy to PercentCpc. Only Manual CPC and Percent CPC can be used
    // for hotel campaigns.
    'percent_cpc' => new PercentCpc([
        'cpc_bid_ceiling_micros' => $cpcBidCeilingMicroAmount
    ]),
    // Sets the budget.
    'campaign_budget' => $budgetResourceName,
    // Configures the campaign network options. Only Google Search is allowed for
    // hotel campaigns.
    'network_settings' => new NetworkSettings([
        'target_google_search' => true,
    ]),
]);
      

Python

# Create campaign.
campaign_operation = client.get_type("CampaignOperation")
campaign = campaign_operation.create
campaign.name = f"Interplanetary Cruise Campaign {uuid.uuid4()}"

# Configures settings related to hotel campaigns including advertising
# channel type and hotel setting info.
campaign.advertising_channel_type = (
    client.enums.AdvertisingChannelTypeEnum.HOTEL
)
campaign.hotel_setting.hotel_center_id = hotel_center_account_id

# Recommendation: Set the campaign to PAUSED when creating it to prevent the
# ads from immediately serving. Set to ENABLED once you've added targeting
# and the ads are ready to serve.
campaign.status = client.enums.CampaignStatusEnum.PAUSED

# Set the bidding strategy to PercentCpc. Only Manual CPC and Percent CPC
# can be used for hotel campaigns.
campaign.percent_cpc.cpc_bid_ceiling_micros = cpc_bid_ceiling_micro_amount

# Sets the budget.
campaign.campaign_budget = budget_resource_name

# Set the campaign network options. Only Google Search is allowed for hotel
# campaigns.
campaign.network_settings.target_google_search = True
      

Ruby

# Create a campaign.
campaign_operation = client.operation.create_resource.campaign do |c|
  c.name = generate_random_name_field("Interplanetary Cruise Campaign")

  # Configure settings related to hotel campaigns.
  c.advertising_channel_type = :HOTEL
  c.hotel_setting = client.resource.hotel_setting_info do |hsi|
    hsi.hotel_center_id = hotel_center_account_id
  end

  # Recommendation: Set the campaign to PAUSED when creating it to prevent the
  # ads from immediately serving. Set to ENABLED once you've added targeting and
  # the ads are ready to serve.
  c.status = :PAUSED

  # Set the bidding strategy to PercentCpc. Only Manual CPC and Percent CPC can
  # be used for hotel campaigns.
  c.percent_cpc = client.resource.percent_cpc do |pcpc|
    pcpc.cpc_bid_ceiling_micros = cpc_bid_ceiling_micro_amount
  end

  # Set the budget.
  c.campaign_budget = budget_resource

  # Configures the campaign network options. Only Google Search is allowed for
  # hotel campaigns.
  c.network_settings = client.resource.network_settings do |ns|
    ns.target_google_search = true
  end
end
      

Perl

# Create a hotel campaign.
my $campaign = Google::Ads::GoogleAds::V16::Resources::Campaign->new({
    name => "Interplanetary Cruise Campaign #" . uniqid(),
    # Configure settings related to hotel campaigns including advertising
    # channel type and hotel setting info.
    advertisingChannelType => HOTEL,
    hotelSetting           =>
      Google::Ads::GoogleAds::V16::Resources::HotelSettingInfo->new({
        hotelCenterId => $hotel_center_account_id
      }
      ),
    # Recommendation: Set the campaign to PAUSED when creating it to prevent
    # the ads from immediately serving. Set to ENABLED once you've added
    # targeting and the ads are ready to serve.
    status => Google::Ads::GoogleAds::V16::Enums::CampaignStatusEnum::PAUSED,
    # Set the bidding strategy to PercentCpc. Only Manual CPC and Percent CPC
    # can be used for hotel campaigns.
    percentCpc => Google::Ads::GoogleAds::V16::Common::PercentCpc->new(
      {cpcBidCeilingMicros => $cpc_bid_ceiling_micro_amount}
    ),
    # Set the budget.
    campaignBudget => $budget_resource_name,
    # Configure the campaign network options. Only Google Search is allowed for
    # hotel campaigns.
    networkSettings =>
      Google::Ads::GoogleAds::V16::Resources::NetworkSettings->new({
        targetGoogleSearch => "true"
      })});
      

बिडिंग की रणनीति अपडेट करना

किसी कैंपेन की बिडिंग की रणनीति अपडेट करने के लिए, CampaignOperation.update में जाकर, Campaign के फ़ील्ड को सेट करें. इसके लिए, बिडिंग की रणनीति असाइन करें में दिया गया तरीका अपनाएं.