Hi Alan,
That's right! The outcome is the same.
I'm using MutateJobServive,mutate and the operations are a list of the ads created. My previous snippet is the creation of such a list.
So it's a regular TextAd creation operation, with an additional key in the dictionary.
Relevant documentation:
type AdGroupAd (v201409)For the label field it states: This field is read only and will be ignored when sent to the API for the following
Operators: REMOVE and SET.
What we are doing is an ADD operation because we want to assign the label at the time of creation, so there's no conflict there.
Possible issues that might make your request fail:
- Old API version (I guess not as the link you sent is from v201409)
- Wrong label structure. What I'm sending in the labels field is a list of dictionaries, just with the labelId. (... 'labels': [{'id': Label_id}], ...)
- Wrong method. MutateJobServive,mutate or AdGroupAdService.mutate should work fine as well. Just don't use AdGroupAdService.mutateLabel, because as you've realised, that's for existing ads.
Let me know if you get it working.
Cheers!