Creating a Hotel Ad GroupStay organized with collectionsSave and categorize content based on your preferences.
Page Summary
To run ads for a Hotel campaign, you need to create an AdGroup of typeHOTEL_ADSwith at least one ad.
The AdGroup must be of theHOTEL_ADStype, which is set in thetypefield.
The code examples demonstrate setting a Percent CPC bid, which is relevant when the campaign's bidding strategy isPercentCpc.
In order to serve ads for your Hotel campaign, you must create anAdGroupwith at least one ad in the ad group. As shown
later, a Hotel campaign supports only an ad group of theHOTEL_ADStype,
which you can set in thetypefield. The
code example also sets a Percent CPC bid since
the campaign's bidding strategy isPercentCpc.
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::V22::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::V22::Enums::AdGroupStatusEnum::ENABLED});# Create an ad group operation.my$ad_group_operation=Google::Ads::GoogleAds::V22::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;}
[[["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-12-03 UTC."],[],[]]