Update Keyword Bid SOAP RQ for AdGroupCriterionService call

41 views
Skip to first unread message

Gunjan Patel

unread,
Feb 4, 2019, 9:06:43 AM2/4/19
to AdWords API and Google Ads API Forum
Team, 

I am creating a SOAP XML Request for Updating the bid value. I am using v201809/AdGroupCriterionService endpoint for it.

Below is my request. I am able to get the response with below request. But I want to update the CpcBid-> MicroAmount. What will be SOAP XML Request for it? Based on the documentation i read, i think "biddingStrategyConfiguration" needs to be updated. But I am not able to create a request for it. Can some one help. Thanks in advance.

<soapenv:Body> <v20:mutate> <!--Zero or more repetitions:--> <v20:operations> <!--Optional:--> <v20:operator>SET</v20:operator> <v20:Operation.Type>BiddableAdGroupCriterion</v20:Operation.Type> <!--Optional:--> <v20:operand> <!--Optional:--> <v20:adGroupId>XXXXXXXX</v20:adGroupId> <!--Optional:--> <v20:criterionUse>BIDDABLE</v20:criterionUse> <!--Optional:--> <v20:criterion> <v20:id>XXXXXX</v20:id> </v20:criterion> <v20:AdGroupCriterion.Type>biddingStrategyConfiguration</v20:AdGroupCriterion.Type> </v20:operand> <v20:exemptionRequests> <v20:key> <v20:policyName>biddingStrategyConfiguration</v20:policyName> <v20:violatingText>biddingStrategyConfiguration</v20:violatingText> </v20:key> </v20:exemptionRequests> </v20:operations> </v20:mutate> </soapenv:Body>











googleadsapi...@google.com

unread,
Feb 4, 2019, 10:28:13 AM2/4/19
to adwor...@googlegroups.com
Hi Gunjan,

Could you confirm if my understanding is correct that you are trying to update only the bid? If yes, it appears that you have not included the bid object itself in your SOAP logs. Also, you can follow this example in Java (also available in other languages) on how to update a keyword which already includes the code on how to update your bid.

Let me know if this helps.

Thanks and regards,
Peter
AdWords API Team

Was your question answered? Please rate your experience with us by taking a short survey.
If not -- reply to this email and tell us what else we can do to help.

Take Survey

Also find us on our blog and discussion group:
http://googleadsdeveloper.blogspot.com/search/label/adwords_api
https://developers.google.com/adwords/api/community/

--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
 
You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwor...@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscribe@googlegroups.com
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 and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adwords-api+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/0875c7ea-87c8-4314-bc57-6aae69d0f387%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Gunjan Patel

unread,
Feb 5, 2019, 4:59:09 AM2/5/19
to AdWords API and Google Ads API Forum
Hi Peter,

Thanks for the response. Your understanding is correct. I am trying to update the bid only for particular adGroupId and Criterion.Id. Below is the request I am trying out, by following the example you gave below and reverse engineering it to SOAP Request. But I am getting Unmarshalling error. Please let me know what is the right request as I am missing something. Thanks in advance.

RQ : cm/v201809/AdGroupCriterionService
   <soapenv:Header>
      <v20:RequestHeader>
         <v20:clientCustomerId>XXXXXXX</v20:clientCustomerId>
         <v20:developerToken>XXXXX</v20:developerToken>
         <v20:userAgent>XXXXX</v20:userAgent>
         <v20:validateOnly>false</v20:validateOnly>
         <v20:partialFailure>false</v20:partialFailure>
      </v20:RequestHeader>
   </soapenv:Header>
   <soapenv:Body>
      <v20:mutate>
         <v20:operations>
            <v20:operator>SET</v20:operator>
            <v20:Operation.Type>BiddableAdGroupCriterion</v20:Operation.Type>
            <v20:operand>
               <v20:adGroupId>XXXXX</v20:adGroupId>
               <v20:criterionUse>BIDDABLE</v20:criterionUse>
               <v20:criterion>
                  <v20:id>XXXXXX</v20:id>                  
               </v20:criterion>
               <v20:AdGroupCriterion.Type>biddingStrategyConfiguration</v20:AdGroupCriterion.Type>
               
               <v20:biddingStrategyConfiguration>
                  <v20:biddingStrategyType>MANUAL_CPC</v20:biddingStrategyType>
                  <v20:biddingStrategySource>CAMPAIGN</v20:biddingStrategySource>
                  <v20:biddingScheme xsi:type="ManualCpcBiddingScheme">
                     <v20:BiddingScheme.Type>ManualCpcBiddingScheme</v20:BiddingScheme.Type>
                     <v20:enhancedCpcEnabled>false</v20:enhancedCpcEnabled>
                  </v20:biddingScheme>
                  <v20:bids xsi:type="CpcBid">
                     <v20:Bids.Type>CpcBid</v20:Bids.Type>
                     <v20:bid>
                        <v20:ComparableValue.Type>Money</v20:ComparableValue.Type>
                        <v20:microAmount>5200000</v20:microAmount>
                     </v20:bid>
                     <v20:cpcBidSource>CRITERION</v20:cpcBidSource>
                  </v20:bids>
                  
               </v20:biddingStrategyConfiguration>   

            </v20:operand>
            <v20:exemptionRequests>
               <v20:key>
                  <v20:policyName>biddingStrategyConfiguration</v20:policyName>
                  <v20:violatingText>biddingStrategyConfiguration</v20:violatingText>
               </v20:key>
            </v20:exemptionRequests>
        </v20:operations>
      </v20:mutate>
   </soapenv:Body>
