How to asign labels to an Expanded Text Ad and add final URL through Google Ads API

56 views
Skip to first unread message

Steven Chen

unread,
May 2, 2021, 10:02:51 AM5/2/21
to AdWords API and Google Ads API Forum
Hi,
So I was trying to create and add Expanded Text Ads and asign a label to those ads through Google Ads API. Is this possible? Is there any example?
I only found an example of adding a campaign lable to list of labels. How would it be at ad level?

Thankyou,
Steven

Google Ads API Forum Advisor Prod

unread,
May 3, 2021, 3:39:59 AM5/3/21
to sc...@cyberclick.net, adwor...@googlegroups.com
Hi Steven,

Thank you for posting your concern. Allow me to provide support to your concern.

As for creating expanding text ads, you may refer to this sample code. With regard to concern about adding label to ads, I am afraid that there is currently no sample code or implementation for this. However, let me discuss how to assign label on ads based on this document. To assign labels to an ad, you may pass one or more AdGroupAdLabelOperation to AdGroupAdLabelService.MutateAdGroupAdLabels. Each AdGroupAdLabelOperation includes an AdGroupAdLabel instance, which contains:

label - The ID of a label.
{ad_group_id} - The ad group ID where ad belong
{ad_id} - Ad ID where label will be assigned

You will need to create a AdGroupAdLabel instance for each label/ad pair, wrap it in a AdGroupAdLabelOperation with the create operation, and send it to AdGroupAdLabelService.MutateAdGroupAdLabels.

Hope this will help. Let me know if you have further questions.

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


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