Hi,
I'm running searches for KeywordPlanAdGroupKeywords and seeing results even
after their KeywordPlanAdGroup / KeywordPlanCampaign / KeywordPlan have
been deleted (through API or GoogleAds UI)
Here's an example code snippet using the Ruby SDK:
require "google/ads/google_ads"
client = Google::Ads::GoogleAds::GoogleAdsClient.new("google_ads_config.rb")
LOGIN_CUSTOMER_ID =
Rails.application.credentials.gads_login_customer_id!.to_s
# "XXXXXXXXXX"
keyword_plan_ad_group_keywords_search = client.service.google_ads.search(
customer_id: LOGIN_CUSTOMER_ID,
query: "SELECT keyword_plan_ad_group_keyword.id FROM
keyword_plan_ad_group_keyword"
)
keyword_plan_ad_group_keywords_search.response.results.size
# 10000
keyword_plan_ad_group_keywords_search.response.total_results_count
# 0
keyword_plan_ad_group_keywords_with_ad_group_search =
client.service.google_ads.search(
customer_id: LOGIN_CUSTOMER_ID,
query: "SELECT keyword_plan_ad_group_keyword.id, keyword_plan_ad_group.id
FROM keyword_plan_ad_group_keyword"
)
keyword_plan_ad_group_keywords_with_ad_group_search.response.results
# []
keyword_plan_ad_group_keywords_with_ad_group_search.response.total_results_count
# 0
keyword_plan_ad_group_keyword_resource_name =
keyword_plan_ad_group_keywords_search.response.results.first.keyword_plan_ad_group_keyword.resource_name
# customers/##########/keywordPlanAdGroupKeywords/743XXXXXXXXX
client.service.keyword_plan_ad_group_keyword.mutate_keyword_plan_ad_group_keywords(
customer_id: LOGIN_CUSTOMER_ID,
operations:
[client.operation.remove_resource.keyword_plan_ad_group_keyword(keyword_plan_ad_group_keyword_resource_name)]
)
#
Google::Ads::GoogleAds::Errors::GoogleAdsError(Google::Ads::GoogleAds::Errors::GoogleAdsError):
Resource was not found.
It looks like when I add a select from a related table
(keyword_plan_ad_group.id in the above case), I get 0 results since there
is no associated keyword_plan_ad_group.
Not being able to remove the keywords is also surprising considering they
are showing up in my Searches.
Is there something I'm not understanding? Should I be expected to see these
keywords? And if so, how should I go about removing them?
Thanks!
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/adwords-api/cd0c74c3-e9a2-48dd-8ad0-f538eff183aen%40googlegroups.com.