</soapenv:Envelope>


RS :
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <soap:Fault> <faultcode>soap:Client</faultcode> <faultstring>Unmarshalling Error: cvc-complex-type.2.4.d: Invalid content was found starting with element 'v20:biddingStrategyConfiguration'. No child element is expected at this point. </faultstring> </soap:Fault> </soap:Body> </soap:Envelope>

googleadsapi...@google.com

unread,
Feb 5, 2019, 7:25:47 AM2/5/19
to adwor...@googlegroups.com
Hi Gunjan,

You are passing fields that are no longer necessary for updating your bids such as the ones below :

<v20:biddingStrategyType>MANUAL_CPC</v20:biddingStrategyType>
<v20:biddingStrategySource>CAMPAIGN</v20:biddingStrategySource>
<v20:biddingScheme xsi:type="ManualCpcBiddingScheme">
<v20:BiddingScheme.Type>ManualCpcBiddingScheme</v20:BiddingScheme.Type>
<v20:enhancedCpcEnabled>false</v20:enhancedCpcEnabled>
</v20:biddingScheme>
<v20:cpcBidSource>CRITERION</v20:cpcBidSource
 <v20:AdGroupCriterion.Type>biddingStrategyConfiguration</v20:AdGroupCriterion.Type>

You can refer to this section for the implementation of the update. You may then apply the same convention when updating your bids using the AdGroupCriterionService.

Thanks and regards,
Peter
AdWords API Team


Was your question answered? Please rate your experience with us by taking a short survey.
If not -- reply to this email and tell us what else we can do to help.

Take Survey

Also find us on our blog and discussion group:
http://googleadsdeveloper.blogspot.com/search/label/adwords_api
https://developers.google.com/adwords/api/community/

--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
 
You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwor...@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscribe@googlegroups.com
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 and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adwords-api+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.

Gunjan Patel

unread,
Feb 5, 2019, 3:46:22 PM2/5/19
to AdWords API and Google Ads API Forum
Hi Peter,

I tried with below RQ but that is also throwing the error

 <soapenv:Body>
      <v20:mutate>
         <v20:operations>
            <v20:operator>SET</v20:operator>
            <v20:Operation.Type>BiddableAdGroupCriterion</v20:Operation.Type>
            <v20:operand>
               <v20:adGroupId>XXXXXXX</v20:adGroupId>
               <v20:criterionUse>BIDDABLE</v20:criterionUse>
               <v20:criterion>
                  <v20:id>XXXXXX</v20:id>                  
               </v20:criterion>
              
                  <v20:bids >
                     <v20:Bids.Type>CpcBid</v20:Bids.Type>
                     <v20:bid>
                        <v20:ComparableValue.Type>Money</v20:ComparableValue.Type>
                        <v20:microAmount>7200000</v20:microAmount>
                     </v20:bid>
                  </v20:bids>
               </v20:operand>
            <v20:exemptionRequests>
               <v20:key>
                  <v20:policyName>biddingStrategyConfiguration</v20:policyName>
                  <v20:violatingText>biddingStrategyConfiguration</v20:violatingText>
               </v20:key>
            </v20:exemptionRequests>
        </v20:operations>
      </v20:mutate>
   </soapenv:Body>

RS:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body>
        <soap:Fault>
            <faultcode>soap:Client</faultcode>
            <faultstring>Unmarshalling Error: cvc-complex-type.2.4.a: Invalid content was found starting with element '{"https://adwords.google.com/api/adwords/cm/v201809":bids}'. One of '{"https://adwords.google.com/api/adwords/cm/v201809":labels, "https://adwords.google.com/api/adwords/cm/v201809":forwardCompatibilityMap, "https://adwords.google.com/api/adwords/cm/v201809":baseCampaignId, "https://adwords.google.com/api/adwords/cm/v201809":baseAdGroupId, "https://adwords.google.com/api/adwords/cm/v201809":AdGroupCriterion.Type}' is expected. </faultstring>
        </soap:Fault>
    </soap:Body>
</soap:Envelope>

