Stay organized with collectionsSave and categorize content based on your preferences.
The first step in implementing Things to do ads is creating a Things to do
campaign. In creating the campaign, you set its budget, bidding strategy, and
Things to do Center account ID.
defadd_things_to_do_campaign(client:GoogleAdsClient,customer_id:str,budget_resource_name:str,things_to_do_center_account_id:int,)->str:"""Creates a new Things to do campaign in the specified customer account.Args:client: an initialized GoogleAdsClient instance.customer_id: a client customer ID.budget_resource_name: the resource name of a budget for a new campaign.things_to_do_center_account_id: the Things to Do Center account ID.Returns:The resource name of the newly created campaign."""# Creates a campaign operation.operation:CampaignOperation=client.get_type("CampaignOperation")# Creates a campaign.campaign:Campaign=operation.createcampaign.name=(f"Interplanetary Cruise Campaign #{get_printable_datetime()}")# Configures settings related to Things to do campaigns including# advertising channel type, advertising channel sub type and travel# campaign settings.campaign.advertising_channel_type=(client.enums.AdvertisingChannelTypeEnum.TRAVEL)campaign.advertising_channel_sub_type=(client.enums.AdvertisingChannelSubTypeEnum.TRAVEL_ACTIVITIES)campaign.travel_campaign_settings.travel_account_id=(things_to_do_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# Sets the bidding strategy to MaximizeConversionValue. Only this type can# be used for Things to do campaigns.campaign.maximize_conversion_value=client.get_type("MaximizeConversionValue")# Sets the budget.campaign.campaign_budget=budget_resource_name# Configures the campaign network options. Only Google Search is allowed for# Things to do 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)# Issues a mutate request to add campaigns.campaign_service:CampaignServiceClient=client.get_service("CampaignService")response:MutateCampaignsResponse=campaign_service.mutate_campaigns(customer_id=customer_id,operations=[operation])resource_name:str=response.results[0].resource_nameprint(f"Added a Things to do campaign with resource name: '{resource_name}'.")returnresource_name
defadd_things_to_do_campaign(client,customer_id,budget_resource,things_to_do_center_account_id)# Create a campaign.campaign_operation=client.operation.create_resource.campaigndo|c|c.name=generate_random_name_field("Interplanetary Cruise Campaign")# Configures settings related to Things to Do campaigns including# advertising channel type, advertising channel sub type and# travel campaign settings.c.advertising_channel_type=:TRAVELc.advertising_channel_sub_type=:TRAVEL_ACTIVITIESc.travel_campaign_settings=client.resource.travel_campaign_settingsdo|tcs|tcs.travel_account_id=things_to_do_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# Sets the bidding strategy to MaximizeConversionValue. Only this type can# be used for Things to Do campaigns.c.maximize_conversion_value=client.resource.maximize_conversion_value# Set the budget.c.campaign_budget=budget_resource# Configures the campaign network options. Only Google Search is allowed for# Things to Do 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 Things To Do campaign with resource name '#{campaign_resource}'."campaign_resourceend
subadd_things_to_do_campaign{my($api_client,$customer_id,$budget_resource_name,$things_to_do_center_account_id)=@_;# Create a campaign.my$campaign=Google::Ads::GoogleAds::V21::Resources::Campaign->new({name=>"Interplanetary Cruise Campaign #".uniqid(),# Configure settings related to Things to do campaigns including# advertising channel type, advertising channel sub type and travel# campaign settings.advertisingChannelType=>TRAVEL,advertisingChannelSubType=>TRAVEL_ACTIVITIES,travelCampaignSettings=>Google::Ads::GoogleAds::V21::Resources::TravelCampaignSettings->new({travelAccountId=>$things_to_do_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 MaximizeConversionValue. Only this type can be# used for Things to do campaigns.maximizeConversionValue=>Google::Ads::GoogleAds::V21::Common::MaximizeConversionValue->new(),# Set the budget.campaignBudget=>$budget_resource_name,# 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,# Configure the campaign network options. Only Google Search is allowed for# Things to do 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 Things to do 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\u003eThings to do ads require a dedicated campaign with specific settings, including budget, bidding strategy, and Things to do Center account ID.\u003c/p\u003e\n"],["\u003cp\u003eThe campaign must be configured with \u003ccode\u003eTRAVEL\u003c/code\u003e as the advertising channel type and \u003ccode\u003eTRAVEL_ACTIVITIES\u003c/code\u003e as the sub-type.\u003c/p\u003e\n"],["\u003cp\u003eA \u003ccode\u003eMaximizeConversionValue\u003c/code\u003e bidding strategy is required for these campaigns, and only Google Search is allowed as a network option.\u003c/p\u003e\n"],["\u003cp\u003eBefore activation, ensure the campaign is set to \u003ccode\u003ePAUSED\u003c/code\u003e, and only switch to \u003ccode\u003eENABLED\u003c/code\u003e once targeting and ads are ready.\u003c/p\u003e\n"]]],[],null,[]]