Edit userlist targeting bid adjustment

16 views
Skip to first unread message

rafa....@rocketroi.com

unread,
Aug 7, 2017, 11:53:36 AM8/7/17
to AdWords API Forum
Hi!

I'm trying to edit the bid adjustment but despite I'm not getting any error, the change is not being made on Adwords.

This is the code that I'm using (I'm working with java/grails)

        def adwordsServcices = new AdWordsServices()
        def adGroupCriterionService = adwordsServcices.get(session, AdGroupCriterionServiceInterface.class)

        def criterion = new CriterionUserList()
        criterion.setId(id)

        // Create ad group bid.
        def bidCriterion = new BiddableAdGroupCriterion()
        bidCriterion.setAdGroupId(adGroupId)
        bidCriterion.setCriterion(criterion)
        bidCriterion.setBidModifier(value)

        // Create operations.
        def operation = new AdGroupCriterionOperation()
        operation.setOperand(bidCriterion)
        operation.setOperator(Operator.SET)

        def operations = (AdGroupCriterionOperation[]) [operation]

        // Update ad group criteria.
        def result = adGroupCriterionService.mutate(operations)


And here the request and response:

Request:

<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Header>
        <ns1:RequestHeader xmlns:ns1="https://adwords.google.com/api/adwords/cm/v201702" soapenv:mustUnderstand="0">
            <ns1:clientCustomerId>00000000004707663694</ns1:clientCustomerId>
            <ns1:developerToken>REDACTED</ns1:developerToken>
            <ns1:userAgent>***********@gmail.com (AwApi-Java, AdWords-Axis/3.2.0, Common-Java/3.2.0, Axis/1.4, Java/1.8.0_131, maven)</ns1:userAgent>
            <ns1:validateOnly>true</ns1:validateOnly>
            <ns1:partialFailure>true</ns1:partialFailure>
        </ns1:RequestHeader>
    </soapenv:Header>
    <soapenv:Body>
            <operations>
                <operator>SET</operator>
                <operand xmlns:ns2="https://adwords.google.com/api/adwords/cm/v201702" xsi:type="ns2:BiddableAdGroupCriterion">
                    <adGroupId>39364874541</adGroupId>
                    <criterion xsi:type="ns2:CriterionUserList">
                        <id>340920409188</id>
                    </criterion>
                    <bidModifier>1.04</bidModifier>
                </operand>
            </operations>
        </mutate>
    </soapenv:Body>
</soapenv:Envelope>


Response:

<?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Header>
        <ResponseHeader xmlns="https://adwords.google.com/api/adwords/cm/v201702">
            <requestId>0005562bcf5421480a37c31c590cd23b</requestId>
            <serviceName>AdGroupCriterionService</serviceName>
            <methodName>mutate</methodName>
            <operations>0</operations>
            <responseTime>228</responseTime>
        </ResponseHeader>
    </soap:Header>
    <soap:Body>
        <mutateResponse xmlns="https://adwords.google.com/api/adwords/cm/v201702"/>
    </soap:Body>
</soap:Envelope>



Shwetha Vastrad (AdWords API Team)

unread,
Aug 7, 2017, 2:01:15 PM8/7/17
to AdWords API Forum
Hi, 

I see that you have set the validateOnly header to true in the request. When this header is set to true, the request is validated but not performed. If there are no errors returned in the response, it means the request is valid. You need to set this header to false to execute this operation. Please try this out and let me know if it works. 

Regards,
Shwetha, AdWords API Team.
Reply all
Reply to author
Forward
0 new messages