Re: different output between google ads keyword planner and google ads api keywordplanideaservice

2023-04-29 Thread Michael Diamantopoulos
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?

On Friday, 28 April 2023 at 20:47:47 UTC+3 Google Ads API Forum Advisor 
wrote:

> 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,
> [image: Google Logo] Google Ads API Team 
>
> ref:_00D1U1174p._5004Q2l8Cdk:ref
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Google Ads API and AdWords API Forum" group.
To unsubscribe from this group and stop r

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

2023-04-28 Thread Michael Diamantopoulos
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

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Google Ads API and AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/477361ab-884f-42f9-893a-5f4d8592db45n%40googlegroups.com.