0
votes

I'm developing integration with Google Ads API using their Ruby gem library. I have an approved oAuth2 account for the Ads scope with an approved developer token that allows any external user to connect with our API.

I have a Google Ads account that manages our own Ads account and two other accounts. When I authenticate with the API and approve it, I then grab the account with

graph = get_accounts_graph()
Apps::GoogleAds::Account.get_accounts_map(graph)

This surprisingly returns just ONE Ads account, and one that belongs to a client that we manage. Our own two Ads accounts are missing.

So I tried to compare between our client's account and our own. Under https://ads.google.com/aw/accountaccess I can clearly see we have admin rights to our two ad accounts, just like we do to the client account.

Am I missing some setting somewhere? Has anyone experienced this before?

1

1 Answers

0
votes

I ran into this issue at the beginning. The sample in the API client libraries (which I'm going to assume you are using here), calls the customer service

customer_service.list_accessible_customers()

There's actually two different services for retrieving customer account IDs. The customer service only allows access to accounts that are added as direct admins on each account. This is an important distinction as manager accounts don't fall into this category.

What you need to call is the regular GoogleAdsService (not the customer service!) and put your request in the query itself..

query = "SELECT customer_client_link.client_customer FROM customer_client_link"

This will give you a list of account IDs as resource names, not accessible accounts. And you can iterate over them as usual.

Hope that helps.