Creating a Hotel Campaign

The first step in implementing Hotel Ads is creating a Hotel campaign. In creating a Hotel campaign, you set its budget, bidding strategy, and Hotel Ads Center account ID.

Here are the steps in setting up a Hotel campaign:

  1. Setting the campaign's advertising_channel_type to HOTEL.
  2. Creating a HotelSettingInfo, setting its hotel_center_id, and then adding it to the campaign.
  3. Creating a PercentCpc bidding strategy for the campaign.

These steps are demonstrated in the following code:

Java

private void runExample(
    GoogleAdsClient googleAdsClient,
    long customerId,
    long hotelCenterAccountId,
    long cpcBidCeilingMicroAmount) {

  // Creates a budget to be used by the campaign that will be created below.
  String budgetResourceName = addCampaignBudget(googleAdsClient, customerId);

  // Creates a hotel campaign.
  String campaignResourceName =
      addHotelCampaign(
          googleAdsClient,
          customerId,
          budgetResourceName,
          hotelCenterAccountId,
          cpcBidCeilingMicroAmount);

  // Creates a hotel ad group.
  String adGroupResourceName = addHotelAdGroup(googleAdsClient, customerId, campaignResourceName);

  // Creates a hotel ad group ad.
  addHotelAdGroupAd(googleAdsClient, customerId, adGroupResourceName);
}

C#

public void Run(GoogleAdsClient client, long customerId, long hotelCenterAccountId,
    long cpcBidCeilingMicroAmount)

PHP

public static function runExample(
    GoogleAdsClient $googleAdsClient,
    $customerId,
    $hotelCenterAccountId,
    $cpcBidCeilingMicroAmount

Python

def main(client, customer_id, hotel_center_account_id,
         bid_ceiling_micro_amount):
    # Add budget
    budget_resource_name = add_budget(client, customer_id)

    # Add hotel campaign
    campaign_resource_name = add_hotel_campaign(
        client, customer_id, budget_resource_name, hotel_center_account_id,
        bid_ceiling_micro_amount)

    # Add hotel ad group
    ad_group_resource_name = add_hotel_ad_group(client, customer_id,
                                                campaign_resource_name)

    # Add hotel ad
    add_hotel_ad(client, customer_id, ad_group_resource_name)

The hotel_center_id referred to is described in the prerequisites.

Send feedback about...

Google Ads API Beta
Google Ads API Beta
Need help? Visit our support page.