How to get the names of labels and not just the id's

222 views
Skip to first unread message

Casper Crause

unread,
Jun 22, 2021, 11:22:45 AM6/22/21
to AdWords API and Google Ads API Forum
I ran a query " SELECT customer.descriptive_name, campaign.name, metrics.cost_micros, campaign.labels FROM campaign WHERE segments.date BETWEEN '2021-05-01' AND '2021-05-31"

This is the result of that query when written to a csv file:
labels.png

I then ran a different query "SELECT campaign_label.campaign, campaign_label.label, campaign_label.resource_name FROM campaign_label" thinking I would get the ID and then a label then I could perform a join. This also just gave me a bunch of campaign ids and label ids.

How can I get the a list of which Label ids correspond to which label names?





Google Ads API Forum Advisor

unread,
Jun 24, 2021, 10:36:19 AM6/24/21
to ccra...@gmail.com, adwor...@googlegroups.com
Hi Casper, 

Thanks for reaching out. You can use the attributed resource, label, from the campaign_label resource to retrieve the ID and name. 

Regards,
Matt
Google Ads API Team

Google Logo
Matt
Google Ads API Team
 


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