The first step in implementing Shopping Ads is to create a Shopping campaign. Shopping campaigns allow users to see Ads that show an image of the product including title, price, store name and more. When creating a Shopping campaign, you will need to set its budget, bidding strategy and the shopping settings.
Before you can create a Shopping campaign, you need to link your Google Ads account to your Google Merchant Center account. Consult the article on linking your accounts for more information. Once you have linked accounts, you can use the Google Merchant Center account ID when specifying the shopping settings.
There are two types of Shopping campaign that can be created using the Google Ads API:
Different campaign settings are required to support these types of campaign, which are covered below.
Standard Shopping campaigns
This is the campaign required to create Product Shopping ads. Product Shopping ads allow you to include an image, title, price, and your store or business name inside your ads, without the need for you to create unique ads for each product you sell.
Here are the steps for setting up a standard Shopping campaign:
- Set the campaign's
advertising_channel_type
toSHOPPING
. - Create a
ShoppingSetting
, set the fields and then add it to the campaign. - Create a portfolio bid strategy or set a campaign level bid strategy.
- Create a new campaign budget or set an existing shared budget.
For standard Shopping campaigns,
ShoppingSetting
supports the following
fields:
Required
merchant_id
: The Merchant Center ID of the account that contains the products to advertise.sales_country
: The target sales country of the products to include in this campaign.campaign_priority
: The priority of the shopping campaign. Campaigns with numerically higher priorities take precedence over those with lower priorities. Allowed values are between 0 and 2, inclusive.
Optional
enable_local
: The option to enable ads for products sold in local stores for this campaign.
A bid strategy can be set up as a:
- Portfolio bid strategy: An
automated bid strategy that can be shared across
campaigns, ad groups and keywords. Created using the
BiddingStrategyService
. - Campaign bid strategy: A bid strategy set directly on the campaign. This can include automated bidding strategies compatible with Shopping campaigns.
For standard Shopping campaigns, the following bid strategies are supported:
Portfolio bid strategy
Campaign bid strategy
This code example demonstrates how to create a standard Shopping campaign.
Java
private String addStandardShoppingCampaign( GoogleAdsClient googleAdsClient, long customerId, String budgetResourceName, long merchantCenterAccountId) { // Configures the shopping settings. ShoppingSetting shoppingSetting = ShoppingSetting.newBuilder() // Sets the sales country of products to include in the campaign. .setSalesCountry("US") // Sets the priority of the campaign. Higher numbers take priority over lower numbers. // For Shopping product ad campaigns, allowed values are between 0 and 2, inclusive. .setCampaignPriority(0) .setMerchantId(merchantCenterAccountId) // Enables local inventory ads for this campaign. .setEnableLocal(true) .build(); // Create the standard shopping campaign. Campaign campaign = Campaign.newBuilder() .setName("Interplanetary Cruise #" + getPrintableDateTime()) // Configures settings related to shopping campaigns including advertising channel type // and shopping setting. .setAdvertisingChannelType(AdvertisingChannelType.SHOPPING) .setShoppingSetting(shoppingSetting) // Recommendation: Sets 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. .setStatus(CampaignStatus.PAUSED) // Sets the bidding strategy to Manual CPC (with eCPC enabled) // Recommendation: Use one of the automated bidding strategies for Shopping campaigns // to help you optimize your advertising spend. More information can be found here: // https://support.google.com/google-ads/answer/6309029. .setManualCpc(ManualCpc.newBuilder().setEnhancedCpcEnabled(true).build()) // Sets the budget. .setCampaignBudget(budgetResourceName) .build(); // Creates a campaign operation. CampaignOperation operation = CampaignOperation.newBuilder().setCreate(campaign).build(); // Issues a mutate request to add the campaign. try (CampaignServiceClient campaignServiceClient = googleAdsClient.getLatestVersion().createCampaignServiceClient()) { MutateCampaignsResponse response = campaignServiceClient.mutateCampaigns( Long.toString(customerId), Collections.singletonList(operation)); MutateCampaignResult result = response.getResults(0); System.out.printf( "Added a standard shopping campaign with resource name: '%s'%n", result.getResourceName()); return result.getResourceName(); } }
C#
private string AddStandardShoppingCampaign(GoogleAdsClient client, long customerId, string budgetResourceName, long merchantCenterAccountId) { // Get the CampaignService. CampaignServiceClient campaignService = client.GetService(Services.V6.CampaignService); // Configures the shopping settings. ShoppingSetting shoppingSetting = new ShoppingSetting() { // Sets the sales country of products to include in the campaign. SalesCountry = "US", // Sets the priority of the campaign. Higher numbers take priority over lower // numbers. For Shopping Product Ad campaigns, allowed values are between 0 and 2, // inclusive. CampaignPriority = 0, MerchantId = merchantCenterAccountId, // Enables local inventory ads for this campaign. EnableLocal = true }; // Create the standard shopping campaign. Campaign campaign = new Campaign() { Name = "Interplanetary Cruise #" + ExampleUtilities.GetRandomString(), // Configures settings related to shopping campaigns including advertising channel // type and shopping setting. AdvertisingChannelType = AdvertisingChannelType.Shopping, ShoppingSetting = shoppingSetting, // 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 = CampaignStatus.Paused, // Sets the bidding strategy to Manual CPC (with eCPC enabled) // Recommendation: Use one of the automated bidding strategies for Shopping // campaigns to help you optimize your advertising spend. More information can be // found here: https://support.google.com/google-ads/answer/6309029 ManualCpc = new ManualCpc() { EnhancedCpcEnabled = true }, // Sets the budget. CampaignBudget = budgetResourceName }; // Creates a campaign operation. CampaignOperation operation = new CampaignOperation() { Create = campaign }; // Issues a mutate request to add the campaign. MutateCampaignsResponse response = campaignService.MutateCampaigns(customerId.ToString(), new CampaignOperation[] { operation }); MutateCampaignResult result = response.Results[0]; Console.WriteLine("Added a standard shopping campaign with resource name: '{0}'.", result.ResourceName); return result.ResourceName; }
PHP
private static function addStandardShoppingCampaign( GoogleAdsClient $googleAdsClient, int $customerId, string $budgetResourceName, int $merchantCenterAccountId ) { // Creates a standard shopping campaign. $campaign = new Campaign([ 'name' => 'Interplanetary Cruise Campaign #' . Helper::getPrintableDatetime(), // Configures settings related to shopping campaigns including advertising channel type // and shopping setting. 'advertising_channel_type' => AdvertisingChannelType::SHOPPING, // Configures the shopping settings. 'shopping_setting' => new ShoppingSetting([ // Sets the sales country of products to include in the campaign. 'sales_country' => 'US', // Sets the priority of the campaign. Higher numbers take priority over lower // numbers. For Shopping product ad campaigns, allowed values are between 0 and 2, // inclusive. 'campaign_priority' => 0, 'merchant_id' => $merchantCenterAccountId, // Enables local inventory ads for this campaign 'enable_local' => true ]), // 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' => CampaignStatus::PAUSED, // Sets the bidding strategy to Manual CPC (with eCPC enabled) // Recommendation: Use one of the automated bidding strategies for Shopping campaigns // to help you optimize your advertising spend. More information can be found here: // https://support.google.com/google-ads/answer/6309029. 'manual_cpc' => new ManualCpc(['enhanced_cpc_enabled' => true]), // Sets the budget. 'campaign_budget' => $budgetResourceName ]); // Creates a campaign operation. $campaignOperation = new CampaignOperation(); $campaignOperation->setCreate($campaign); // Issues a mutate request to add campaigns. $campaignServiceClient = $googleAdsClient->getCampaignServiceClient(); $response = $campaignServiceClient->mutateCampaigns($customerId, [$campaignOperation]); /** @var Campaign $addedCampaign */ $addedCampaign = $response->getResults()[0]; printf( "Added a standard shopping campaign with resource name '%s'.%s", $addedCampaign->getResourceName(), PHP_EOL ); return $addedCampaign->getResourceName(); }
Python
def add_standard_shopping_campaign( client, customer_id, budget_resource_name, merchant_center_account_id ): """Creates a new standard shopping campaign in the specified client account. """ campaign_service = client.get_service("CampaignService", version="v6") # Create standard shoppping campaign. campaign_operation = client.get_type("CampaignOperation", version="v6") campaign = campaign_operation.create campaign.name = "Interplanetary Cruise Campaign %s" % uuid.uuid4() # Configures settings related to shopping campaigns including advertising # channel type and shopping setting. campaign.advertising_channel_type = client.get_type( "AdvertisingChannelTypeEnum" ).SHOPPING campaign.shopping_setting.merchant_id = merchant_center_account_id # Sets the sales country of products to include in the campaign. campaign.shopping_setting.sales_country = "US" # Sets the priority of the campaign. Higher numbers take priority over lower # numbers. For standard shopping campaigns, allowed values are between 0 and # 2, inclusive. campaign.shopping_setting.campaign_priority = 0 # Enables local inventory ads for this campaign. campaign.shopping_setting.enable_local = True # 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.get_type("CampaignStatusEnum", version="v6").PAUSED # Sets the bidding strategy to Manual CPC (with eCPC enabled) # Recommendation: Use one of the automated bidding strategies for Shopping # campaigns to help you optimize your advertising spend. More information # can be found here: https://support.google.com/google-ads/answer/6309029 campaign.manual_cpc.enhanced_cpc_enabled = True # Sets the budget. campaign.campaign_budget = budget_resource_name # Add the campaign. try: campaign_response = campaign_service.mutate_campaigns( customer_id, [campaign_operation] ) except google.ads.google_ads.errors.GoogleAdsException as ex: print( 'Request with ID "%s" failed with status "%s" and includes the ' "following errors:" % (ex.request_id, ex.error.code().name) ) for error in ex.failure.errors: print('\tError with message "%s".' % error.message) if error.location: for field_path_element in error.location.field_path_elements: print("\t\tOn field: %s" % field_path_element.field_name) sys.exit(1) campaign_resource_name = campaign_response.results[0].resource_name print( 'Added a standard shopping campaign with resource name "%s".' % campaign_resource_name ) return campaign_resource_name
Ruby
def add_standard_shopping_campaign( client, customer_id, budget_name, merchant_center_id) operation = client.operation.create_resource.campaign do |campaign| campaign.name = "Interplanetary Cruise Campaign ##{(Time.new.to_f * 1000).to_i}" # Shopping campaign specific settings campaign.advertising_channel_type = :SHOPPING campaign.shopping_setting = client.resource.shopping_setting do |shopping_setting| shopping_setting.merchant_id = merchant_center_id shopping_setting.sales_country = "US" shopping_setting.campaign_priority = 0 shopping_setting.enable_local = true end campaign.status = :PAUSED campaign.manual_cpc = client.resource.manual_cpc do |manual_cpc| manual_cpc.enhanced_cpc_enabled = true end campaign.campaign_budget = budget_name end service = client.service.campaign response = service.mutate_campaigns( customer_id: customer_id, operations: [operation], ) campaign_name = response.results.first.resource_name puts "Added a standard shopping campaign with resource name #{campaign_name}." campaign_name end
Perl
sub add_standard_shopping_campaign { my ($api_client, $customer_id, $budget_resource_name, $merchant_center_account_id) = @_; # Create a standard shopping campaign. my $campaign = Google::Ads::GoogleAds::V6::Resources::Campaign->new({ name => "Interplanetary Cruise Campaign #" . uniqid(), # Configure settings related to shopping campaigns including advertising # channel type and shopping setting. advertisingChannelType => SHOPPING, shoppingSetting => Google::Ads::GoogleAds::V6::Resources::ShoppingSetting->new({ merchantId => $merchant_center_account_id, # Set the sales country of products to include in the campaign. salesCountry => "US", # Set the priority of the campaign. Higher numbers take priority over # lower numbers. For standard shopping campaigns, allowed values are # between 0 and 2, inclusive. campaignPriority => 0, # Enable local inventory ads for this campaign. enableLocal => "true" } ), # 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::V6::Enums::CampaignStatusEnum::PAUSED, # Set the bidding strategy to Manual CPC (with eCPC enabled). # Recommendation: Use one of the automated bidding strategies for shopping # campaigns to help you optimize your advertising spend. More information # can be found here: https://support.google.com/google-ads/answer/6309029. manualCpc => Google::Ads::GoogleAds::V6::Common::ManualCpc->new( {enhancedCpcEnabled => "true"} ), # Set the budget. campaignBudget => $budget_resource_name }); # Create a campaign operation. my $campaign_operation = Google::Ads::GoogleAds::V6::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 standard shopping campaign with resource name: '%s'.\n", $campaign_resource_name; return $campaign_resource_name; }
Smart Shopping campaigns
This is the campaign required to configure Smart Shopping
ads
. A Smart Shopping campaign
combines standard Shopping and display remarketing campaigns, and uses automated
bidding and ad placement to promote your products and business across networks.
Here are the steps in setting up a Smart Shopping campaign:
- Setting the campaign's
advertising_channel_type
toSHOPPING
. - Setting the campaign's
advertising_channel_sub_type
toSHOPPING_SMART_ADS
. - Create a
ShoppingSetting
, setting themerchant_id
andsales_country
then adding it to the campaign. - Set a campaign level bid strategy.
- Create a new campaign budget (only non-shared budgets).
For Smart Shopping campaigns,
ShoppingSetting
supports the
following fields:
Required
merchant_id
: The Merchant Center ID of the account that contains the products to advertise.sales_country
: The target sales country of the products to include in this campaign.
Optional
campaign_priority
: The priority of the shopping campaign. Campaigns with numerically higher priorities take precedence over those with lower priorities. This field is optional for Smart Shopping campaigns, but must be equal to 3 if set.enable_local
: The option to enable ads for products sold in local stores for this campaign.
A bid strategy can be set up as a:
- Campaign bid strategy: A bid strategy set directly on the campaign. This can include automated bidding strategies compatible with Smart Shopping campaigns.
For Smart Shopping campaigns, the following bid strategy is supported:
Campaign bid strategy
A ROAS target can be optionally set for maximize_conversion_value
. This can
be set using the target_roas
field on MaximizeConversionValue
.
For more information on maximize conversion value, see the support article:
About maximize conversion value bidding.
These steps are demonstrated in the following code:
Java
private String addSmartShoppingCampaign( GoogleAdsClient googleAdsClient, long customerId, String budgetResourceName, long merchantCenterAccountId) { // Configures the shopping settings for Smart Shopping campaigns. ShoppingSetting shoppingSetting = ShoppingSetting.newBuilder() // Sets the sales country of products to include in the campaign. // Only products from Merchant Center targeting this country will appear in the // campaign. .setSalesCountry("US") .setMerchantId(merchantCenterAccountId) .build(); // Creates the campaign. Campaign campaign = Campaign.newBuilder() .setName("Interplanetary Cruise #" + getPrintableDateTime()) // Configures settings related to shopping campaigns including advertising channel type, // advertising sub-type and shopping setting. .setAdvertisingChannelType(AdvertisingChannelType.SHOPPING) .setAdvertisingChannelSubType(AdvertisingChannelSubType.SHOPPING_SMART_ADS) .setShoppingSetting(shoppingSetting) // Recommendation: Sets 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. .setStatus(CampaignStatus.PAUSED) // Bidding strategy must be set directly on the campaign. // Setting a portfolio bidding strategy by resourceName is not supported. // Maximize conversion value is the only strategy supported for Smart Shopping // campaigns. // An optional ROAS (Return on Advertising Spend) can be set for // MaximizeConversionValue. // The ROAS value must be specified as a ratio in the API. It is calculated by dividing // "total value" by "total spend". // For more information on maximize conversion value, see the support article: // http://support.google.com/google-ads/answer/7684216) .setMaximizeConversionValue( MaximizeConversionValue.newBuilder().setTargetRoas(3.5).build()) // Sets the budget. .setCampaignBudget(budgetResourceName) .build(); // Creates a campaign operation. CampaignOperation operation = CampaignOperation.newBuilder().setCreate(campaign).build(); // Issues a mutate request to add the campaign. try (CampaignServiceClient campaignServiceClient = googleAdsClient.getLatestVersion().createCampaignServiceClient()) { MutateCampaignResult result = campaignServiceClient .mutateCampaigns(Long.toString(customerId), Collections.singletonList(operation)) .getResults(0); System.out.printf( "Added a Smart Shopping campaign with resource name: '%s'%n", result.getResourceName()); return result.getResourceName(); } }
C#
private string AddSmartShoppingCampaign(GoogleAdsClient client, long customerId, string budgetResourceName, long merchantCenterAccountId) { // Get the CampaignService. CampaignServiceClient campaignService = client.GetService(Services.V6.CampaignService); // Configures the shopping settings. ShoppingSetting shoppingSetting = new ShoppingSetting() { // Sets the sales country of products to include in the campaign. SalesCountry = "US", MerchantId = merchantCenterAccountId, }; // Create the standard shopping campaign. Campaign campaign = new Campaign() { Name = "Interplanetary Cruise #" + ExampleUtilities.GetRandomString(), // Configures settings related to shopping campaigns including advertising channel // type, sub-type and shopping setting. AdvertisingChannelType = AdvertisingChannelType.Shopping, AdvertisingChannelSubType = AdvertisingChannelSubType.ShoppingSmartAds, ShoppingSetting = shoppingSetting, // 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 = CampaignStatus.Paused, // Bidding strategy must be set directly on the campaign. // Setting a portfolio bidding strategy by resourceName is not supported. // Maximize conversion value is the only strategy supported for Smart Shopping // campaigns. // An optional ROAS (Return on Advertising Spend) can be set for // MaximizeConversionValue. // The ROAS value must be specified as a ratio in the API. It is calculated by // dividingW "total value" by "total spend". // For more information on maximize conversion value, see the support article: // http://support.google.com/google-ads/answer/7684216) MaximizeConversionValue = new MaximizeConversionValue() { TargetRoas = 3.5 }, // Sets the budget. CampaignBudget = budgetResourceName }; // Creates a campaign operation. CampaignOperation operation = new CampaignOperation() { Create = campaign }; // Issues a mutate request to add the campaign. MutateCampaignsResponse response = campaignService.MutateCampaigns(customerId.ToString(), new CampaignOperation[] { operation }); MutateCampaignResult result = response.Results[0]; Console.WriteLine("Added a Smart Shopping campaign with resource name: '{0}'.", result.ResourceName); return result.ResourceName; }
PHP
private static function addSmartShoppingCampaign( GoogleAdsClient $googleAdsClient, int $customerId, string $budgetResourceName, int $merchantCenterAccountId ) { // Configures the shopping settings for Smart Shopping campaigns. $shoppingSettings = new ShoppingSetting([ // Sets the sales country of products to include in the campaign. // Only products from Merchant Center targeting this country will appear in the // campaign. 'sales_country' => 'US', 'merchant_id' => $merchantCenterAccountId ]); // Creates the campaign. $campaign = new Campaign([ 'name' => 'Interplanetary Cruise Campaign #' . Helper::getPrintableDatetime(), // Configures settings related to shopping campaigns including // advertising channel type, advertising sub-type and shopping setting. 'advertising_channel_type' => AdvertisingChannelType::SHOPPING, 'advertising_channel_sub_type' => AdvertisingChannelSubType::SHOPPING_SMART_ADS, 'shopping_setting' => $shoppingSettings, // 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' => CampaignStatus::PAUSED, // Bidding strategy must be set directly on the campaign. // Setting a portfolio bidding strategy by resource name is not supported. // Maximize conversion value is the only strategy supported for Smart Shopping // campaigns. // An optional ROAS (Return on Advertising Spend) can be set for // MaximizeConversionValue. // The ROAS value must be specified as a ratio in the API. It is calculated by dividing // "total value" by "total spend". // For more information on maximize conversion value, see the support article: // http://support.google.com/google-ads/answer/7684216. 'maximize_conversion_value' => new MaximizeConversionValue(['target_roas' => 3.5]), // Sets the budget. 'campaign_budget' => $budgetResourceName ]); // Creates a campaign operation. $campaignOperation = new CampaignOperation(); $campaignOperation->setCreate($campaign); // Issues a mutate request to add the campaign. $campaignServiceClient = $googleAdsClient->getCampaignServiceClient(); $response = $campaignServiceClient->mutateCampaigns($customerId, [$campaignOperation]); /** @var Campaign $addedCampaign */ $addedCampaign = $response->getResults()[0]; $addedCampaignResourceName = $addedCampaign->getResourceName(); printf( "Added a Smart Shopping campaign with resource name: '%s'.%s", $addedCampaignResourceName, PHP_EOL ); return $addedCampaignResourceName; }
Ruby
def add_smart_shopping_campaign( client, customer_id, budget_name, merchant_center_id) operation = client.operation.create_resource.campaign do |campaign| campaign.name = "Interplanetary Cruise Campaign ##{(Time.new.to_f * 1000).to_i}" # Configures settings related to shopping campaigns including # advertising channel type, advertising sub-type and shopping setting. campaign.advertising_channel_type = :SHOPPING campaign.advertising_channel_sub_type = :SHOPPING_SMART_ADS campaign.shopping_setting = client.resource.shopping_setting do |shopping_setting| shopping_setting.merchant_id = merchant_center_id # Sets the sales country of products to include in the campaign. # Only products from Merchant Center targeting this country will appear in the # campaign. shopping_setting.sales_country = "US" end # 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 = :PAUSED # Bidding strategy must be set directly on the campaign. # Setting a portfolio bidding strategy by resource name is not supported. # Maximize conversion value is the only strategy supported for Smart Shopping # campaigns. # An optional ROAS (Return on Advertising Spend) can be set for # MaximizeConversionValue. # The ROAS value must be specified as a ratio in the API. It is calculated by dividing # "total value" by "total spend". # For more information on maximize conversion value, see the support article: # http://support.google.com/google-ads/answer/7684216. campaign.maximize_conversion_value = client.resource.maximize_conversion_value do |m| m.target_roas = 3.5 end campaign.campaign_budget = budget_name end response = client.service.campaign.mutate_campaigns( customer_id: customer_id, operations: [operation], ) campaign_name = response.results.first.resource_name puts "Added a Smart Shopping Campaign with resource name #{campaign_name}." campaign_name end
Perl
sub add_smart_shopping_campaign { my ($api_client, $customer_id, $budget_resource_name, $merchant_center_account_id) = @_; # Create a smart shopping campaign. my $campaign = Google::Ads::GoogleAds::V6::Resources::Campaign->new({ name => "Interplanetary Cruise Campaign #" . uniqid(), # Configure settings related to shopping campaigns including advertising # channel type, advertising channel sub-type and shopping setting. advertisingChannelType => SHOPPING, advertisingChannelSubType => SHOPPING_SMART_ADS, shoppingSetting => Google::Ads::GoogleAds::V6::Resources::ShoppingSetting->new({ merchantId => $merchant_center_account_id, # Set the sales country of products to include in the campaign. # Only products from Merchant Center targeting this country will # appear in the campaign. salesCountry => "US" } ), # 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::V6::Enums::CampaignStatusEnum::PAUSED, # Bidding strategy must be set directly on the campaign. # Setting a portfolio bidding strategy by resource name is not supported. # Maximize conversion value is the only strategy supported for smart shopping # campaigns. An optional ROAS (Return on Advertising Spend) can be set for # MaximizeConversionValue. The ROAS value must be specified as a ratio in the # API. It is calculated by dividing "total value" by "total spend". # For more information on maximize conversion value, see the support article: # http://support.google.com/google-ads/answer/7684216. maximizeConversionValue => Google::Ads::GoogleAds::V6::Common::MaximizeConversionValue->new( {targetRoas => 3.5} ), # Set the budget. campaignBudget => $budget_resource_name }); # Create a campaign operation. my $campaign_operation = Google::Ads::GoogleAds::V6::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 smart shopping campaign with resource name: '%s'.\n", $campaign_resource_name; return $campaign_resource_name; }