How to retrieve ads Labels

657 views
Skip to first unread message

beyond Clicks

unread,
Aug 3, 2020, 5:12:01 AM8/3/20
to AdWords API and Google Ads API Forum
SoIm using the new beta API to with Labels and am trying to figure out this... label ID it keeps mentioning, all the examples and information I can find points to people already having the ID or making the label... but I have absoltuely no clue where to actually get this label.

The intention is to run a check through all the campaigns in an account, and when it is found to be over the budget, pause it and assign it a label. However as mentioned all the guides mention the "id of the label" which is a complete mystery.

Does anybody know where I can get the label ID? I have the name, that much was simple, but at no point have I seen an ID for a label.

Google Ads API Forum Advisor Prod

unread,
Aug 3, 2020, 11:38:41 AM8/3/20
to byon...@gmail.com, adwor...@googlegroups.com

Hi,

Thank you for reaching out. You could query the label.id from the label resource to get the id for a label.

Thanks and regards,
Xiaoming, Google Ads API Team



 

ref:_00D1U1174p._5004Q22b6Hn:ref

beyond Clicks

unread,
Aug 4, 2020, 7:36:19 AM8/4/20
to AdWords API and Google Ads API Forum
Hi Xiaoming.

The system I'm working on will have a large amount of accoutns under a variety of MCC's, Is there a way to CREATE the label if it isn't present in that clients account as a failsafe?

Google Ads API Forum Advisor Prod

unread,
Aug 4, 2020, 2:25:04 PM8/4/20
to byon...@gmail.com, adwor...@googlegroups.com

Hi,

Thank you for reaching out. You could fetch all direct and indirect client customers of the MCC account by querying the customer_client resource and then use CampaignLabelService requests to assign labels to the campaigns.



Thanks and regards,
Xiaoming, Google Ads API Team


 

ref:_00D1U1174p._5004Q22b6Hn:ref

beyond Clicks

unread,
Aug 5, 2020, 8:51:20 AM8/5/20
to AdWords API and Google Ads API Forum
Hi Xiaoming,

I've looked around for how to "create labels using the TextLabel object. To create a TextLabel" as https://developers.google.com/google-ads/api/docs/reporting/labels this guide tells me and I can find no examples of its use or how it is written at all, the examples on the same page make no use of it which has left me completley baffled as to how it is practically used. The guide acts as if you already have the ID, but knowing you might need to make one gives NO example of actually making one at all, just references to disconnected objects and operations with no context at all.

Google Ads API Forum Advisor Prod

unread,
Aug 5, 2020, 3:08:21 PM8/5/20
to byon...@gmail.com, adwor...@googlegroups.com

Hi,

Thank you for reaching out. You could refer to this code example on how to create a campaign label. Creating labels on the ad group is similar. You could also find sample codes with other languages here.



Thanks and regards,
Xiaoming, Google Ads API Team


 

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