PHP Google Ads - How to get descriptive_name for customer_client?

85 views
Skip to first unread message

Andry Khmelik

unread,
Mar 15, 2019, 6:55:13 AM3/15/19
to AdWords API and Google Ads API Forum
Hi, AdWords API Team.

My MCC account has 2000 CustomerClients and I'm trying to get all CustomerClients items  for mmc account customer using 

$query = 'SELECT customer_client.resource_name,
                customer_client.client_customer,
                customer_client.level, customer_client.hidden,
                customer_client.level
                FROM customer_client';
QUERY, but customer_client schema doesn't contain descriptive_name field (like in customer table).  do you know how to get all descriptive_names for customer clients?



Also I used this interface, but it returns only one row (loginCustomerId);

$oAuth2Credential = (new OAuth2TokenBuilder())
->fromFile('google_ads_php.ini')
->build();
$googleAdsClient = (new GoogleAdsClientBuilder())
->fromFile('google_ads_php.ini')
->withOAuth2Credential($oAuth2Credential)
->build();
$googleAdsServiceClient = $googleAdsClient->getGoogleAdsServiceClient();

$res = $googleAdsServiceClient->search(loginCustomerId, 'SELECT customer.descriptive_name FROM customer');


Thanks

googleadsapi...@google.com

unread,
Mar 15, 2019, 3:51:20 PM3/15/19
to ankh...@gmail.com, AdWords API and Google Ads API Forum
Hi Andry,

Unfortunately, this is not obtainable since if you use descriptive_name from the customer_client level, since you'll get the manager account's name for each row. You can, however, use the customer_client.client_customer field, you can get their account Ids.

Our team is aware of this issue. Please follow our blog for any updates.

Regards,
Anthony
Google Ads API Team


=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
    http://googleadsdeveloper.blogspot.com/search/label/adwords_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/13e8b1ae-c99d-4057-b428-e41326e61648%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

cv

unread,
Mar 16, 2019, 3:29:49 AM3/16/19
to AdWords API and Google Ads API Forum
Hi,

This is big issue.

We have around 300 account under MCC but API using listAccesibleAccounts only returns few and that too randomly.
How one can view all of those account to select one from many?


Thanks

googleadsapi...@google.com

unread,
Mar 18, 2019, 11:55:56 AM3/18/19
to chirag....@gmail.com, AdWords API and Google Ads API Forum
Hello,

Our team is aware of the issue and is working on resolving this. I will let you know when there is a fix.

As for now, instead of using listAccesibleAccounts, you can use a GAQL for a customer_client and select the customer.id to get the accounts under your MCC. 

Regards,
Anthony
Google Ads API Team


=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
    http://googleadsdeveloper.blogspot.com/search/label/adwords_api
    https://developers.google.com/adwords/api/community/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

Reply all
Reply to author
Forward
0 new messages