導入購物廣告的第一步是建立購物廣告活動。購物廣告活動可向使用者顯示產品圖片、名稱、價格、商店名稱等資訊。建立購物廣告活動時,您需要設定預算、出價策略和購物設定。
建立購物廣告活動前,請先將 Google Ads 帳戶連結至 Google Merchant Center 帳戶。連結帳戶後,您可以在指定購物設定時使用 Google Merchant Center 帳戶 ID。
標準購物廣告活動
您必須建立這類廣告活動,才能製作產品購物廣告。產品 購物廣告可讓您在廣告中加入圖片、名稱、價格,以及商店或商家名稱,不必為每項產品建立專屬廣告。
請按照下列步驟設定標準購物廣告活動:
- 將廣告活動的
advertising_channel_type設為SHOPPING。 - 建立
ShoppingSetting、設定欄位,然後加入廣告活動。 - 建立組合出價策略或設定廣告活動層級出價策略。
- 建立新的廣告活動預算,或設定現有的共用預算。
- 設定
contains_eu_political_advertising(例如DOES_NOT_CONTAIN_EU_POLITICAL_ADVERTISING或CONTAINS_EU_POLITICAL_ADVERTISING),聲明廣告活動是否放送指定歐盟的政治廣告。
您可以使用平均每日預算或廣告活動總預算。廣告活動總預算僅適用於設有開始和結束日期的廣告活動 (在 Campaign 上使用 start_date_time 和 end_date_time 設定)。如要瞭解如何建立預算,請參閱「建立廣告活動預算」。
如果是標準購物廣告活動,ShoppingSetting 支援下列欄位。
必填欄位
merchant_id- Merchant Center ID,代表含有要宣傳產品的帳戶。
campaign_priority- 購物廣告活動的優先順序。優先順序數字較高的廣告活動會優先於數字較低的廣告活動。允許的值介於 0 到 2 之間 (含 0 和 2)。
選填欄位
feed_labelMerchant Center 中定義的動態饋給標籤字串。如需從特定 Merchant Center 動態饋給選取產品,請使用這個欄位。如未指定,廣告活動會使用 Merchant Center 中所有可用的動態饋給。
請使用
feed_label欄位,而非已淘汰的sales_country欄位 (雙字母國家/地區代碼XX格式)。詳情請參閱動態饋給標籤的說明文章。請注意,在
feed_label中提交國家/地區代碼,並不會自動啟用在該國家/地區放送廣告的功能,您必須先設定指定地理區域。enable_local這個選項可為廣告活動啟用本地商店所銷售產品的廣告。
ignore_brand_exclusion_in_shopping_ads適用於 24 以上版本。布林值,設為
true時,系統會忽略這個廣告活動中購物廣告的品牌排除條件。advertising_partner_ids廣告活動中合作廣告合作夥伴的 Google Ads 帳戶 ID 清單,不可變更。適用於已連結廣告合作夥伴的帳戶。
出價策略可設為組合出價策略或廣告活動出價策略。
組合出價策略:可供多個廣告活動、廣告群組和關鍵字共用的自動出價策略。使用
BiddingStrategyService建立。支援下列組合出價策略:
廣告活動出價策略:直接在廣告活動上設定的出價策略。這包括與購物廣告活動相容的自動出價策略。
支援下列廣告活動出價策略:
網路設定
標準購物廣告活動不支援 network_settings.target_content_network 欄位。
在變更要求中,將標準購物廣告活動的這個欄位設為 true,會產生 CANNOT_TARGET_CONTENT_NETWORK 錯誤。
詳情請參閱「Google Ads 標準購物廣告活動聯播網設定異動」。
程式碼範例
下列程式碼會設定廣告管道類型、ShoppingSetting、出價策略、廣告活動預算和歐盟政治廣告狀態,建立標準購物廣告活動:
Java
private String addStandardShoppingCampaign( GoogleAdsClient googleAdsClient, long customerId, String budgetResourceName, long merchantCenterAccountId) { // Configures the shopping settings. ShoppingSetting shoppingSetting = ShoppingSetting.newBuilder() // 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 // 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.getDefaultInstance()) // Sets the budget. .setCampaignBudget(budgetResourceName) // Declares whether this campaign serves political ads targeting the EU. .setContainsEuPoliticalAdvertising(DOES_NOT_CONTAIN_EU_POLITICAL_ADVERTISING) .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.V26.CampaignService); // Configures the shopping settings. ShoppingSetting shoppingSetting = new ShoppingSetting() { // 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. // 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(), // Sets the budget. CampaignBudget = budgetResourceName, // Declare whether or not this campaign contains political ads targeting the EU. ContainsEuPoliticalAdvertising = EuPoliticalAdvertisingStatus.DoesNotContainEuPoliticalAdvertising, }; // 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 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. // 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(), // Sets the budget. 'campaign_budget' => $budgetResourceName, // Declare whether or not this campaign serves political ads targeting the EU. 'contains_eu_political_advertising' => EuPoliticalAdvertisingStatus::DOES_NOT_CONTAIN_EU_POLITICAL_ADVERTISING ] ); // Creates a campaign operation. $campaignOperation = new CampaignOperation(); $campaignOperation->setCreate($campaign); // Issues a mutate request to add campaigns. $campaignServiceClient = $googleAdsClient->getCampaignServiceClient(); $response = $campaignServiceClient->mutateCampaigns( MutateCampaignsRequest::build($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: GoogleAdsClient, customer_id: str, budget_resource_name: str, merchant_center_account_id: int, ) -> str: """Creates a new standard shopping campaign in the specified client account.""" campaign_service: CampaignServiceClient = client.get_service( "CampaignService" ) # Create standard shopping campaign. campaign_operation: CampaignOperation = client.get_type("CampaignOperation") campaign: Campaign = campaign_operation.create campaign.name = f"Interplanetary Cruise Campaign {uuid.uuid4()}" # Configures settings related to shopping campaigns including advertising # channel type and shopping setting. campaign.advertising_channel_type = ( client.enums.AdvertisingChannelTypeEnum.SHOPPING ) campaign.shopping_setting.merchant_id = merchant_center_account_id # 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.enums.CampaignStatusEnum.PAUSED # Sets the bidding strategy to Manual CPC. # 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 = client.get_type("ManualCpc") # Sets the budget. campaign.campaign_budget = budget_resource_name # Declare whether or not this campaign serves political ads targeting the # EU. Valid values are: # CONTAINS_EU_POLITICAL_ADVERTISING # DOES_NOT_CONTAIN_EU_POLITICAL_ADVERTISING campaign.contains_eu_political_advertising = ( client.enums.EuPoliticalAdvertisingStatusEnum.DOES_NOT_CONTAIN_EU_POLITICAL_ADVERTISING ) # Add the campaign. campaign_response = campaign_service.mutate_campaigns( customer_id=customer_id, operations=[campaign_operation] ) campaign_resource_name: str = campaign_response.results[0].resource_name print( "Added a standard shopping campaign with resource name " f"'{campaign_resource_name}'." ) return campaign_resource_name
小茹
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.campaign_priority = 0 shopping_setting.enable_local = true end campaign.status = :PAUSED # Sets the bidding strategy to Manual CPC. campaign.manual_cpc = client.resource.manual_cpc campaign.campaign_budget = budget_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. c.contains_eu_political_advertising = :DOES_NOT_CONTAIN_EU_POLITICAL_ADVERTISING 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::V26::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::V26::Resources::ShoppingSetting->new({ merchantId => $merchant_center_account_id, # 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::V26::Enums::CampaignStatusEnum::PAUSED, # Set the bidding strategy to Manual CPC. # 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::V26::Common::ManualCpc->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 }); # Create a campaign operation. my $campaign_operation = Google::Ads::GoogleAds::V26::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; }
curl
產品比較廣告活動
產品比較廣告活動適用於在 CSS 計畫國家/地區參與 CSS 計畫的購物比較服務 (CSS)。CSS 可透過這類廣告活動,宣傳自家網站上的一組產品。
產品比較廣告活動須符合下列規定:
- Google Ads 帳戶必須與 Merchant Center 中 CSS 的主要多重客戶帳戶建立關聯。如果帳戶不符合產品比較廣告活動的資格,您可能會收到
MERCHANT_NOT_ALLOWED_FOR_COMPARISON_LISTING_ADS錯誤。 - 廣告活動的
advertising_channel_type必須是SHOPPING。- 廣告活動的
advertising_channel_sub_type必須是SHOPPING_COMPARISON_LISTING_ADS。 - 廣告活動的
shopping_setting要求將merchant_id設為 CSS 的 Merchant Center 帳戶 ID。 - 僅支援
manual_cpc出價策略。
- 廣告活動的
- 廣告群組的
type必須設為SHOPPING_COMPARISON_LISTING_ADS。- 如要放送廣告,每個廣告群組都必須包含產品分區樹狀結構,且其中至少有一個
listing group。最簡單的樹狀結構是單一根節點,其中包含廣告群組中的所有產品。詳情請參閱商家資訊群組指南。
- 如要放送廣告,每個廣告群組都必須包含產品分區樹狀結構,且其中至少有一個
車輛廣告
您可以使用標準購物廣告活動,為上傳至 Merchant Center 的車輛商品目錄放送車輛廣告。
如要建立含有車輛資料的購物廣告活動,請按照下列步驟操作:
- 按照標準購物廣告活動設定步驟操作。
- 將廣告活動的
listing_type設為VEHICLES(適用於第 26 版及更新版本的購物廣告活動)。這個欄位不可變更 (CREATE_ONLY),且只能在建立廣告活動時設定。 - 使用 Merchant Center 帳戶的
merchant_id設定shopping_setting,該帳戶須包含已核准的車輛商品目錄動態饋給。 - 使用標準購物廣告活動結構,設定下游廣告活動資源 (廣告群組、廣告群組廣告和商家資訊群組)。