Get applied_labels of customer_client

176 views
Skip to first unread message

FW API

unread,
Jul 14, 2021, 8:40:00 AM7/14/21
to AdWords API and Google Ads API Forum
Hello,

I'm trying to receive the label resource names applied to a client customer. Using Ads API v8 I tried the field "applied_labels" of customer_client. Unfortunately it always returns an empty collection, even when there are labels applied to the customer client.

Documentation says: Output only. The resource names of the labels owned by the requesting customer that are applied to the client customer. Label resource names have the form: `customers/{customer_id}/labels/{label_id}` https://developers.google.com/google-ads/api/fields/v8/customer_client

The requesting customer owns the labels, so that should be fine.

My query is:
SELECT customer_client.applied_labels, customer_client.descriptive_name, customer_client.id, customer_client.level, customer_client.manager FROM customer_client

I get values for descriptive_name, level, manager etc, so the query itself is working.

Am I missing something?

Google Ads API Forum Advisor

unread,
Jul 14, 2021, 2:11:40 PM7/14/21
to api.fw...@gmail.com, adwor...@googlegroups.com
Hi FW API,

Thank you for reaching out to us. I was able to look over the query that you have sent us. From what you have stated and shown, it looks like all the items are returning EXCEPT for the applied_label. With this in mind your query seems to be fine and not the issue. We would suggest getting back in touch with the person who has created the labels and making sure that they have been applied to this account. As it would look like none have been.

Regards,

Google Logo
William Pescherine
Google Ads API Team
 


ref:_00D1U1174p._5004Q2KcAj6:ref

FW API

unread,
Jul 15, 2021, 2:59:29 AM7/15/21
to AdWords API and Google Ads API Forum
Hi William,

Thanks for replying. Actually I have access to the accounts and checked several times whether there were any labels applied or not. We're managing a bulk of accounts, multiple of them having one or more labels attached, and for none of them the API returned any labels.

Just to make clear I didn't got anything wrong:  Let's assume we have a manager account A1 with a customer client B1 and there are some labels applied to B1. A1 would be the requesting customer using the query to receive B1 including the applied_labels, correct?

Regards

Google Ads API Forum Advisor

unread,
Jul 16, 2021, 4:01:09 AM7/16/21
to api.fw...@gmail.com, adwor...@googlegroups.com

Hello,

Thank you for getting back to us.

Please see our response to your question below:

  • Just to make clear I didn't got anything wrong: Let's assume we have a manager account A1 with a customer client B1 and there are some labels applied to B1. A1 would be the requesting customer using the query to receive B1 including the applied_labels, correct? Yes, that's correct. However, to fully describe the scenario and as per this guide, when getting the hierarchy of accounts under a manager account, you can retrieve the list of labels applied to a child customer account by requesting the applied_labels field from the CustomerClient object. This field retrieves only the labels owned by the customer making the API call.

Hope this helps.

Regards,

Google Logo
Mark Kevin Albios
Google Ads API Team
 

 

ref:_00D1U1174p._5004Q2KcAj6:ref

FW API

unread,
Jul 16, 2021, 5:55:38 AM7/16/21
to AdWords API and Google Ads API Forum
Hi Mark,

Thanks for answering. I'm afraid I followed the guide you mentioned without success.

Here's basically my setup:
  1. ManagerAccount "A1" owns label "label1" and "label2".
  2. Child customer "B1" is a direct child of "A1".
  3. "label1" is applied to "B1".
  4. "A1" makes the api call to get all of its customer_clients
  5. The request returns "B1" with descriptive_name, id, etc. BUT the field applied_labels is an empty list

As far as I understood, that should be working. Is it possible that there's a bug or something?

Regards

Google Ads API Forum Advisor

unread,
Jul 19, 2021, 3:50:25 PM7/19/21
to api.fw...@gmail.com, adwor...@googlegroups.com
Hi there,

I work with Mark and will assist you. Could you supply us privately the full request/response log?

Regards,

Google Logo
Aryeh Baker
Google Ads API Team
 


ref:_00D1U1174p._5004Q2KcAj6:ref
Message has been deleted

FW API

unread,
Jul 26, 2021, 4:33:20 AM7/26/21
to AdWords API and Google Ads API Forum
Hi there,

I supplied the full request/response log last week via private message. I'm not sure whether this message has reached you. Do you have any updates regarding this issue?

Regards

Google Ads API Forum Advisor

unread,
Jul 26, 2021, 9:11:17 AM7/26/21
to api.fw...@gmail.com, adwor...@googlegroups.com
Hi,

I replied to you directly last week from this address. Perhaps check your spam folder to see if my message wound up there.

Here's a version of my response without your account specifics.

Our labels guide mentions that for applied_labels:

 
This field retrieves only the labels owned by the customer making the API call.
 
The "customer making the API call" there refers to the login-customer-id specified on the request. I see that in the requests in your logs, you are specifying a login-customer-id of A, which is the parent manager of B. Since A does not own the labels you mentioned, the response will not include them. However, if you change the login-customer-id to B, the labels should be returned in the applied_labels collection. Note that youwill only be able to change the login-customer-id to B if you have OAuth credentials for a user who has direct access to B.

Hope that helps! Please let me know if you have any remaining questions.

Cheers,
Josh, Google Ads API Team

ref:_00D1U1174p._5004Q2KcAj6:ref
Reply all
Reply to author
Forward
0 new messages