Khi sử dụng KeywordPlanIdeaService, bạn có thể khám phá các gợi ý từ khoá có liên quan đến chiến dịch của mình trên Google Tìm kiếm hoặc truy xuất chỉ số trước đây cho một danh sách từ khoá hiện có.
Tạo ý tưởng
Tạo ý tưởng từ khoá cho một chiến dịch bằng
KeywordPlanIdeaService.GenerateKeywordIdeas.
Bạn có thể cung cấp từ khoá và URL gốc để tạo ý tưởng. Đặt các tham số nhắm mục tiêu như vị trí, ngôn ngữ và chế độ cài đặt mạng để thu hẹp phạm vi tìm kiếm. Dịch vụ này trả về số liệu thống kê trong quá khứ, chẳng hạn như dữ liệu về lượng tìm kiếm, để giúp bạn quyết định xem có nên sử dụng từ khoá trong chiến dịch của mình hay không. Đối với những người dùng đã quen thuộc với giao diện người dùng Google Ads, công cụ này tương tự như Công cụ lập kế hoạch từ khoá.
Có một số cách để bạn có thể tạo từ khoá gốc nhằm tạo ý tưởng từ khoá:
Đối với các từ hoặc cụm từ mô tả nội dung bạn đang quảng cáo, hãy sử dụng
KeywordSeed(bắt buộc phải có ít nhất 1 và tối đa 20 từ khoá). Đây có thể là một loại hình doanh nghiệp chung mà bạn đang nhắm đến, chẳng hạn như thợ sửa ống nước, hoặc một sản phẩm hay dịch vụ mà bạn cung cấp, chẳng hạn như dịch vụ thông tắc cống. Từ khoá gốc phải tuân thủ các quy định ràng buộc về ký tự và độ dài của từ khoá trên Google Ads.Đối với URL của một trang web hoặc toàn bộ trang web liên quan đến doanh nghiệp của bạn, hãy sử dụng
UrlSeed. Hạt giống URL chỉ nhắm đến một URL cụ thể. Nếu không có kết quả nào, thì tính năng tìm kiếm sẽ tự động mở rộng đến các trang thuộc cùng một miền.Đối với URL gốc, dịch vụ này không sử dụng nội dung của siêu liên kết để tạo ý tưởng từ khoá.
Đối với cả từ khoá gốc và URL gốc, hãy sử dụng
KeywordAndUrlSeed(yêu cầu từ 1 đến 20 từ khoá cùng với một URL).Việc sử dụng
KeywordAndUrlSeedcó thể tạo ra nhiều ý tưởng từ khoá hơn so với việc chỉ sử dụngUrlSeed.Đối với toàn bộ trang web, hãy dùng
SiteSeed. Khi bạn cung cấp một tên miền cấp cao nhất, chẳng hạn nhưwww.example.com, hạt giống trang web sẽ tạo tối đa 250.000 ý tưởng từ khoá từ thông tin công khai.
Để thu hẹp phạm vi nhắm mục tiêu, bạn có thể định cấu hình language,
vị trí (tối đa 10 geo_target_constants),
keyword_plan_network, include_adult_keywords,
keyword_annotation (Tinh chỉnh
từ khoá) và
historical_metrics_options.
Phản hồi hỗ trợ phân trang (tối đa 10.000 kết quả mỗi trang; luôn kiểm tra next_page_token để xác định xem có trang bổ sung hay không, vì một trang có thể trả về ít hơn page_size kết quả trước trang cuối cùng). Mỗi GenerateKeywordIdeaResult trả về text chính tắc (với close_variants), keyword_idea_metrics trước đây để lọc trước khi tạo chỉ số dự báo và keyword_annotations không bắt buộc.
Tài liệu tham khảo về trường yêu cầu và phản hồi
Gọi KeywordPlanIdeaService.GenerateKeywordIdeas tại điểm cuối sau:
POST https://googleads.googleapis.com/v26/customers/{customer_id}:generateKeywordIdeas
Bảng sau đây tóm tắt các trường và quy tắc ràng buộc đối với GenerateKeywordIdeasRequest:
| Trường yêu cầu | Yêu cầu | Định dạng và quy tắc ràng buộc |
|---|---|---|
customer_id |
Bắt buộc | Mã khách hàng gồm 10 chữ số (string) không có dấu gạch nối. |
seed (oneof) |
Bắt buộc | Chỉ định một trong các giá trị sau: • keyword_seed: keywords[] (1 đến 20 chuỗi; xem các quy tắc ràng buộc về từ khoá).• url_seed: url (URL trang cụ thể).• keyword_and_url_seed: url cộng thêm từ 1 đến 20 keywords[].• site_seed: site (tên miền, chẳng hạn như www.example.com, trả về tối đa 250.000 ý tưởng). |
language |
Không bắt buộc | Tên tài nguyên tiêu chí ngôn ngữ (ví dụ: languageConstants/{criterion_id}, languageConstants/1000 cho tiếng Anh). Xem Hằng số ngôn ngữ. Nếu bị bỏ qua, thì từ khoá ở tất cả ngôn ngữ sẽ được đưa vào. |
geo_target_constants[] |
Không bắt buộc | Tối đa 10 tên tài nguyên vị trí (geoTargetConstants/{criterion_id}, ví dụ: geoTargetConstants/2840 cho Hoa Kỳ). Xem Mục tiêu địa lý. Danh sách trống nhắm đến tất cả các khu vực địa lý. |
keyword_plan_network |
Không bắt buộc | KeywordPlanNetwork (GOOGLE_SEARCH hoặc GOOGLE_SEARCH_AND_PARTNERS). Giá trị mặc định là GOOGLE_SEARCH_AND_PARTNERS. |
include_adult_keywords |
Không bắt buộc | bool kiểm soát việc có trả về từ khoá người lớn hay không. Giá trị mặc định là false. |
keyword_annotation[] |
Không bắt buộc | Danh sách các giá trị KeywordPlanKeywordAnnotation (chẳng hạn như KEYWORD_CONCEPT) để điền keyword_annotations vào mỗi kết quả. |
aggregate_metrics |
Không bắt buộc | KeywordPlanAggregateMetrics với aggregate_metric_types được đặt thành DEVICE để trả về số lượt tìm kiếm được phân đoạn theo thiết bị trong aggregate_metric_results. |
historical_metrics_options |
Không bắt buộc | HistoricalMetricsOptions chỉ định year_month_range không bắt buộc (có sẵn trong 4 năm qua; mặc định là 12 tháng qua) và include_average_cpc. |
page_size và page_token |
Không bắt buộc | Số kết quả tối đa trên mỗi trang (int32, tối đa 10,000) và mã thông báo tiếp tục từ next_page_token. Giữ nguyên tất cả các trường yêu cầu khác trên các yêu cầu được phân trang. |
Thông báo GenerateKeywordIdeaResponse trả về các trường sau:
| Trường phản hồi | Loại | Mô tả |
|---|---|---|
results[].text |
string |
Văn bản ý tưởng từ khoá chính tắc đại diện cho đề xuất và close_variants[] kết hợp của đề xuất đó. |
results[].close_variants[] |
string[] |
Các biến thể gần giống được kết hợp vào GenerateKeywordIdeaResult này. |
results[].keyword_idea_metrics |
KeywordPlanHistoricalMetrics |
Lượng tìm kiếm: avg_monthly_searches (trung bình 12 tháng) và monthly_search_volumes[] (year, month, monthly_searches).Mức độ cạnh tranh: competition (LOW, MEDIUM, HIGH) và competition_index (0 đến 100).Giá thầu và CPC: low_top_of_page_bid_micros (phân vị thứ 20), high_top_of_page_bid_micros (phân vị thứ 80) và average_cpc_micros (được điền khi include_average_cpc = true). |
results[].keyword_annotations |
KeywordAnnotations |
Được điền sẵn khi KEYWORD_CONCEPT được yêu cầu trong keyword_annotation; chứa concepts[] (name, concept_group.name và concept_group.type). |
aggregate_metric_results |
KeywordPlanAggregateMetricResults |
Được điền sẵn khi DEVICE được yêu cầu trong aggregate_metrics; chứa device_searches[] (MOBILE, TABLET, DESKTOP). |
next_page_token và total_size |
string, int64 |
Mã thông báo tiếp tục cho trang tiếp theo (bị bỏ qua trên trang cuối cùng) và tổng số ý tưởng từ khoá có sẵn. |
Ví dụ về mã
Java
private void runExample( GoogleAdsClient googleAdsClient, long customerId, long languageId, List<Long> locationIds, List<String> keywords, @Nullable String pageUrl) { try (KeywordPlanIdeaServiceClient keywordPlanServiceClient = googleAdsClient.getLatestVersion().createKeywordPlanIdeaServiceClient()) { GenerateKeywordIdeasRequest.Builder requestBuilder = GenerateKeywordIdeasRequest.newBuilder() .setCustomerId(Long.toString(customerId)) // Sets the language resource using the provided language ID. .setLanguage(ResourceNames.languageConstant(languageId)) // Sets the network. To restrict to only Google Search, change the parameter below to // KeywordPlanNetwork.GOOGLE_SEARCH. .setKeywordPlanNetwork(KeywordPlanNetwork.GOOGLE_SEARCH_AND_PARTNERS); // Adds the resource name of each location ID to the request. for (Long locationId : locationIds) { requestBuilder.addGeoTargetConstants(ResourceNames.geoTargetConstant(locationId)); } // Makes sure that keywords and/or page URL were specified. The request must have exactly one // of urlSeed, keywordSeed, or keywordAndUrlSeed set. if (keywords.isEmpty() && pageUrl == null) { throw new IllegalArgumentException( "At least one of keywords or page URL is required, but neither was specified."); } if (keywords.isEmpty()) { // Only page URL was specified, so use a UrlSeed. requestBuilder.getUrlSeedBuilder().setUrl(pageUrl); } else if (pageUrl == null) { // Only keywords were specified, so use a KeywordSeed. requestBuilder.getKeywordSeedBuilder().addAllKeywords(keywords); } else { // Both page URL and keywords were specified, so use a KeywordAndUrlSeed. requestBuilder.getKeywordAndUrlSeedBuilder().setUrl(pageUrl).addAllKeywords(keywords); } // Sends the keyword ideas request. GenerateKeywordIdeasPagedResponse response = keywordPlanServiceClient.generateKeywordIdeas(requestBuilder.build()); // Prints each result in the response. for (GenerateKeywordIdeaResult result : response.iterateAll()) { System.out.printf( "Keyword idea text '%s' has %d average monthly searches and '%s' competition.%n", result.getText(), result.getKeywordIdeaMetrics().getAvgMonthlySearches(), result.getKeywordIdeaMetrics().getCompetition()); } } }
C#
public void Run(GoogleAdsClient client, long customerId, long[] locationIds, long languageId, string[] keywordTexts, string pageUrl) { KeywordPlanIdeaServiceClient keywordPlanIdeaService = client.GetService(Services.V26.KeywordPlanIdeaService); // Make sure that keywords and/or page URL were specified. The request must have // exactly one of urlSeed, keywordSeed, or keywordAndUrlSeed set. if (keywordTexts.Length == 0 && string.IsNullOrEmpty(pageUrl)) { throw new ArgumentException("At least one of keywords or page URL is required, " + "but neither was specified."); } // Specify the optional arguments of the request as a keywordSeed, UrlSeed, // or KeywordAndUrlSeed. GenerateKeywordIdeasRequest request = new GenerateKeywordIdeasRequest() { CustomerId = customerId.ToString(), }; if (keywordTexts.Length == 0) { // Only page URL was specified, so use a UrlSeed. request.UrlSeed = new UrlSeed() { Url = pageUrl }; } else if (string.IsNullOrEmpty(pageUrl)) { // Only keywords were specified, so use a KeywordSeed. request.KeywordSeed = new KeywordSeed(); request.KeywordSeed.Keywords.AddRange(keywordTexts); } else { // Both page URL and keywords were specified, so use a KeywordAndUrlSeed. request.KeywordAndUrlSeed = new KeywordAndUrlSeed(); request.KeywordAndUrlSeed.Url = pageUrl; request.KeywordAndUrlSeed.Keywords.AddRange(keywordTexts); } // Create a list of geo target constants based on the resource name of specified // location IDs. foreach (long locationId in locationIds) { request.GeoTargetConstants.Add(ResourceNames.GeoTargetConstant(locationId)); } request.Language = ResourceNames.LanguageConstant(languageId); // Set the network. To restrict to only Google Search, change the parameter below to // KeywordPlanNetwork.GoogleSearch. request.KeywordPlanNetwork = KeywordPlanNetwork.GoogleSearchAndPartners; try { // Generate keyword ideas based on the specified parameters. var response = keywordPlanIdeaService.GenerateKeywordIdeas(request); // Iterate over the results and print its detail. foreach (GenerateKeywordIdeaResult result in response) { KeywordPlanHistoricalMetrics metrics = result.KeywordIdeaMetrics; Console.WriteLine($"Keyword idea text '{result.Text}' has " + $"{metrics.AvgMonthlySearches} average monthly searches and competition " + $"is {metrics.Competition}."); } } catch (GoogleAdsException e) { Console.WriteLine("Failure:"); Console.WriteLine($"Message: {e.Message}"); Console.WriteLine($"Failure: {e.Failure}"); Console.WriteLine($"Request ID: {e.RequestId}"); throw; } }
PHP
public static function runExample( GoogleAdsClient $googleAdsClient, int $customerId, array $locationIds, int $languageId, array $keywords, ?string $pageUrl ) { $keywordPlanIdeaServiceClient = $googleAdsClient->getKeywordPlanIdeaServiceClient(); // Make sure that keywords and/or page URL were specified. The request must have exactly one // of urlSeed, keywordSeed, or keywordAndUrlSeed set. if (empty($keywords) && is_null($pageUrl)) { throw new \InvalidArgumentException( 'At least one of keywords or page URL is required, but neither was specified.' ); } // Specify the optional arguments of the request as a keywordSeed, urlSeed, // or keywordAndUrlSeed. $requestOptionalArgs = []; if (empty($keywords)) { // Only page URL was specified, so use a UrlSeed. $requestOptionalArgs['url_seed'] = new UrlSeed(['url' => $pageUrl]); } elseif (is_null($pageUrl)) { // Only keywords were specified, so use a KeywordSeed. $requestOptionalArgs['keyword_seed'] = new KeywordSeed(['keywords' => $keywords]); } else { // Both page URL and keywords were specified, so use a KeywordAndUrlSeed. $requestOptionalArgs['keyword_and_url_seed'] = new KeywordAndUrlSeed(['url' => $pageUrl, 'keywords' => $keywords]); } // Create a list of geo target constants based on the resource name of specified location // IDs. $geoTargetConstants = array_map(function ($locationId) { return ResourceNames::forGeoTargetConstant($locationId); }, $locationIds); // Generate keyword ideas based on the specified parameters. $response = $keywordPlanIdeaServiceClient->generateKeywordIdeas( new GenerateKeywordIdeasRequest([ // Set the language resource using the provided language ID. 'language' => ResourceNames::forLanguageConstant($languageId), 'customer_id' => $customerId, // Add the resource name of each location ID to the request. 'geo_target_constants' => $geoTargetConstants, // Set the network. To restrict to only Google Search, change the parameter below to // KeywordPlanNetwork::GOOGLE_SEARCH. 'keyword_plan_network' => KeywordPlanNetwork::GOOGLE_SEARCH_AND_PARTNERS ] + $requestOptionalArgs) ); // Iterate over the results and print its detail. foreach ($response->iterateAllElements() as $result) { /** @var GenerateKeywordIdeaResult $result */ // Note that the competition printed below is enum value. // For example, a value of 2 will be returned when the competition is 'LOW'. // A mapping of enum names to values can be found at KeywordPlanCompetitionLevel.php. printf( "Keyword idea text '%s' has %d average monthly searches and competition as %d.%s", $result->getText(), is_null($result->getKeywordIdeaMetrics()) ? 0 : $result->getKeywordIdeaMetrics()->getAvgMonthlySearches(), is_null($result->getKeywordIdeaMetrics()) ? 0 : $result->getKeywordIdeaMetrics()->getCompetition(), PHP_EOL ); } }
Python
def main( client: GoogleAdsClient, customer_id: str, location_ids: list[str], language_id: str, keyword_texts: list[str], page_url: str, ): keyword_plan_idea_service: KeywordPlanIdeaServiceClient = ( client.get_service("KeywordPlanIdeaService") ) keyword_competition_level_enum: KeywordPlanCompetitionLevelEnum = ( client.enums.KeywordPlanCompetitionLevelEnum ) keyword_plan_network: KeywordPlanNetworkEnum = ( client.enums.KeywordPlanNetworkEnum.GOOGLE_SEARCH_AND_PARTNERS ) location_rns: list[str] = map_locations_ids_to_resource_names( client, location_ids ) google_ads_service: GoogleAdsServiceClient = client.get_service( "GoogleAdsService" ) language_rn: str = google_ads_service.language_constant_path(language_id) # Either keywords or a page_url are required to generate keyword ideas # so this raises an error if neither are provided. if not (keyword_texts or page_url): raise ValueError( "At least one of keywords or page URL is required, " "but neither was specified." ) # Only one of the fields "url_seed", "keyword_seed", or # "keyword_and_url_seed" can be set on the request, depending on whether # keywords, a page_url or both were passed to this function. request: GenerateKeywordIdeasRequest = client.get_type( "GenerateKeywordIdeasRequest" ) request.customer_id = customer_id request.language = language_rn request.geo_target_constants = location_rns request.include_adult_keywords = False request.keyword_plan_network = keyword_plan_network # To generate keyword ideas with only a page_url and no keywords we need # to initialize a UrlSeed object with the page_url as the "url" field. if not keyword_texts and page_url: request.url_seed.url = page_url # To generate keyword ideas with only a list of keywords and no page_url # we need to initialize a KeywordSeed object and set the "keywords" field # to be a list of StringValue objects. if keyword_texts and not page_url: request.keyword_seed.keywords.extend(keyword_texts) # To generate keyword ideas using both a list of keywords and a page_url we # need to initialize a KeywordAndUrlSeed object, setting both the "url" and # "keywords" fields. if keyword_texts and page_url: request.keyword_and_url_seed.url = page_url request.keyword_and_url_seed.keywords.extend(keyword_texts) keyword_ideas = keyword_plan_idea_service.generate_keyword_ideas( request=request ) idea: GenerateKeywordIdeaResult for idea in keyword_ideas: competition_value = idea.keyword_idea_metrics.competition.name print( f'Keyword idea text "{idea.text}" has ' f'"{idea.keyword_idea_metrics.avg_monthly_searches}" ' f'average monthly searches and "{competition_value}" ' "competition.\n" )
Ruby
def generate_keyword_ideas(customer_id, location_ids, language_id, keywords, page_url) # GoogleAdsClient will read a config file from # ENV['HOME']/google_ads_config.rb when called without parameters client = Google::Ads::GoogleAds::GoogleAdsClient.new # Make sure that keywords and/or page URL were specified. The request must # have exactly one of urlSeed, keywordSeed, or keywordAndUrlSeed set. if keywords.reject {|k| k.nil?}.empty? && page_url.nil? raise "At least one of keywords or page URL is required." end kp_idea_service = client.service.keyword_plan_idea options_hash = if keywords.empty? seed = client.resource.url_seed do |seed| seed.url = page_url end {url_seed: seed} elsif page_url.nil? seed = client.resource.keyword_seed do |seed| keywords.each do |keyword| seed.keywords << keyword end end {keyword_seed: seed} else seed = client.resource.keyword_and_url_seed do |seed| seed.url = page_url keywords.each do |keyword| seed.keywords << keyword end end {keyword_and_url_seed: seed} end geo_target_constants = location_ids.map do |location_id| client.path.geo_target_constant(location_id) end include_adult_keywords = true response = kp_idea_service.generate_keyword_ideas( customer_id: customer_id, language: client.path.language_constant(language_id), geo_target_constants: geo_target_constants, include_adult_keywords: include_adult_keywords, # To restrict to only Google Search, change the parameter below to # :GOOGLE_SEARCH keyword_plan_network: :GOOGLE_SEARCH_AND_PARTNERS, **options_hash ) response.each do |result| monthly_searches = if result.keyword_idea_metrics.nil? 0 else result.keyword_idea_metrics.avg_monthly_searches end competition = if result.keyword_idea_metrics.nil? :UNSPECIFIED else result.keyword_idea_metrics.competition end puts "Keyword idea text #{result.text} has #{monthly_searches} average " + "monthly searches and competition as #{competition}." end end
Perl
sub generate_keyword_ideas { my ( $api_client, $customer_id, $location_ids, $language_id, $keyword_texts, $page_url ) = @_; # Make sure that keywords and/or page URL were specified. The request must have # exactly one of urlSeed, keywordSeed, or keywordAndUrlSeed set. if (not scalar @$keyword_texts and not $page_url) { die "At least one of keywords or page URL is required, " . "but neither was specified."; } # Specify the optional arguments of the request as a keywordSeed, urlSeed, # or keywordAndUrlSeed. my $request_option_args = {}; if (!scalar @$keyword_texts) { # Only page URL was specified, so use a UrlSeed. $request_option_args->{urlSeed} = Google::Ads::GoogleAds::V26::Services::KeywordPlanIdeaService::UrlSeed-> new({ url => $page_url }); } elsif (not $page_url) { # Only keywords were specified, so use a KeywordSeed. $request_option_args->{keywordSeed} = Google::Ads::GoogleAds::V26::Services::KeywordPlanIdeaService::KeywordSeed ->new({ keywords => $keyword_texts }); } else { # Both page URL and keywords were specified, so use a KeywordAndUrlSeed. $request_option_args->{keywordAndUrlSeed} = Google::Ads::GoogleAds::V26::Services::KeywordPlanIdeaService::KeywordAndUrlSeed ->new({ url => $page_url, keywords => $keyword_texts }); } # Create a list of geo target constants based on the resource name of specified # location IDs. my $geo_target_constants = [ map ( Google::Ads::GoogleAds::V26::Utils::ResourceNames::geo_target_constant( $_), @$location_ids)]; # Generate keyword ideas based on the specified parameters. my $keyword_ideas_response = $api_client->KeywordPlanIdeaService()->generate_keyword_ideas({ customerId => $customer_id, # Set the language resource using the provided language ID. language => Google::Ads::GoogleAds::V26::Utils::ResourceNames::language_constant( $language_id), # Add the resource name of each location ID to the request. geoTargetConstants => $geo_target_constants, # Set the network. To restrict to only Google Search, change the parameter below # to GOOGLE_SEARCH. keywordPlanNetwork => GOOGLE_SEARCH_AND_PARTNERS, %$request_option_args }); # Iterate over the results and print its detail. foreach my $result (@{$keyword_ideas_response->{results}}) { printf "Keyword idea text '%s' has %d average monthly searches " . "and '%s' competition.\n", $result->{text}, $result->{keywordIdeaMetrics}{avgMonthlySearches} ? $result->{keywordIdeaMetrics}{avgMonthlySearches} : 0, $result->{keywordIdeaMetrics}{competition} ? $result->{keywordIdeaMetrics}{competition} : "undef"; } return 1; }
curl
# This code example generates keyword ideas. # # Variables: # API_VERSION, # CUSTOMER_ID, # MANAGER_CUSTOMER_ID, # OAUTH2_ACCESS_TOKEN: # See https://developers.google.com/google-ads/api/rest/auth#request_headers # for details. # # LANGUAGE: The resource name of the language to target. This is in the format # of "languageConstants/{criterion_id}". See # https://developers.google.com/google-ads/api/data/codes-formats#languages # for the available criterion_id values. # GEO_TARGET_CONSTANT: The resource name of the geo target constant to # generate keyword ideas for. This is in the format of # "geoTargetConstants/{criterion_id}". See # https://developers.google.com/google-ads/api/data/geotargets for the # available criterion_id values. # KEYWORD: The keyword to generate keyword ideas for. # URL: The URL of the website to generate keyword ideas for. curl -f --request POST \ "https://googleads.googleapis.com/v${API_VERSION}/customers/${CUSTOMER_ID}:generateKeywordIdeas" \ --header "Content-Type: application/json" \ --header "login-customer-id: ${MANAGER_CUSTOMER_ID}" \ --header "Authorization: Bearer ${OAUTH2_ACCESS_TOKEN}" \ --data @- <<EOF { "language": "${LANGUAGE}", "geoTargetConstants": [ "${GEO_TARGET_CONSTANT}" ], "includeAdultKeywords": false, "keywordPlanNetwork": "GOOGLE_SEARCH", "keywordAndUrlSeed": { "keywords": [ "${KEYWORD}" ], "url": "${URL}" } } EOF
Cấu trúc yêu cầu và phản hồi REST
Ví dụ sau đây gửi một yêu cầu POST đến KeywordPlanIdeaService.GenerateKeywordIdeas bằng cách sử dụng keywordAndUrlSeed, tiếng Anh (languageConstants/1000) và Hoa Kỳ (geoTargetConstants/2840):
POST https://googleads.googleapis.com/v26/customers/{customer_id}:generateKeywordIdeas
{
"language": "languageConstants/1000",
"geoTargetConstants": [
"geoTargetConstants/2840"
],
"includeAdultKeywords": false,
"keywordPlanNetwork": "GOOGLE_SEARCH",
"keywordAnnotation": [
"KEYWORD_CONCEPT"
],
"keywordAndUrlSeed": {
"url": "https://www.example.com/mars-cruises",
"keywords": [
"mars cruise",
"space vacation"
]
}
}
Phản hồi thành công sẽ trả về các hàng GenerateKeywordIdeaResult trong results[] cùng với lượng tìm kiếm trước đây và phạm vi giá thầu:
{
"results": [
{
"text": "mars cruise",
"keywordIdeaMetrics": {
"avgMonthlySearches": "12100",
"competition": "MEDIUM",
"competitionIndex": "54",
"lowTopOfPageBidMicros": "1450000",
"highTopOfPageBidMicros": "4800000",
"monthlySearchVolumes": [
{
"year": "2026",
"month": "MAY",
"monthlySearches": "14800"
}
]
},
"keywordAnnotations": {
"concepts": [
{
"name": "Space Travel",
"conceptGroup": {
"name": "Travel",
"type": "OTHERS"
}
}
]
}
}
],
"totalSize": "1"
}
Ánh xạ tới giao diện người dùng
Bảng sau đây liên kết các tham số KeywordPlanIdeaService.GenerateKeywordIdeas với Công cụ lập kế hoạch từ khoá trong giao diện người dùng Google Ads:
| Công cụ lập kế hoạch từ khoá trong giao diện người dùng | API Google Ads |
|---|---|
| Nhập từ khoá và URL | |
| Vị trí | GenerateKeywordIdeasRequest.geo_target_constants |
| Từ khoá người lớn | GenerateKeywordIdeasRequest.include_adult_keywords |
| Ngôn ngữ | GenerateKeywordIdeasRequest.language |
| Mạng tìm kiếm | GenerateKeywordIdeasRequest.keyword_plan_network |
| Tinh chỉnh từ khóa | GenerateKeywordIdeasRequest.keyword_annotation |
| Phạm vi ngày | GenerateKeywordIdeasRequest.historical_metrics_options |
| Kết quả: Từ khoá | GenerateKeywordIdeaResult.text |
| Kết quả: Chỉ số | GenerateKeywordIdeaResult.keyword_idea_metrics |