How to get non-manager Customers using the Google Ads Service?

228 views
Skip to first unread message

OC

unread,
Jul 20, 2021, 5:23:20 AM7/20/21
to AdWords API and Google Ads API Forum
Hi,

Searching for CustomerClients using the Google Ads Service is straight forward - I set the Login Customer Id as customerId in the search request and the query which reads from customer_client.

What I would like to do is get the Customer object instead of CustomerClient objects, as the update (mutate) can be performed only on Customer objects.

When I try to use the Google Ads Service in the similar way as for CustomerClients, but reading from Customer resource instead, I get no results, as the only possible result is the Manager Customer, i.e. the one set as customerId in the request.

Is there a way to search for multiple Customers using the Google Ads Service?

Otherwise, I have to search for CustomerClients and if I want to update some of them, I have to use the Customer Service to first read one by one Customer.

Maybe I'm doing something wrong?

Thanks!

Google Ads API Forum Advisor

unread,
Jul 21, 2021, 3:19:57 AM7/21/21
to osib.cvj...@cloudsense.com, adwor...@googlegroups.com
Hi,

Thanks for posting your concern.

Please note that MutateCustomer can only update one customer at a time, with this, I am afraid that updating multiple client accounts that you are looking for is not possible. With this, the provided process that you've mentioned is the current possible way to update customers under a MCC account account.

Let me know if you have further questions.

Regards,
Google Logo
Ernie John Blanca Tacata
Google Ads API Team
 


ref:_00D1U1174p._5004Q2JC7dj:ref

OC

unread,
Jul 21, 2021, 3:42:39 AM7/21/21
to AdWords API and Google Ads API Forum
Hi Ernie,

Thanks for the response.

I understand that MutateCustomer can only update one customer at a time, but my question was if it is possible to search for multiple Customers (instead of CustomerClients).

Example 1:
      SearchGoogleAdsStreamRequest request1 =
              SearchGoogleAdsStreamRequest.newBuilder()
                  .setCustomerId("manager-customer-id")
                  .setQuery(
                      "SELECT customer_client.descriptive_name WHERE customer_client.id IN (1, 2, 3)")
                  .build();

This query will return the CustomerClient objects which have the provided IDs.

Example 2:
      SearchGoogleAdsStreamRequest request2 =
              SearchGoogleAdsStreamRequest.newBuilder()
                  .setCustomerId("manager-customer-id")
                  .setQuery(
                      "SELECT customer.descriptive_name FROM customer WHERE customer.id.id IN (1, 2, 3)")
                  .build();

This query will not return any results, as the only Customer object available when searching in this way is the Manager Customer itself.

So, my problem is, if I want to pull multiple Customers I have to pull the CustomerClient objects instead of Customer objects. And later on, if I want to update some of the CustomerClient objects I first have to pull single corresponding Customer object, because it is not possible to update CustomerClient directly.

Is it somehow possible to use the CustomerClient object to update the Customer object, or is it necessary to pull the related Customer first and then update it?

Thanks!

Google Ads API Forum Advisor

unread,
Jul 22, 2021, 1:58:24 AM7/22/21
to osib.cvj...@cloudsense.com, adwor...@googlegroups.com
Hi,

Thank you for providing further details.

As for customer report, I am afraid that this can only be used for single client account and cannot be used to get multiple accounts. As for CustomerClient, it is possible to used this object to update the Customer object. The reason is, the said objects are used for different services, CustomerClient is for CustomerClientService while the Customer is for CustomerService.

With this, the provided process that you've mentioned is current possible way for your use case.
"...I have to pull the CustomerClient objects instead of Customer objects. And later on, if I want to update some of the CustomerClient objects I first have to pull single corresponding Customer object, because it is not possible to update CustomerClient directly."

In addition, batch processing can help you with your use case for updating in bulk as customer_operation is supported here.

OC

unread,
Jul 22, 2021, 3:21:55 AM7/22/21
to AdWords API and Google Ads API Forum
Hi,

Thanks again for the response, but I'm still getting to the same issue.

In the links you provided it can be seen that the CustomerClientService does not have a mutate method, while the CustomerService has one. There's also no CustomerClientOperation, but there is a CustomerOperation.

Therefore, if I have a CustomerClient object, and want to update its descriptive_name field for example, how can I do that?

Google Ads API Forum Advisor

unread,
Jul 22, 2021, 11:24:09 PM7/22/21
to osib.cvj...@cloudsense.com, adwor...@googlegroups.com
Hi,

The CustomerClientService is for retrieving account's details only that linked to your manager account. If you want to modify accounts information returned by that service, then the next step to take is to use mutate operation of CustomerService.
Reply all
Reply to author
Forward
0 new messages