KeywordPlanAdGroupKeywords with deleted / removed parents still show up in search

52 views
Skip to first unread message

Ben Dillinger

unread,
Mar 23, 2022, 11:48:24 AM3/23/22
to Google Ads API and AdWords API Forum
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!

Google Ads API Forum Advisor

unread,
Mar 24, 2022, 5:45:47 AM3/24/22
to b...@mushilabs.com, adwor...@googlegroups.com
Hi Ben,

Thank you for reaching out to the Google Ads API support team.

With regards to your concern, you’ve encountered RESOURCE_NOT_FOUND error, this means that the requested resource is not found.

For our team to better check it, could you please provide to us privately the complete API logs (request and response with request-id ) so our team can try and replicate the report and issue you are encountering?

You may then send the requested information via the Reply privately to author option. If this option is not available, you may send the details directly to our googleadsa...@google.com alias instead.

Best regards,
Google Logo
Heidi
Google Ads API Team
 


ref:_00D1U1174p._5004Q2YqjfP:ref

Rutger Heijmerikx

unread,
Mar 24, 2022, 2:23:17 PM3/24/22
to Google Ads API and AdWords API Forum
I'm really curious about a potential answer here. I have lots of keywordPlanAdGroupKeywords as well, where all parents have been deleted showing up. And removing them through mutate results in RESOURCE_NOT_FOUND errors.
If I delete keywordPlanAdGroupKeywords prior to removing parents, it seems to work ok. But since that isn't the case for a lot of keywordPlanAdGroupKeywords I can't remove them.

Google Ads API Forum Advisor

unread,
Mar 25, 2022, 11:03:28 AM3/25/22
to rut...@thedutchlab.com, adwor...@googlegroups.com

Hi Rutger,

Thanks for commenting on this thread.

Could you provide us with the complete request and response logs with the request-id, so our team can better check?

For the client library, logging can be enabled by navigating to the Client libraries > Your client library (ex Java) > Logging documentation, which you can access from this link. You may then send the requested information via the Reply privately to author option. If this option is not available, you may send the details directly to our googleadsa...@google.com alias instead.

Regards,

Google Logo
Yasar
Google Ads API Team
 


ref:_00D1U1174p._5004Q2YqjfP:ref
Reply all
Reply to author
Forward
0 new messages