Re: How to implement the EXCLUDE loaction with api

12 views
Skip to first unread message
Message has been deleted

Vincent Racaza (AdWords API Team)

unread,
Feb 6, 2018, 2:51:58 AM2/6/18
to AdWords API Forum
Hi,

I deleted your original post as it contains your private information (e.g. developer token). In the future, please do not post any private information in the public forum. You can check our forum guidelines before posting. Re-posting this with masked information:

Hi,
 
I am a developer of Nodejs. Now  I can implement Target loaction by send xml with adword api. I notice that the 'isNegative' and 'EXCLUDE' releated,But it do not work.
Here is my code. Please tell if there is a specifc solution.
 
<x:Envelope xmlns:x="http://schemas.xmlsoap.org/soap/envelope/"
      xmlns:v="https://adwords.google.com/api/adwords/cm/v201702"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<x:Header>
  <v:RequestHeader>
      <v:clientCustomerId>123-xxx-123</v:clientCustomerId>
      <v:developerToken>XXXXXXXXX</v:developerToken>
      <v:userAgent>test</v:userAgent>
      <v:validateOnly>false</v:validateOnly>
      <v:partialFailure>false</v:partialFailure>
  </v:RequestHeader>
</x:Header>
<x:Body>
  <v:mutate>
      <v:operations>
          <v:operator>ADD</v:operator>
          <v:operand>
              <v:campaignId>xxxxxxxx</v:campaignId>
              <v:isNegative>true</v:isNegative>
              <v:criterion xmlns:ns2="https://adwords.google.com/api/adwords/cm/v201702" xsi:type="ns2:Location">
                  <v:id>2156</v:id>
              </v:criterion>
          </v:operand>
      </v:operations>
  </v:mutate>
</x:Body>
</x:Envelope>

Thanks,
Vincent
AdWords API Team

Vincent Racaza (AdWords API Team)

unread,
Feb 6, 2018, 2:52:23 AM2/6/18
to AdWords API Forum
Hi,

For excluding location in your campaign, you need to use the CampaignCriterionService.mutate() and the NegativeCampaignCriterion as your object. Since you are using nodeJS, I will just provide you the sample SOAP request snippet that you can emulate on your end:

<soapenv:Body>
    <mutate xmlns="https://adwords.google.com/api/adwords/cm/v201710">
        <operations>
            <operator>ADD</operator>
            <operand xmlns:ns2="https://adwords.google.com/api/adwords/cm/v201710xsi:type="ns2:NegativeCampaignCriterion">
                <ns2:campaignId>XXXXXXXXX</ns2:campaignId>
                <ns2:criterion xsi:type="ns2:Location">
                    <ns2:id>XXXX</ns2:id>
                </ns2:criterion>
            </operand>
        </operations>
    </mutate>
</soapenv:Body>

Let me know if this helps.
Reply all
Reply to author
Forward
0 new messages