Stay organized with collectionsSave and categorize content based on your preferences.
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:
defadd_hotel_campaign(client:GoogleAdsClient,customer_id:str,budget_resource_name:str,hotel_center_account_id:int,cpc_bid_ceiling_micro_amount:int,)->str:campaign_service:CampaignServiceClient=client.get_service("CampaignService")# Create campaign.campaign_operation:CampaignOperation=client.get_type("CampaignOperation")campaign:Campaign=campaign_operation.createcampaign.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# Declare whether or not this campaign serves political ads targeting the# EU. Valid values are:# CONTAINS_EU_POLITICAL_ADVERTISING# DOES_NOT_CONTAIN_EU_POLITICAL_ADVERTISINGcampaign.contains_eu_political_advertising=(client.enums.EuPoliticalAdvertisingStatusEnum.DOES_NOT_CONTAIN_EU_POLITICAL_ADVERTISING)# Add the campaign.campaign_response:MutateCampaignsResponse=(campaign_service.mutate_campaigns(customer_id=customer_id,operations=[campaign_operation]))campaign_resource_name:str=campaign_response.results[0].resource_nameprint("Added a hotel campaign with resource name '{campaign_resource_name}'.")returncampaign_resource_name
defadd_hotel_campaign(client,customer_id,budget_resource,hotel_center_account_id,cpc_bid_ceiling_micro_amount)# Create a campaign.campaign_operation=client.operation.create_resource.campaigndo|c|c.name=generate_random_name_field("Interplanetary Cruise Campaign")# Configure settings related to hotel campaigns.c.advertising_channel_type=:HOTELc.hotel_setting=client.resource.hotel_setting_infodo|hsi|hsi.hotel_center_id=hotel_center_account_idend# 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_cpcdo|pcpc|pcpc.cpc_bid_ceiling_micros=cpc_bid_ceiling_micro_amountend# 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_settingsdo|ns|ns.target_google_search=trueend# Declare whether or not this campaign serves political ads targeting the EU.# Valid values are CONTAINS_EU_POLITICAL_ADVERTISING and# DOES_NOT_CONTAIN_EU_POLITICAL_ADVERTISING.c.contains_eu_political_advertising=:DOES_NOT_CONTAIN_EU_POLITICAL_ADVERTISINGend# Issue a mutate request to add the campaign.campaign_service=client.service.campaignresponse=campaign_service.mutate_campaigns(customer_id:customer_id,operations:[campaign_operation],)# Fetch the new campaign's resource name.campaign_resource=response.results.first.resource_nameputs"Added hotel campaign with resource name '#{campaign_resource}'."campaign_resourceend
subadd_hotel_campaign{my($api_client,$customer_id,$budget_resource_name,$hotel_center_account_id,$cpc_bid_ceiling_micro_amount)=@_;# Create a hotel campaign.my$campaign=Google::Ads::GoogleAds::V21::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::V21::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::V21::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::V21::Common::PercentCpc->new({cpcBidCeilingMicros=>$cpc_bid_ceiling_micro_amount}),# Declare whether or not this campaign serves political ads targeting the EU.# Valid values are CONTAINS_EU_POLITICAL_ADVERTISING and# DOES_NOT_CONTAIN_EU_POLITICAL_ADVERTISING.containsEuPoliticalAdvertising=>DOES_NOT_CONTAIN_EU_POLITICAL_ADVERTISING,# Set the budget.campaignBudget=>$budget_resource_name,# Configure the campaign network options. Only Google Search is allowed for# hotel campaigns.networkSettings=>Google::Ads::GoogleAds::V21::Resources::NetworkSettings->new({targetGoogleSearch=>"true"})});# Create a campaign operation.my$campaign_operation=Google::Ads::GoogleAds::V21::Services::CampaignService::CampaignOperation->new({create=>$campaign});# Add the campaign.my$campaign_resource_name=$api_client->CampaignService()->mutate({customerId=>$customer_id,operations=>[$campaign_operation]})->{results}[0]{resourceName};printf"Added a hotel campaign with resource name: '%s'.\n",$campaign_resource_name;return$campaign_resource_name;}
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-03 UTC."],[[["\u003cp\u003eHotel campaigns are initiated by setting the \u003ccode\u003eadvertising_channel_type\u003c/code\u003e to \u003ccode\u003eHOTEL\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eA \u003ccode\u003eHotelSettingInfo\u003c/code\u003e object is created to link the campaign with a Hotel Ads Center account using the \u003ccode\u003ehotel_center_id\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003ePercent CPC is the recommended bidding strategy for hotel campaigns, allowing for bid adjustments based on a percentage of the click cost.\u003c/p\u003e\n"],["\u003cp\u003eBefore launching, it's advisable to set the campaign status to \u003ccode\u003ePAUSED\u003c/code\u003e, activating it after adding targeting and ensuring ads are ready.\u003c/p\u003e\n"]]],[],null,[]]