Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot use BatchJob to update labels #106

Closed
sfontana opened this issue Mar 8, 2016 · 1 comment
Closed

Cannot use BatchJob to update labels #106

sfontana opened this issue Mar 8, 2016 · 1 comment

Comments

@sfontana
Copy link

sfontana commented Mar 8, 2016

I'm trying to change a campaignLabel using the BatchJob.
Here https://developers.google.com/adwords/api/docs/guides/batch-jobs#supported_operations is says that CampaignLabel is a supported operation.

Unfortunately this

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns0="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="https://adwords.google.com/api/adwords/cm/v201601" xmlns:tns="https://adwords.google.com/api/adwords/cm/v201601" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <SOAP-ENV:Header>
      <tns:RequestHeader>
         <tns:clientCustomerId>XXX-XXX-XXXX</tns:clientCustomerId>
         <tns:developerToken>1234567890</tns:developerToken>
         <tns:userAgent>Webrepublic..</tns:userAgent>
         <tns:validateOnly>false</tns:validateOnly>
         <tns:partialFailure>false</tns:partialFailure>
      </tns:RequestHeader>
   </SOAP-ENV:Header>
   <ns0:Body>
      <ns1:mutateLabel>   <----------------------------------------
         <ns1:operations>
            <ns1:operator>ADD</ns1:operator>
            <ns1:Operation.Type>CampaignLabelOperation</ns1:Operation.Type>
            <ns1:operand>
               <ns1:campaignId>436647188</ns1:campaignId>
               <ns1:labelId>448280348</ns1:labelId>
            </ns1:operand>
         </ns1:operations>
      </ns1:mutateLabel>
   </ns0:Body>
</SOAP-ENV:Envelope>

will fail because https://github.com/googleads/googleads-python-lib/blob/master/googleads/adwords.py#L769
return root.find('{http://schemas.xmlsoap.org/soap/envelope/}Body').find( '%smutate' % self._adwords_namespace)
will only look for mutate and not mutateLabel.

@msaniscalchi
Copy link
Contributor

Thanks for reporting this. It looks like our support for label operations is broken because of this line. We'll push a fix for this in the near future.

sfontana added a commit to wbrp/googleads-python-lib that referenced this issue Mar 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants