How to get Cancelled Accounts via Google Ads API?
Using Google Ads API "Get Account Hierarchy" to get all accounts. https://developers.google.com/google-ads/api/docs/account-management/get-account-hierarchy?hl=en
Found out that canceled accounts are not being retrieved.
I do see the canceled accounts are being reported in the UI and in their Google Data Studio connector. I guess both use the old AdWords API.
Is there a way to fetch and report canceled accounts via Google Ads API? Is it recommended to use the old AdWords API?
Google Ads team answered: Unfortunately, cancelled accounts will not be returned in either of the APIs. For more information, you may refer to this blog post (https://ads-developers.googleblog.com/2018/03/changes-to-inactive-adwords-accounts.html). I hope this helps.
There is no direct way to get a list of cancelled accounts yet, fortunately, there is a way to retrieve the list in three steps (according to the docs):
Retrieve the list of ACTIVE links using the customer_client_link resource and make a list of customers using the customer_client_link.client_customer field.
SELECT customer_client_link.client_customer, customer_client_link.status FROM customer_client_link WHERE customer_client_link.status = ACTIVERetrieve the list of ENABLED accounts using the customer_client resource.
SELECT customer_client.id, customer_client.descriptive_name FROM customer_clientThe difference between the two lists gives you the list of cancelled accounts.