Create placement for adgroup with AdGroupCriteriaService

24 views
Skip to first unread message

kristen le

unread,
Jul 3, 2017, 5:25:21 AM7/3/17
to AdWords API Forum
Dear All,
can anyone help me to create placement for adgroup (display network) with AdGroupCriteriaService in Java please

Thank you very much. 
Jeszi.

Peter Oliquino

unread,
Jul 4, 2017, 1:50:58 AM7/4/17
to AdWords API Forum
Hi Jeszi,

You may refer to our AddKeywords example that is available in the Java client library and you may then use the Placement criterion instead of the Keyword criterion. You may also refer to the below sample SOAP request and response below on how to ADD the Placement using the AdGroupCriterionService :

<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/v201705" soapenv:mustUnderstand="0">
            <ns1:clientCustomerId>YOUR_CUSTOMER_ID</ns1:clientCustomerId>
            <ns1:developerToken>YOUR_DEVELOPER_TOKEN</ns1:developerToken>
            <ns1:userAgent>YOUR_USER_AGENT</ns1:userAgent>
            <ns1:validateOnly>false</ns1:validateOnly>
            <ns1:partialFailure>false</ns1:partialFailure>
        </ns1:RequestHeader>
    </soapenv:Header>
    <soapenv:Body>
        <mutate xmlns="https://adwords.google.com/api/adwords/cm/v201705">
            <operations>
                <operator>ADD</operator>
                <operand xmlns:ns2="https://adwords.google.com/api/adwords/cm/v201705" xsi:type="ns2:BiddableAdGroupCriterion">
                    <ns2:adGroupId>THE_ADGROUP_ID</ns2:adGroupId>
                    <ns2:criterion xsi:type="ns2:Placement">
                        <ns2:type>PLACEMENT</ns2:type>
                        <ns2:url>www.exampleurlone.com</ns2:url>
                    </ns2:criterion>
                    <ns2:biddingStrategyConfiguration>
                        <ns2:bids xsi:type="ns2:CpcBid">
                            <ns2:bid>
                                <ns2:microAmount>10000000</ns2:microAmount>
                            </ns2:bid>
                        </ns2:bids>
                    </ns2:biddingStrategyConfiguration>
                </operand>
            </operations>
        </mutate>
    </soapenv:Body>
</soapenv:Envelope>
[main] INFO com.google.api.ads.adwords.lib.client.AdWordsServiceClient.soapXmlLogger - SOAP Response:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Header>
        <ResponseHeader xmlns="https://adwords.google.com/api/adwords/cm/v201705">
            <requestId>THE_REQUEST_ID</requestId>
            <serviceName>AdGroupCriterionService</serviceName>
            <methodName>mutate</methodName>
            <operations>1</operations>
            <responseTime>375</responseTime>
        </ResponseHeader>
    </soap:Header>
    <soap:Body>
        <mutateResponse xmlns="https://adwords.google.com/api/adwords/cm/v201705">
            <rval>
                <ListReturnValue.Type>AdGroupCriterionReturnValue</ListReturnValue.Type>
                <value xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="BiddableAdGroupCriterion">
                    <adGroupId>THE_ADGROUP_ID</adGroupId>
                    <criterion xsi:type="Placement">
                        <id>THE_PLACEMENT_CRITERION_ID</id>
                        <type>PLACEMENT</type>
                        <Criterion.Type>Placement</Criterion.Type>
                        <url>www.exampleurlone.com</url>
                    </criterion>
                    <AdGroupCriterion.Type>BiddableAdGroupCriterion</AdGroupCriterion.Type>
                    <userStatus>ENABLED</userStatus>
                    <systemServingStatus>ELIGIBLE</systemServingStatus>
                    <approvalStatus>APPROVED</approvalStatus>
                    <biddingStrategyConfiguration>
                        <biddingStrategyType>MANUAL_CPC</biddingStrategyType>
                        <biddingStrategySource>CAMPAIGN</biddingStrategySource>
                        <biddingScheme xsi:type="ManualCpcBiddingScheme">
                            <BiddingScheme.Type>ManualCpcBiddingScheme</BiddingScheme.Type>
                            <enhancedCpcEnabled>false</enhancedCpcEnabled>
                        </biddingScheme>
                        <bids xsi:type="CpmBid">
                            <Bids.Type>CpmBid</Bids.Type>
                            <bid>
                                <ComparableValue.Type>Money</ComparableValue.Type>
                                <microAmount>10000</microAmount>
                            </bid>
                            <cpmBidSource>ADGROUP</cpmBidSource>
                        </bids>
                        <bids xsi:type="CpcBid">
                            <Bids.Type>CpcBid</Bids.Type>
                            <bid>
                                <ComparableValue.Type>Money</ComparableValue.Type>
                                <microAmount>10000000</microAmount>
                            </bid>
                            <cpcBidSource>CRITERION</cpcBidSource>
                        </bids>
                    </biddingStrategyConfiguration>
                </value>
            </rval>
        </mutateResponse>
    </soap:Body>
</soap:Envelope>

Let me know if this helps.

Best regards,
Peter
AdWords API Team
Reply all
Reply to author
Forward
0 new messages