Campaign.labels is empty

41 views
Skip to first unread message

暐陳

unread,
May 21, 2020, 11:48:05 PM5/21/20
to AdWords API and Google Ads API Forum

I want to get the label column via google ads API.
I can find the value of label column in my google ads platform.
Here is the screenshot.
 

螢幕截圖 2020-05-22 11.42.18.png



And here is the query in my code.
```
query = ('SELECT customer.id, customer.descriptive_name, customer.currency_code, \
              campaign.id, campaign.name, campaign.status, campaign.serving_status, \
              campaign.bidding_strategy, campaign.bidding_strategy_type, campaign.payment_mode, campaign.advertising_channel_type, campaign.labels, \
              ad_group.id, ad_group.name, ad_group_ad.ad.id, ad_group_ad.ad.name, ad_group_ad.ad.final_urls, ad_group_ad.ad.type, '
             'segments.date , segments.ad_network_type, '
             'metrics.impressions, metrics.ctr, metrics.clicks, metrics.conversions_from_interactions_rate, metrics.conversions, \
              metrics.cost_per_conversion, metrics.view_through_conversions, \
              metrics.cost_micros, metrics.average_cost, metrics.average_cpm, metrics.average_cpc '
             'FROM ad_group_ad ' 
             'WHERE segments.date DURING YESTERDAY '
             'ORDER BY metrics.impressions DESC ')
```

Plz help me to solve this problem.

Google Ads API Forum Advisor Prod

unread,
May 22, 2020, 11:03:07 AM5/22/20
to wasd...@gmail.com, adwor...@googlegroups.com
Hi,

Thank you for reaching out. That is the proper attribute to pull campaign labels however it will just pull the resource name of the label. You can get more information about the label by using the Label report.

If you are still having issues, can you please share your client customer ID and the complete detailed request and response logs of the report call via Reply privately to author so I can further investigate the issue? You can find information on enabling logging in the dropdown of your client library on the left-hand side of the page here.

Regards,
Mitchell
Google Ads API Team

ref:_00D1U1174p._5004Q1zrBSy:ref

暐陳

unread,
May 24, 2020, 10:19:18 PM5/24/20
to AdWords API and Google Ads API Forum
Hi,


OK, I will share my client customer ID and the complete detailed request and response logs of the report call via Reply privately to author later.
And like you said that it will just pull the resource name of the label if I I put campaign.labels in my SELECT clause.I want to get the label.name in my query.
I already tried to put  label as a resource in FROM clause, and no doubt I could get the real label name. id, resource name in my query.
However, I want to get the data with the segments and metrics I want like the query I showed above. I know only one resource can put in From clause, how can I get the label name when I use ad_group_ad as my resource.

Google Ads API Forum Advisor Prod

unread,
May 26, 2020, 10:42:34 AM5/26/20
to wasd...@gmail.com, adwor...@googlegroups.com
Hi,

Thank you for confirming that you are able to get the resource name. Unfortunately, it will not be possible to get the label names from the ad_group_ad report. I have created a feature request for this on your behalf so please keep an eye on our Developer Blog for information on future releases.
Reply all
Reply to author
Forward
0 new messages