On Monday, 4 February 2019 03:06:43 UTC-6, Gunjan Patel wrote:

googleadsapi...@google.com

unread,
Feb 6, 2019, 3:30:40 AM2/6/19
to adwor...@googlegroups.com
Hi Gunjan,

I would recommend that you follow the UpdateKeyword example (also available in other languages) from the client library, instead for simplicity. Also, since you are SOAP XML directly to construct your requests, you can refer to the sample SOAP request below :

    <soapenv:Header>
        <ns1:RequestHeader xmlns:ns1="https://adwords.google.com/api/adwords/cm/v201809" soapenv:mustUnderstand="0">
            <ns1:clientCustomerId>CLIENT_CUSTOMER_ID</ns1:clientCustomerId>
            <ns1:developerToken>REDACTED</ns1:developerToken>
            <ns1:userAgent>USER_AGENT</ns1:userAgent>
            <ns1:validateOnly>false</ns1:validateOnly>
            <ns1:partialFailure>false</ns1:partialFailure>
        </ns1:RequestHeader>
    </soapenv:Header>
    <soapenv:Body>
            <operations>
                <operator>SET</operator>
                <operand xmlns:ns2="https://adwords.google.com/api/adwords/cm/v201809" xsi:type="ns2:BiddableAdGroupCriterion">
                    <ns2:adGroupId>ADGROUP_ID</ns2:adGroupId>
                    <ns2:criterion>
                        <ns2:id>CRITERION_ID</ns2:id>
                    </ns2:criterion>
                    <ns2:biddingStrategyConfiguration>
                        <ns2:bids xsi:type="ns2:CpcBid">
                            <ns2:bid>
                                <ns2:microAmount>20000000</ns2:microAmount>
                            </ns2:bid>
                        </ns2:bids>
                    </ns2:biddingStrategyConfiguration>
                </operand>
            </operations>
        </mutate>
    </soapenv:Body>
</soapenv:Envelope>

Thanks and regards,
Peter
AdWords API Team

Was your question answered? Please rate your experience with us by taking a short survey.
If not -- reply to this email and tell us what else we can do to help.

Take Survey

Also find us on our blog and discussion group:
http://googleadsdeveloper.blogspot.com/search/label/adwords_api
https://developers.google.com/adwords/api/community/

--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
 
You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwor...@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscribe@googlegroups.com
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 and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adwords-api+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.

Gunjan Patel

unread,
Feb 6, 2019, 4:20:47 AM2/6/19
to AdWords API and Google Ads API Forum
Hi Peter,

Thanks for the sample request. It worked :) ... 

Regarding the client library, I would love to use it, but our internal network does not allow to directly call the google endpoints. We need to go through our DevEx gateway. I was not able to find a way to set my internal DexEx endpoint in the client library. Also, our servers cannot directly download WSDL from the internet, so it needs to be downloaded before and needs to be part of the code itself. Is that possible through Python client library?

Really appreciate all your help.

Gunjan


On Monday, 4 February 2019 03:06:43 UTC-6, Gunjan Patel wrote:

googleadsapi...@google.com

unread,
Feb 6, 2019, 6:01:36 AM2/6/19
to adwor...@googlegroups.com
Hi Gunjan,

Glad to hear that it worked for you. As for the Python client library setup, you may reach out to the library owners via this link for further assistance as they are more equipped to provide you support regarding this matter.

Thanks and regards,
Peter
AdWords API Team

Was your question answered? Please rate your experience with us by taking a short survey.
If not -- reply to this email and tell us what else we can do to help.

Take Survey

Also find us on our blog and discussion group:
http://googleadsdeveloper.blogspot.com/search/label/adwords_api
https://developers.google.com/adwords/api/community/

--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
 
You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwor...@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscribe@googlegroups.com
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 and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adwords-api+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.

Gunjan Patel

unread,
Apr 2, 2019, 10:24:16 AM4/2/19
to AdWords API and Google Ads API Forum
Hi Peter,

One more question. We are updating 100's of keyword at a time. Is there a way to do a bulk update? If yes, can you send me sample payload request for it?

Thanks in advance.

Gunjan

googleadsapi...@google.com

unread,
Apr 2, 2019, 10:33:45 AM4/2/19
to adwor...@googlegroups.com
Hi Gunjan,

You can use the BatchJobService to accomplish this and you can refer to this guide as to how. We currently do not have a direct example for updating keywords in bulk, however, you can refer to this sample code on how you can implement the BatchJobService using python. 

Thanks and regards,
Peter
Google Ads API Team


Was your question answered? Please rate your experience with us by taking a short survey.
If not -- reply to this email and tell us what else we can do to help.

Take Survey

Also find us on our blog and discussion group:
http://googleadsdeveloper.blogspot.com/search/label/adwords_api
https://developers.google.com/adwords/api/community/

Reply all
Reply to author
Forward
0 new messages