Applying labels on adgroup

44 views
Skip to first unread message

Ashish Pathak

unread,
Oct 13, 2014, 12:36:23 PM10/13/14
to adwor...@googlegroups.com
Hi,

I'm trying to apply labels on adgroups

using code -        perations.append({
         'operator': 'ADD',
         'operand': {
             'adGroupId': adGroupID,
             'labelId':  labelId
                    }
        })

if label is already associated with adgroup it returns error : AdGroupServiceError.ADGROUP_LABEL_ALREADY_EXISTS @ operations[104].operand 

which is fine but label should be applied to some of the operation to which label is missing.

Example : if label for operation 0-103 is missing in account I'm not get above error but when I checked in account label was not applied adgroup for which label was missing.

how to handle this case? 

Thanks in advance!
Ashish


Anash P. Oommen (AdWords API Team)

unread,
Oct 14, 2014, 9:09:31 AM10/14/14
to adwor...@googlegroups.com
Hi Ashish,

AdWords API calls are usually atomic in nature - either all the operations succeed, or they fail. If you have a failing operation, you should remove the failing operation, and make the API call again.

There's a partialFailure soapHeader you could use to get the behaviour you want, but I'm not sure if it applies to adding labels. 

Cheers,
Anash P. Oommen,
AdWords API Advisor.
Reply all
Reply to author
Forward
0 new messages