Stay organized with collectionsSave and categorize content based on your preferences.
You can use the Google Ads API to set or update bids for Hotel ads.
Do not set thebidding_strategyorbidding_strategy_typefields. Thebidding_strategy_typefield is only for
reading the current setting for a campaign; the field is read-only.
For aCommission(per conversion or per stay) strategy:
You can update bid amounts by updating the fixed percentage of the conversion
value that was set at the campaign level when you assigned the strategy. For
details, seeUpdate a bidding strategy.
For CPC% and Manual CPC bid strategies, specific bid amounts need to be set at:
The ad group level
The listing group level on unit nodes of a listing group tree
However, although you must set the value at the ad group
level, that value won't be used by Hotel ads. Hotel ads will use the value at
the listing group level, which will override the irrelevant value at the ad
group level.
You can also control bid ceilings at the campaign level as part of setting the
bid strategy. For details, seeAssign or Update a Bidding Strategy.
Set a bid on an ad group
The code below shows how to set a bid at the ad group level when creating
a new hotel ad group.
defadd_hotel_ad_group(client:GoogleAdsClient,customer_id:str,campaign_resource_name:str)->str:ad_group_service:AdGroupServiceClient=client.get_service("AdGroupService")# Create ad group.ad_group_operation:AdGroupOperation=client.get_type("AdGroupOperation")ad_group:AdGroup=ad_group_operation.createad_group.name=f"Earth to Mars cruise{uuid.uuid4()}"ad_group.status=client.enums.AdGroupStatusEnum.ENABLEDad_group.campaign=campaign_resource_name# Sets the ad group type to HOTEL_ADS. This cannot be set to other types.ad_group.type_=client.enums.AdGroupTypeEnum.HOTEL_ADSad_group.cpc_bid_micros=10000000# Add the ad group.ad_group_response:MutateAdGroupsResponse=(ad_group_service.mutate_ad_groups(customer_id=customer_id,operations=[ad_group_operation]))ad_group_resource_name:str=ad_group_response.results[0].resource_nameprint("Added a hotel ad group with resource name '{ad_group_resource_name}'.")returnad_group_resource_name
defadd_hotel_ad_group(client,customer_id,campaign_resource)# Create an ad group.ad_group_operation=client.operation.create_resource.ad_groupdo|ag|ag.name=generate_random_name_field("Earth to Mars Cruise")# Set the campaign.ag.campaign=campaign_resource# Optional: Set the ad group type to HOTEL_ADS.# This cannot be set to other types.ag.type=:HOTEL_ADSag.cpc_bid_micros=10_000_000ag.status=:ENABLEDend# Issue a mutate request to add the ad group.ad_group_service=client.service.ad_groupresponse=ad_group_service.mutate_ad_groups(customer_id:customer_id,operations:[ad_group_operation])# Fetch the new ad group's resource name.ad_group_resource=response.results.first.resource_nameputs"Added hotel ad group with resource name '#{ad_group_resource}'."ad_group_resourceend
subadd_hotel_ad_group{my($api_client,$customer_id,$campaign_resource_name)=@_;# Create an ad group.my$ad_group=Google::Ads::GoogleAds::V21::Resources::AdGroup->new({name=>"Earth to Mars Cruise #".uniqid(),# Set the campaign.campaign=>$campaign_resource_name,# Set the ad group type to HOTEL_ADS.# This cannot be set to other types.type=>HOTEL_ADS,cpcBidMicros=>1000000,status=>Google::Ads::GoogleAds::V21::Enums::AdGroupStatusEnum::ENABLED});# Create an ad group operation.my$ad_group_operation=Google::Ads::GoogleAds::V21::Services::AdGroupService::AdGroupOperation->new({create=>$ad_group});# Add the ad group.my$ad_group_resource_name=$api_client->AdGroupService()->mutate({customerId=>$customer_id,operations=>[$ad_group_operation]})->{results}[0]{resourceName};printf"Added a hotel ad group with resource name: '%s'.\n",$ad_group_resource_name;return$ad_group_resource_name;}
As described inCreate Hotel Listing Groups, Hotel
ads will not serve until you create a valid listing group tree with at least one
unit node. Also, nodes are objects of theListingGroupInfoclass, which contains theListingGroupTypefield
that indicates if nodes are a unit or subdivision. SettingListingGroupInfotolisting_groupofAdGroupCriterionlinks
theListingGroupInfoobject to theAdGroup. You can
set bids on unit nodes by setting thepercent_cpc_bid_microsfield or thecpc_bid_microsfield ofAdGroupCriterion. Attempting to do so on subdivision
nodes will fail with an error.
When setting bids at the listing group level, note the following:
You can't set the bid amount on the "All hotels" (root) hotel listing group.
You can't set the bid amount on a subdivision.
Google recommendsnotsetting bids on "Other" nodes that are
unit nodes. Bids on "Other" (unit) nodes can have unintended effects on other
hotel ad bids.
The code below shows how to set a bid on a listing group unit node.
defadd_level1_nodes(client:GoogleAdsClient,customer_id:str,ad_group_id:str,root_resource_name:str,operations:List[AdGroupCriterionOperation],percent_cpc_bid_micro_amount:int,)->str:"""Creates child nodes on level 1, partitioned by the hotel class info.Args:client: The Google Ads API client.customer_id: The Google Ads customer ID.ad_group_id: The ad group ID to which the hotel listing group will beadded.root_resource_name: The string resource name of the listing group's rootnode.operations: A list of AdGroupCriterionOperations.percent_cpc_bid_micro_amount: The CPC bid micro amount to be set oncreated ad group criteria.Returns:The string resource name of the "other hotel classes" node, which servesas the parent node for the next level of the listing tree."""globalnext_temp_id# Create listing dimension info for 5-star class hotels.five_starred_listing_dimension_info:ListingDimensionInfo=client.get_type("ListingDimensionInfo")five_starred_listing_dimension_info.hotel_class.value=5# Create a listing group info for 5-star hotels as a UNIT node.five_starred_unit:ListingGroupInfo=create_listing_group_info(client,client.enums.ListingGroupTypeEnum.UNIT,root_resource_name,five_starred_listing_dimension_info,)# Create an ad group criterion for 5-star hotels.five_starred_ad_group_criterion:AdGroupCriterion=(create_ad_group_criterion(client,customer_id,ad_group_id,five_starred_unit,percent_cpc_bid_micro_amount,))# Create an operation and add it to the list of operations.five_starred_ad_group_criterion_operation:AdGroupCriterionOperation=(client.get_type("AdGroupCriterionOperation"))client.copy_from(five_starred_ad_group_criterion_operation.create,five_starred_ad_group_criterion,)operations.append(five_starred_ad_group_criterion_operation)# Decrement the temp ID for the next ad group criterion.next_temp_id-=1# You can also create more UNIT nodes for other hotel classes by copying the# above code in this method and modifying the hotel class value.# For instance, passing 4 instead of 5 in the above code will instead create# a UNIT node of 4-star hotels.# Create hotel class info and dimension info without any specifying# attributes. This node will then represent hotel classes other than those# already covered by UNIT nodes at this level.other_hotels_listing_dimension_info:ListingDimensionInfo=client.get_type("ListingDimensionInfo")# Set "hotel_class" as the oneof field on the ListingDimensionInfo object# without specifying the optional hotel_class field.client.copy_from(other_hotels_listing_dimension_info.hotel_class,client.get_type("HotelClassInfo"),)# Create listing group info for other hotel classes as a SUBDIVISION node,# which will be used as a parent node for children nodes of the next level.other_hotels_subdivision_listing_group_info:ListingGroupInfo=(create_listing_group_info(client,client.enums.ListingGroupTypeEnum.SUBDIVISION,root_resource_name,other_hotels_listing_dimension_info,))# Create an ad group criterion for other hotel classes.other_hotels_ad_group_criterion:AdGroupCriterion=(create_ad_group_criterion(client,customer_id,ad_group_id,other_hotels_subdivision_listing_group_info,percent_cpc_bid_micro_amount,))# Create an operation and add it to the list of operations.other_hotels_ad_group_criterion_operation:AdGroupCriterionOperation=(client.get_type("AdGroupCriterionOperation"))client.copy_from(other_hotels_ad_group_criterion_operation.create,other_hotels_ad_group_criterion,)operations.append(other_hotels_ad_group_criterion_operation)# Decrement the temp ID for the next ad group criterion.next_temp_id-=1returnother_hotels_ad_group_criterion.resource_name
defadd_level1_nodes(client,customer_id,ad_group_id,root_resource_name,operations,percent_cpc_bid_micro_amount)# Creates hotel class info and dimension info for 5-star hotels.five_starred_dimension_info=client.resource.listing_dimension_infodo|d|d.hotel_class=client.resource.hotel_class_infodo|c|c.value=5endend# Creates listing group info for 5-star hotels as a UNIT node.five_starred_unit=create_listing_group_info(client,:UNIT,root_resource_name,five_starred_dimension_info,)# Creates an ad group criterion for 5-star hotels.five_starred_ad_group_criterion=create_ad_group_criterion(client,customer_id,ad_group_id,five_starred_unit,percent_cpc_bid_micro_amount,)operations<<generate_create_operation(client,five_starred_ad_group_criterion,)# You can also create more UNIT nodes for other hotel classes by copying the# above code in this method and modifying the value passed to HotelClassInfo()# to the value you want.# For instance, passing 4 instead of 5 in the above code will create a UNIT# node of 4-star hotels instead.# Creates hotel class info and dimension info for other hotel classes# by *not* specifying any attributes on those object.other_hotels_dimention_info=client.resource.listing_dimension_infodo|d|d.hotel_class=client.resource.hotel_class_infoend# Creates listing group info for other hotel classes as a SUBDIVISION node,# which will be used as a parent node for children nodes of the next level.other_hotels_subdivision=create_listing_group_info(client,:SUBDIVISION,root_resource_name,other_hotels_dimention_info,)# Creates an ad group criterion for other hotel classes.other_hotels_ad_group_criterion=create_ad_group_criterion(client,customer_id,ad_group_id,other_hotels_subdivision,percent_cpc_bid_micro_amount,)operations<<generate_create_operation(client,other_hotels_ad_group_criterion,)other_hotels_ad_group_criterion.resource_nameend
subadd_level_1_nodes{my($customer_id,$ad_group_id,$root_resource_name,$operations,$percent_cpc_bid_micro_amount)=@_;# Create hotel class info and dimension info for 5-star hotels.my$five_starred_dimension_info=Google::Ads::GoogleAds::V21::Common::ListingDimensionInfo->new({hotelClass=>Google::Ads::GoogleAds::V21::Common::HotelClassInfo->new({value=>5})});# Create listing group info for 5-star hotels as a UNIT node.my$five_starred_unit=create_listing_group_info(UNIT,$root_resource_name,$five_starred_dimension_info);# Create an ad group criterion for 5-star hotels.my$five_starred_ad_group_criterion=create_ad_group_criterion($customer_id,$ad_group_id,$five_starred_unit,$percent_cpc_bid_micro_amount);my$operation=generate_create_operation($five_starred_ad_group_criterion);push@$operations,$operation;# You can also create more UNIT nodes for other hotel classes by copying the# above code in this method and modifying the value passed to HotelClassInfo# to the value you want. For instance, passing 4 instead of 5 in the above code# will create a UNIT node of 4-star hotels instead.# Create hotel class info and dimension info for other hotel classes by *not*# specifying any attributes on those object.my$others_hotels_dimension_info=Google::Ads::GoogleAds::V21::Common::ListingDimensionInfo->new({hotelClass=>Google::Ads::GoogleAds::V21::Common::HotelClassInfo->new()});# Create listing group info for other hotel classes as a SUBDIVISION node, which# will be used as a parent node for children nodes of the next level.my$other_hotels_subdivision=create_listing_group_info(SUBDIVISION,$root_resource_name,$others_hotels_dimension_info);# Create an ad group criterion for other hotel classes.my$other_hotels_ad_group_criterion=create_ad_group_criterion($customer_id,$ad_group_id,$other_hotels_subdivision,$percent_cpc_bid_micro_amount);$operation=generate_create_operation($other_hotels_ad_group_criterion);push@$operations,$operation;return$other_hotels_ad_group_criterion->{resourceName};}
[[["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 Ads bids are automatically eligible for Property Promotion Ads if the AdGroup type is \u003ccode\u003ePROMOTED_HOTEL_ADS\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eListing group level bids override ad group level bids, making the latter inconsequential for Hotel Ads.\u003c/p\u003e\n"],["\u003cp\u003eFor Hotel Ads to serve, listing group trees must be created with at least one unit node where bids are set using either \u003ccode\u003epercent_cpc_bid_micros\u003c/code\u003e or \u003ccode\u003ecpc_bid_micros\u003c/code\u003e fields within the \u003ccode\u003eAdGroupCriterion\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eAvoid setting bids on "Other" unit nodes and subdivision nodes, focusing instead on specific criteria like hotel class or amenities for effective targeting.\u003c/p\u003e\n"],["\u003cp\u003eCommission-based strategies require initial bid settings at the campaign level and updates are managed by adjusting the conversion value percentage, whereas CPC% or Manual CPC strategies allow adjustments at the ad group level with bid ceilings managed at the campaign level.\u003c/p\u003e\n"]]],[],null,[]]