Đề xuất có thể cải thiện các chiến dịch của bạn theo một số cách:
- Giới thiệu các tính năng mới và phù hợp
- Sử dụng ngân sách hiệu quả hơn với giá thầu, từ khóa và quảng cáo được cải thiện
- Tăng hiệu suất và hiệu quả tổng thể của các chiến dịch
Để tăng điểm tối ưu hoá, bạn có thể sử dụng RecommendationService
để truy xuất các đề xuất, sau đó áp dụng hoặc bỏ qua các đề xuất tương ứng.
Điểm tối ưu hoá
Điểm tối ưu hoá là điểm số ước tính mức độ hiệu quả của tài khoản Google Ads và khả năng hoạt động ở cấp Customer
và Campaign
.
Customer.optimization_score_weight
chỉ dành cho các tài khoản không phải tài khoản người quản lý và được dùng để tính điểm tối ưu hoá tổng thể của nhiều tài khoản. Truy xuất điểm tối ưu hoá và trọng số điểm tối ưu hoá của các tài khoản rồi nhân các tài khoản đó với nhau (Customer.optimization_score * Customer.optimization_score_weight
) để tính điểm tối ưu hoá tổng thể.
Có các chỉ số liên quan đến việc tối ưu hoá cho các báo cáo customer
và campaign
:
metrics.optimization_score_url
cung cấp đường liên kết sâu vào tài khoản để xem thông tin về các đề xuất có liên quan trong giao diện người dùng Google Ads.metrics.optimization_score_uplift
cho biết điểm tối ưu hoá sẽ tăng lên bao nhiêu nếu bạn áp dụng tất cả đề xuất có liên quan. Đây là con số ước tính dựa trên tất cả các đề xuất có sẵn, chứ không chỉ là tổng điểm số tăng cho từng đề xuất.
Để nhóm và sắp xếp các đề xuất được trả về, bạn có thể phân đoạn cả hai chỉ số này theo loại đề xuất bằng cách sử dụng segments.recommendation_type
trong truy vấn của mình.
Các loại đề xuất
API Google Ads hỗ trợ đầy đủ các loại đề xuất sau:
Loại đề xuất | Nội dung mô tả |
---|---|
CAMPAIGN_BUDGET |
Khắc phục các chiến dịch bị giới hạn ngân sách |
KEYWORD |
Thêm từ khoá mới |
TEXT_AD |
Thêm đề xuất quảng cáo |
TARGET_CPA_OPT_IN |
Đặt giá thầu với CPA mục tiêu |
MAXIMIZE_CONVERSIONS_OPT_IN |
Đặt giá thầu bằng chiến lược Tối đa hoá lượt chuyển đổi |
ENHANCED_CPC_OPT_IN |
Đặt giá thầu với CPC nâng cao |
SEARCH_PARTNERS_OPT_IN |
Mở rộng phạm vi tiếp cận thông qua các đối tác tìm kiếm của Google |
MAXIMIZE_CLICKS_OPT_IN |
Đặt giá thầu với chiến lược Tối đa hóa số lượt nhấp |
OPTIMIZE_AD_ROTATION |
Sử dụng chế độ xoay vòng quảng cáo được tối ưu hoá |
CALLOUT_EXTENSION (đã ngừng hoạt động) |
Không dùng nữa, thay vào đó hãy sử dụng CALLOUT_ASSET |
SITELINK_EXTENSION (đã ngừng hoạt động) |
Không dùng nữa, thay vào đó hãy sử dụng SITELINK_ASSET |
CALL_EXTENSION (đã ngừng hoạt động) |
Không dùng nữa, thay vào đó hãy sử dụng CALL_ASSET |
KEYWORD_MATCH_TYPE (đã ngừng hoạt động) |
Không dùng nữa, thay vào đó hãy sử dụng USE_BROAD_MATCH_KEYWORD |
MOVE_UNUSED_BUDGET |
Chuyển không sử dụng sang ngân sách bị ràng buộc |
TARGET_ROAS_OPT_IN |
Đặt giá thầu theo lợi tức mục tiêu trên chi tiêu quảng cáo |
FORECASTING_CAMPAIGN_BUDGET |
Khắc phục những chiến dịch dự kiến sẽ bị giới hạn theo ngân sách trong tương lai |
RESPONSIVE_SEARCH_AD |
Thêm quảng cáo tìm kiếm thích ứng mới |
MARGINAL_ROI_CAMPAIGN_BUDGET |
Điều chỉnh ngân sách chiến dịch để tăng ROI |
USE_BROAD_MATCH_KEYWORD |
Sử dụng kiểu khớp mở rộng cho những chiến dịch dựa trên lượt chuyển đổi có áp dụng tính năng đặt giá thầu tự động |
RESPONSIVE_SEARCH_AD_ASSET |
Thêm thành phần của quảng cáo tìm kiếm thích ứng vào một quảng cáo |
UPGRADE_SMART_SHOPPING_CAMPAIGN_TO_PERFORMANCE_MAX |
Nâng cấp Chiến dịch mua sắm thông minh lên Chiến dịch tối đa hoá hiệu suất |
RESPONSIVE_SEARCH_AD_IMPROVE_AD_STRENGTH |
Cải thiện độ mạnh của quảng cáo tìm kiếm thích ứng |
DISPLAY_EXPANSION_OPT_IN |
Cập nhật chiến dịch để sử dụng tính năng Mở rộng hiển thị |
UPGRADE_LOCAL_CAMPAIGN_TO_PERFORMANCE_MAX |
Nâng cấp chiến dịch địa phương cũ lên chiến dịch Tối đa hoá hiệu suất |
RAISE_TARGET_CPA_BID_TOO_LOW |
Đề xuất tăng CPA mục tiêu khi giá thầu quá thấp và có rất ít hoặc không có lượt chuyển đổi |
FORECASTING_SET_TARGET_ROAS |
Đề xuất tăng ngân sách trước sự kiện theo mùa được dự báo sẽ tăng lưu lượng truy cập và thay đổi chiến lược đặt giá thầu từ tối đa hóa giá trị chuyển đổi thành ROAS mục tiêu |
CALLOUT_ASSET |
Thêm thành phần chú thích vào cấp chiến dịch hoặc cấp khách hàng |
SITELINK_ASSET |
Thêm thành phần đường liên kết của trang web vào cấp chiến dịch hoặc cấp khách hàng |
CALL_ASSET |
Thêm thành phần cuộc gọi vào cấp chiến dịch hoặc cấp khách hàng |
Xử lý các loại không được hỗ trợ
Truy xuất đề xuất
Giống như hầu hết các thực thể khác trong API Google Ads, đối tượng Recommendation
được tìm nạp bằng cách sử dụng GoogleAdsService.SearchStream
với truy vấn Ngôn ngữ truy vấn Google Ads.
Đối với mỗi loại đề xuất, thông tin chi tiết về đề xuất sẽ được cung cấp trong một trường recommendation
cụ thể với một loại cụ thể:
Ví dụ về mã
Mã mẫu sau đây truy xuất tất cả đề xuất có sẵn và bị loại bỏ thuộc loại TEXT_AD
từ một tài khoản và in một số thông tin chi tiết của đề xuất:
Java
private void runExample(GoogleAdsClient googleAdsClient, long customerId) { try (GoogleAdsServiceClient googleAdsServiceClient = googleAdsClient.getLatestVersion().createGoogleAdsServiceClient()) { String query = "SELECT recommendation.type, " + "recommendation.campaign, " + "recommendation.text_ad_recommendation " + "FROM recommendation " + "WHERE recommendation.type = TEXT_AD"; // Creates a request that will retrieve all recommendations using pages of the // specified page size. SearchGoogleAdsRequest request = SearchGoogleAdsRequest.newBuilder() .setCustomerId(Long.toString(customerId)) .setPageSize(PAGE_SIZE) .setQuery(query) .build(); // Issues the search request. SearchPagedResponse searchPagedResponse = googleAdsServiceClient.search(request); // Iterates over all rows in all pages and prints the requested field values for the // recommendation in each row. for (GoogleAdsRow googleAdsRow : searchPagedResponse.iterateAll()) { Recommendation recommendation = googleAdsRow.getRecommendation(); Ad recommendedAd = recommendation.getTextAdRecommendation().getAd(); System.out.printf( "Recommendation ('%s') was found for campaign '%s':%n", recommendation.getResourceName(), recommendation.getCampaign()); if (recommendedAd.hasExpandedTextAd()) { ExpandedTextAdInfo eta = recommendedAd.getExpandedTextAd(); System.out.printf( "\tHeadline 1 = '%s'%n" + "\tHeadline 2 = '%s'%n" + "\tDescription = '%s'%n", eta.getHeadlinePart1(), eta.getHeadlinePart2(), eta.getDescription()); } if (recommendedAd.getDisplayUrl() != null) { System.out.printf("\tDisplay URL = '%s'%n", recommendedAd.getDisplayUrl()); } for (String url : recommendedAd.getFinalUrlsList()) { System.out.printf("\tFinal URL = '%s'%n", url); } for (String url : recommendedAd.getFinalMobileUrlsList()) { System.out.printf("\tFinal Mobile URL = '%s'%n", url); } } } }
C#
public void Run(GoogleAdsClient client, long customerId) { // Get the GoogleAdsServiceClient . GoogleAdsServiceClient service = client.GetService(Services.V13.GoogleAdsService); string query = @"SELECT recommendation.type, recommendation.campaign, recommendation.text_ad_recommendation FROM recommendation WHERE recommendation.type = TEXT_AD"; // Create a request that will retrieve all recommendations using pages of the // specified page size. SearchGoogleAdsRequest request = new SearchGoogleAdsRequest() { CustomerId = customerId.ToString(), PageSize = PAGE_SIZE, Query = query }; try { // Issue the search request. PagedEnumerable<SearchGoogleAdsResponse, GoogleAdsRow> searchPagedResponse = service.Search(customerId.ToString(), query); // Iterates over all rows in all pages and prints the requested field values // for the recommendation in each row. foreach (GoogleAdsRow googleAdsRow in searchPagedResponse) { Recommendation recommendation = googleAdsRow.Recommendation; // ... } } catch (GoogleAdsException e) { Console.WriteLine("Failure:"); Console.WriteLine($"Message: {e.Message}"); Console.WriteLine($"Failure: {e.Failure}"); Console.WriteLine($"Request ID: {e.RequestId}"); throw; } }
1.199
public static function runExample(GoogleAdsClient $googleAdsClient, int $customerId) { $googleAdsServiceClient = $googleAdsClient->getGoogleAdsServiceClient(); // Creates a query that retrieves recommendations for text ads. $query = 'SELECT recommendation.type, recommendation.campaign, ' . 'recommendation.text_ad_recommendation ' . 'FROM recommendation ' . 'WHERE recommendation.type = TEXT_AD'; // Issues a search request by specifying page size. $response = $googleAdsServiceClient->search($customerId, $query, ['pageSize' => self::PAGE_SIZE]); // Iterates over all rows in all pages and prints the requested field values for // the recommendation in each row. foreach ($response->iterateAllElements() as $googleAdsRow) { /** @var GoogleAdsRow $googleAdsRow */ $recommendation = $googleAdsRow->getRecommendation(); printf( "Recommendation with resource name '%s' was found for campaign " . "with resource name '%s':%s", $recommendation->getResourceName(), $recommendation->getCampaign(), PHP_EOL ); $recommendedAd = $recommendation->getTextAdRecommendation()->getAd(); if (!is_null($recommendedAd->getExpandedTextAd())) { $recommendedExpandedTextAd = $recommendedAd->getExpandedTextAd(); printf( "\tHeadline part 1 is '%s'.%s", $recommendedExpandedTextAd->getHeadlinePart1(), PHP_EOL ); printf( "\tHeadline part 2 is '%s'.%s", $recommendedExpandedTextAd->getHeadlinePart2(), PHP_EOL ); printf( "\tDescription is '%s'%s", $recommendedExpandedTextAd->getDescription(), PHP_EOL ); } if (!is_null($recommendedAd->getDisplayUrl())) { printf("\tDisplay URL is '%s'.%s", $recommendedAd->getDisplayUrl(), PHP_EOL); } foreach ($recommendedAd->getFinalUrls() as $finalUrl) { /** @var string $finalUrl */ printf("\tFinal URL is '%s'.%s", $finalUrl, PHP_EOL); } foreach ($recommendedAd->getFinalMobileUrls() as $finalMobileUrl) { /** @var string $finalMobileUrl */ printf("\tFinal Mobile URL is '%s'.%s", $finalMobileUrl, PHP_EOL); } } }
Python
def main(client, customer_id): ga_service = client.get_service("GoogleAdsService") query = """ SELECT recommendation.type, recommendation.campaign, recommendation.text_ad_recommendation FROM recommendation WHERE recommendation.type = TEXT_AD""" search_request = client.get_type("SearchGoogleAdsStreamRequest") search_request.customer_id = customer_id search_request.query = query stream = ga_service.search_stream(request=search_request) for batch in stream: for row in batch.results: recommendation = row.recommendation recommended_ad = recommendation.text_ad_recommendation.ad print( f'Recommendation ("{recommendation.resource_name}") ' f'was found for campaign "{recommendation.campaign}".' ) if recommended_ad.display_url: print(f'\tDisplay URL = "{recommended_ad.display_url}"') for url in recommended_ad.final_urls: print(f'\tFinal URL = "{url}"') for url in recommended_ad.final_mobile_urls: print(f'\tFinal Mobile URL = "{url}"')
Ruby
def get_text_ad_recommendations(customer_id) # GoogleAdsClient will read a config file from # ENV['HOME']/google_ads_config.rb when called without parameters client = Google::Ads::GoogleAds::GoogleAdsClient.new ga_service = client.service.google_ads query = <<~QUERY SELECT recommendation.type, recommendation.campaign, recommendation.text_ad_recommendation FROM recommendation WHERE recommendation.type = TEXT_AD QUERY response = ga_service.search( customer_id: customer_id, query: query, page_size: PAGE_SIZE, ) response.each do |row| recommendation = row.recommendation recommended_ad = recommendation.text_ad_recommendation.ad puts "Recommendation ('#{recommendation.resource_name}') was found for "\ "campaign '#{recommendation.campaign}'." if recommended_ad.expanded_text_ad eta = recommended_ad.expanded_text_ad puts "\tHeadline 1 = '#{eta.headline_part1}'\n\tHeadline2 = '#{eta.headline_part2}'\n" + "\tDescription = '#{eta.description}'" end if recommended_ad.display_url puts "\tDisplay URL = '#{recommended_ad.display_url}'" end recommended_ad.final_urls.each do |url| puts "\tFinal Url = '#{url}'" end recommended_ad.final_mobile_urls.each do |url| puts "\tFinal Mobile Url = '#{url}'" end end end
Perl
sub get_text_ad_recommendations { my ($api_client, $customer_id) = @_; # Creates the search query. my $search_query = "SELECT recommendation.type, recommendation.campaign, " . "recommendation.text_ad_recommendation " . "FROM recommendation WHERE recommendation.type = TEXT_AD"; # Create a search Google Ads request that will retrieve all recommendations for # text ads using pages of the specified page size. my $search_request = Google::Ads::GoogleAds::V13::Services::GoogleAdsService::SearchGoogleAdsRequest ->new({ customerId => $customer_id, query => $search_query, pageSize => PAGE_SIZE }); # Get the GoogleAdsService. my $google_ads_service = $api_client->GoogleAdsService(); my $iterator = Google::Ads::GoogleAds::Utils::SearchGoogleAdsIterator->new({ service => $google_ads_service, request => $search_request }); # Iterate over all rows in all pages and print the requested field values for # the recommendation in each row. while ($iterator->has_next) { my $google_ads_row = $iterator->next; my $recommendation = $google_ads_row->{recommendation}; printf "Recommendation '%s' was found for campaign '%s':\n", $recommendation->{resourceName}, $recommendation->{campaign}; my $recommended_ad = $recommendation->{textAdRecommendation}{ad}; if ($recommended_ad->{expandedTextAd}) { my $recommended_expanded_text_ad = $recommended_ad->{expandedTextAd}; printf "\tHeadline part 1 is '%s'.\n" . "\tHeadline part 2 is '%s'.\n" . "\tDescription is '%s'.\n", $recommended_expanded_text_ad->{headlinePart1}, $recommended_expanded_text_ad->{headlinePart2}, $recommended_expanded_text_ad->{description}; } if ($recommended_ad->{displayUrl}) { printf "\tDisplay URL is '%s'.\n", $recommended_ad->{displayUrl}; } foreach my $final_url (@{$recommended_ad->{finalUrls}}) { printf "\tFinal URL is '%s'.\n", $final_url; } foreach my $final_mobile_url (@{$recommended_ad->{finalMobileUrls}}) { printf "\tFinal Mobile URL is '%s'.\n", $final_mobile_url; } } return 1; }
Thao tác
Bạn có thể áp dụng hoặc loại bỏ bất kỳ đề xuất nào được truy xuất.
Tuỳ thuộc vào loại đề xuất, các đề xuất có thể thay đổi theo cơ sở
hằng ngày hoặc thậm chí nhiều lần một ngày. Khi điều đó xảy ra, resource_name
của đối tượng đề xuất có thể trở nên lỗi thời sau khi được đề xuất.
Bạn nên xử lý các đề xuất ngay sau khi truy xuất.
Áp dụng đề xuất
Tính năng đặt tài khoản để tự động áp dụng đề xuất không được hỗ trợ trong API Google Ads. Tuy nhiên, bạn có thể triển khai hành vi tương tự cho các loại đề xuất được API Google Ads hỗ trợ đầy đủ. Tham khảo ví dụ về mã DetectAndApplyRecommendations
để tìm hiểu thêm.
Bạn có thể áp dụng các đề xuất đang hoạt động hoặc bị loại bỏ bằng phương thức ApplyRecommendation
của RecommendationService
.
Các loại đề xuất có thể có thông số bắt buộc hoặc không bắt buộc. Hầu hết các đề xuất đều đi kèm với các giá trị đề xuất được sử dụng theo mặc định; hãy xem chi tiết đề xuất.
Sử dụng trường apply_parameters
của ApplyRecommendationOperation
để áp dụng nội dung đề xuất có các giá trị thông số cụ thể. Mỗi loại đề xuất phù hợp đều có trường riêng. Mọi loại đề xuất bị thiếu trong bảng sẽ không sử dụng các giá trị thông số này.
Ví dụ về mã
Ví dụ về mã sau đây minh hoạ cách áp dụng một đề xuất bằng các tham số áp dụng đề xuất:
Java
private void runExample( GoogleAdsClient googleAdsClient, long customerId, String recommendationId) { String recommendationResourceName = ResourceNames.recommendation(customerId, recommendationId); ApplyRecommendationOperation.Builder operationBuilder = ApplyRecommendationOperation.newBuilder().setResourceName(recommendationResourceName); // Each recommendation types has optional parameters to override the recommended values. // This is an example to override a recommended ad when a TextAdRecommendation is applied. // Please read // https://developers.google.com/google-ads/api/reference/rpc/latest/ApplyRecommendationOperation // for details. // Note that additional import statements are needed for this example to work. And also, please // replace INSERT_AD_ID_HERE with a valid ad ID below. // // Ad overrideAd = Ad.newBuilder().setId(Long.parseLong("INSERT_AD_ID_HERE")).build(); // operationBuilder.setTextAd(TextAdParameters.newBuilder(). // setAd(overrideAd).build()).build(); List<ApplyRecommendationOperation> operations = new ArrayList<>(); operations.add(operationBuilder.build()); try (RecommendationServiceClient recommendationServiceClient = googleAdsClient.getLatestVersion().createRecommendationServiceClient()) { ApplyRecommendationResponse response = recommendationServiceClient.applyRecommendation(Long.toString(customerId), operations); System.out.printf("Applied %d recommendation:%n", response.getResultsCount()); for (ApplyRecommendationResult result : response.getResultsList()) { System.out.println(result.getResourceName()); } } }
C#
public void Run(GoogleAdsClient client, long customerId, long recommendationId) { // Get the RecommendationServiceClient. RecommendationServiceClient service = client.GetService( Services.V13.RecommendationService); ApplyRecommendationOperation operation = new ApplyRecommendationOperation() { ResourceName = ResourceNames.Recommendation(customerId, recommendationId), // Each recommendation types has optional parameters to override the recommended // values. For example, you can override a recommended ad when a // TextAdRecommendation is applied, as shown below. // Please read https://developers.google.com/google-ads/api/reference/rpc/latest/ApplyRecommendationOperation // for details. // TextAd = new TextAdParameters() { // Ad = new Ad() { // Id = long.Parse("INSERT_AD_ID_HERE") // } // } }; try { ApplyRecommendationResponse response = service.ApplyRecommendation( customerId.ToString(), new ApplyRecommendationOperation[] { operation }); Console.WriteLine($"Applied {0} recommendation(s):", response.Results.Count); foreach (ApplyRecommendationResult result in response.Results) { Console.WriteLine($"- {result.ResourceName}"); } } catch (GoogleAdsException e) { Console.WriteLine("Failure:"); Console.WriteLine($"Message: {e.Message}"); Console.WriteLine($"Failure: {e.Failure}"); Console.WriteLine($"Request ID: {e.RequestId}"); throw; } }
1.199
public static function runExample( GoogleAdsClient $googleAdsClient, int $customerId, string $recommendationId ) { $recommendationResourceName = ResourceNames::forRecommendation($customerId, $recommendationId); $applyRecommendationOperation = new ApplyRecommendationOperation(); $applyRecommendationOperation->setResourceName($recommendationResourceName); // Each recommendation type has optional parameters to override the recommended values. // This is an example to override a recommended ad when a TextAdRecommendation is applied. // For details, please read // https://developers.google.com/google-ads/api/reference/rpc/latest/ApplyRecommendationOperation. /* $overridingAd = new Ad([ 'id' => 'INSERT_AD_ID_AS_INTEGER_HERE' ]); $applyRecommendationOperation->setTextAd(new TextAdParameters(['ad' => $overridingAd])); */ // Issues a mutate request to apply the recommendation. $recommendationServiceClient = $googleAdsClient->getRecommendationServiceClient(); $response = $recommendationServiceClient->applyRecommendation( $customerId, [$applyRecommendationOperation] ); /** @var Recommendation $appliedRecommendation */ $appliedRecommendation = $response->getResults()[0]; printf( "Applied recommendation with resource name: '%s'.%s", $appliedRecommendation->getResourceName(), PHP_EOL ); }
Python
def main(client, customer_id, recommendation_id): recommendation_service = client.get_service("RecommendationService") apply_recommendation_operation = client.get_type( "ApplyRecommendationOperation" ) apply_recommendation_operation.resource_name = recommendation_service.recommendation_path( customer_id, recommendation_id ) # This is where we override the recommended ad when a TextAdRecommendation is applied. # override_ad = client.get_type("Ad") # override_ad.resource_name = "INSERT_AD_ID_HERE" # apply_recommendation_operation.text_ad.ad = override_ad recommendation_response = recommendation_service.apply_recommendation( customer_id=customer_id, operations=[apply_recommendation_operation] ) print( "Applied recommendation with resource name: " f"'{recommendation_response.results[0].resource_name}'" )
Ruby
def apply_recommendation(customer_id, recommendation_id) # GoogleAdsClient will read a config file from # ENV['HOME']/google_ads_config.rb when called without parameters client = Google::Ads::GoogleAds::GoogleAdsClient.new recommendation_resource = client.path.recommendation(customer_id, recommendation_id) apply_recommendation_operation = client.operation.apply_recommendation apply_recommendation_operation.resource_name = recommendation_resource # Each recommendation type has optional parameters to override the recommended # values. This is an example to override a recommended ad when a # TextAdRecommendation is applied. # For details, please read # https://developers.google.com/google-ads/api/reference/rpc/google.ads.google_ads.v1.services#google.ads.google_ads.v1.services.ApplyRecommendationOperation # # text_ad_parameters = client.resource.text_ad_parameters do |tap| # tap.ad = client.resource.ad do |ad| # ad.id = "INSERT_AD_ID_AS_INTEGER_HERE" # end # end # apply_recommendation_operation.text_ad = text_ad_parameters # Issues a mutate request to apply the recommendation. recommendation_service = client.service.recommendation response = recommendation_service.apply_recommendation( customer_id: customer_id, operations: [apply_recommendation_operation], ) applied_recommendation = response.results.first puts "Applied recommendation with resource name: '#{applied_recommendation.resource_name}'." end
Perl
sub apply_recommendation { my ($api_client, $customer_id, $recommendation_id) = @_; my $recommendation_resource_name = Google::Ads::GoogleAds::V13::Utils::ResourceNames::recommendation( $customer_id, $recommendation_id); # Create an apply recommendation operation. my $apply_recommendation_operation = Google::Ads::GoogleAds::V13::Services::RecommendationService::ApplyRecommendationOperation ->new({ resourceName => $recommendation_resource_name }); # Each recommendation type has optional parameters to override the recommended values. # This is an example to override a recommended ad when a TextAdRecommendation is applied. # For details, please read # https://developers.google.com/google-ads/api/reference/rpc/latest/ApplyRecommendationOperation. # # my $overriding_ad = Google::Ads::GoogleAds::V13::Resources::Ad->new({ # id => "INSERT_AD_ID_AS_INTEGER_HERE" # }); # my $text_ad_parameters = # Google::Ads::GoogleAds::V13::Services::RecommendationService::TextAdParameters # ->new({ad => $overriding_ad}); # $apply_recommendation_operation->{textAd} = $text_ad_parameters; # Apply the recommendation. my $apply_recommendation_response = $api_client->RecommendationService()->apply({ customerId => $customer_id, operations => [$apply_recommendation_operation]}); printf "Applied recommendation with resource name: '%s'.\n", $apply_recommendation_response->{results}[0]{resourceName}; return 1; }
Xem các video này để tìm hiểu thêm
Áp dụng các thông số
Hàng loạt
Lỗi
Kiểm thử
Loại bỏ đề xuất
Bạn có thể loại bỏ các đề xuất bằng RecommendationService
. Cấu trúc mã tương tự như cách áp dụng các đề xuất, nhưng thay vào đó, bạn sử dụng DismissRecommendationOperation
và RecommendationService.DismissRecommendation
.