How to ignore cancelled accounts (Google Ads API)

131 views
Skip to first unread message

Alex Mmz

unread,
Apr 1, 2019, 12:06:55 PM4/1/19
to AdWords API and Google Ads API Forum
Hi, in the new google ads API (v1) I am successfully fetching the account trees associated with a refresh token in the following way:

1) Get the customer resource names of the root accounts using the CustomerService's ListAccessibleCustomers method.
2) Recursively query the customer_client_link view to get all the children resource names with the following query

SELECT
customer_client_link.status
customer_client_link.client_customer
FROM
customer_client_link
WHERE
customer_client_link.status = 'ACTIVE'

It works fine but I also get cancelled accounts back. How can those be ignored? I tried with the customer_client_link.hidden = FALSE filter too but that didn't work (as it shouldn't since that's a different property), however there isn't a related customer state property to filter on.

In comparison, the adwords api's ManagedCustomerService get method ignores cancelled accounts by default.

googleadsapi...@google.com

unread,
Apr 1, 2019, 5:33:48 PM4/1/19
to alma...@gmail.com, AdWords API and Google Ads API Forum
Hi Alex,

You can use the field CustomerClient.hidden to filter hidden accounts. The customer_client_link.status will give you the status of the link between accounts, not the status of the account. 

Thanks,
Anthony
Google Ads API Team


=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
    https://ads-developers.googleblog.com/search/label/google_ads_api
    https://developers.google.com/adwords/api/community/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 adwor...@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscribe@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 "AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adwords-api+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/7dbdf6f0-c64b-49d3-86b2-0f5593a29620%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Alex Mmz

unread,
Apr 2, 2019, 3:49:49 AM4/2/19
to AdWords API and Google Ads API Forum

Capture.PNG

Thanks Anthony, this works for hidden accounts but not for cancelled ones. Seeing that there isn't a property for that in CustomerClient, is there another approach?

googleadsapi...@google.com

unread,
Apr 2, 2019, 10:30:46 AM4/2/19
to alma...@gmail.com, AdWords API and Google Ads API Forum
Hi Alex,

You won't be able to filter these accounts. I created a feature request on your behalf and passed it to the team.

Any updates or announcements can be found on our blog.

Regards,
Anthony
Google Ads API Team


=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
    https://ads-developers.googleblog.com/search/label/google_ads_api
    https://developers.google.com/adwords/api/community/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

Reply all
Reply to author
Forward
0 new messages