Hi all!
I disagree with the accepted solution. I am currently assigning labels to
Text Ads in a single operation at the time of creation. Below is the
relevant snippet from my python code. I'm using the MutateJobService and it
works just fine.
adgroup_ad_operations.append({
'xsi_type': 'AdGroupAdOperation',
'operator': 'ADD',
'operand': {
'xsi_type': 'AdGroupAd',
'adGroupId': adGroupId,
'ad': textad,
'status': 'ENABLED',
'labels': [{'id': Label_id}],
},
})
I hope this helps. :)
Cheers!
Martin
On Wednesday, 8 October 2014 05:18:07 UTC-3, Alan Coleman wrote:
>
> Thanks for getting back to me Michael! :-)
>
> On Friday, October 3, 2014 6:19:06 PM UTC+1, Michael Cloonan (AdWords API
> Team) wrote:
>>
>> Hello,
>>
>> You are correct; you must create the TextAd first, and then in a separate
>> operation you may assign a label to it. There is no way to assign a label
>> to the TextAd at the time of creation.
>>
>> Regards,
>> Mike, AdWords API Team
>>
>> On Friday, October 3, 2014 6:37:01 AM UTC-4, Alan Coleman wrote:
>>>
>>> Hello everyone,
>>>
>>> I'd like to be able to add a *label* to a *TextAd *when creating the
>>> TextAd.
>>>
>>> I'm creating the TextAd using AdGroupAdOperation
>>> <https://developers.google.com/adwords/api/docs/reference/v201406/AdGroupAdService.AdGroupAdOperation>
>>> .
>>>
>>> If I want to use AdGroupAdLabelOperation
>>> <https://developers.google.com/adwords/api/docs/reference/v201406/AdGroupAdService.AdGroupAdLabelOperation>
>>>
>>> to add a label then I first have to return the TextAd id from the
>>> AdGroupAdOperation
>>> <https://developers.google.com/adwords/api/docs/reference/v201406/AdGroupAdService.AdGroupAdOperation>
>>> .
>>>
>>> So am I right in saying that to add a *label* to a *TextAd *I have to
>>> create both using separate operations then add the Label to the TextAd?
>>>
>>> I think I may have answered my own question here, but any suggestions
>>> would be helpful.
>>> Many thanks
>>>
>>
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
---
You received this message because you are subscribed to the Google Groups
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
Visit this group at http://groups.google.com/group/adwords-api.
To view this discussion on the web visit
https://groups.google.com/d/msgid/adwords-api/dd288179-55c2-45a0-8711-6058530e906b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.