Different output between Google Ads Keyword Planner and Google Ads API KeywordPlanIdeaService

77 views
Skip to first unread message

Michael Diamantopoulos

unread,
Apr 28, 2023, 10:14:18 AM4/28/23
to Google Ads API and AdWords API Forum
Hello,

Is there an argument in the KeywordPlanIdeaService similar to the "Use the entire site" in the Keywords Planner UI? The results I am getting from KeywordPlanIdeaService are similar to the Keywords Planner UI only if the "Use only this page" option is selected

Thanks a lot in advance
Screenshot_2.png

Google Ads API Forum Advisor

unread,
Apr 28, 2023, 1:47:47 PM4/28/23
to mic...@coretas.ai, adwor...@googlegroups.com

Hello Michael,

Thank you for raising your concern to us.

Can you please confirm if this guide about Keywords Ideas https://developers.google.com/google-ads/api/docs/keyword-planning/generate-keyword-ideas is what you are looking for?

Within the said guide, it mentioned the following:

  • For the URL of a webpage or entire website related to your business, use UrlSeed. The URL seed targets only a specific URL. If there are no hits, the search automatically expands up to the pages from the same domain.
  • For an entire site, use SiteSeed. Given a top-level domain name, such as www.example.com, the site seed generates up to 250,000 keyword ideas from publicly available information.

Let me know if you have any questions.

Regards,

Google Logo Google Ads API Team


ref:_00D1U1174p._5004Q2l8Cdk:ref

Michael Diamantopoulos

unread,
Apr 29, 2023, 4:11:58 AM4/29/23
to Google Ads API and AdWords API Forum
Thank you for your response, that must be it, but unfortunately there is no detailed documentation on how to use SiteSeed in your site https://developers.google.com/google-ads/api/reference/rpc/v13/SiteSeed. In Python I have used the code below:

def main(
    client, customer_id, location_ids, language_id, keyword_texts, page_url
):
    keyword_plan_idea_service
= client.get_service("KeywordPlanIdeaService")
    keyword_competition_level_enum
= (
        client
.enums.KeywordPlanCompetitionLevelEnum
   
)
    keyword_plan_network
= (
        client
.enums.KeywordPlanNetworkEnum.GOOGLE_SEARCH_AND_PARTNERS
   
)
    location_rns
= map_locations_ids_to_resource_names(client, location_ids)
    language_rn
= client.get_service("GoogleAdsService").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
= 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
   
)

   
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"
       
)
generate_keyword_ideas.py

But how can I replace the urlseed functionality with siteseed?

Google Ads API Forum Advisor

unread,
May 2, 2023, 3:08:16 PM5/2/23
to mic...@coretas.ai, adwor...@googlegroups.com

Hi Michael,

Thanks for getting back with us.

I can see that this problem is already raised in another thread with the email subject of “Difference in results between KeywordPlanIdeaService and Keyword Planner”. Please continue discussion only in that thread instead for better tracking of the issue. 

With regards to your concern, we already responded with a solution. You may refer to that thread for the answers to your concerns. 

Regards,

Reply all
Reply to author
Forward
0 new messages