Campaign Settings

141 views
Skip to first unread message

jona...@garagecoders.net

unread,
Sep 2, 2015, 2:29:08 PM9/2/15
to AdWords API Forum
Hi, I'm trying to change some params of my campaign from ( Using iOS - objective C ), the parameters I'm trying to change are, Language, Start Date, End Date, Location and Devices, also I get a list of languages that Adwords api provides but I don´t know hot to show the locations or the devices that are available for a campaign, so I I don´t know what services I need to consume in order to achive the valid locations and devices an how to update this values in the current campaign.

Thanks.

Anthony Madrigal

unread,
Sep 3, 2015, 9:13:50 AM9/3/15
to AdWords API Forum
Hi Jonathan,

Since Location, Devices and Languages are all criterions, you can use the CampaignCriterionService to update these fields. First, you will need to create a Criterion with the type of your choosing then pass that as the criterion in the CampaignCriterion.

You can refer to the Criteria Codes for the IDs of each Criterion in our Reference Data page.

Cheers,
Anthony
AdWords API Team

jona...@garagecoders.net

unread,
Sep 3, 2015, 10:55:49 AM9/3/15
to AdWords API Forum
Lot of thanks and How can I get the locations and Devices for my Campaign ? 
Is there a list for this values like the list of languages ?

Thanks.

Anthony Madrigal

unread,
Sep 3, 2015, 11:42:22 AM9/3/15
to AdWords API Forum
Hi Jonathan,

Here are some pages of the values (criteria IDs) of the following Criteria:
Anthony
AdWords API Team

jona...@garagecoders.net

unread,
Sep 3, 2015, 11:49:24 AM9/3/15
to AdWords API Forum
A lot of thanks, I'm going to implement this in order to modify my campaign :)

Thanks. 

jona...@garagecoders.net

unread,
Sep 3, 2015, 6:45:56 PM9/3/15
to AdWords API Forum
Hi, Now I can change de start date, end date, and the platform, but when I try to update the Language I get a error, i don´t know if I missing something.
Also I'm able to change the device with the campaignCriterionService but I'm a little confuse because when I get the campaignReport it includes a params that is call "device" but it's nt the same that platform I use, I used the list of platform you gave me.

Thank you for your help.

Anthony Madrigal

unread,
Sep 4, 2015, 12:20:26 PM9/4/15
to AdWords API Forum
Hello Jonathan,

Could you send me the following SOAP requests and responses through Reply privately to author:
  • The API call you made to try to change the Language
  • The API call you made for the Campaign Performance Report 
Thanks,
Anthony
AdWords API Team

Anthony Madrigal

unread,
Sep 11, 2015, 3:39:22 PM9/11/15
to AdWords API Forum
Hi Jonathan,

Instead of creating a Criterion of type Language then passing it to the CampaignCriterion, create an object of type Language then use it when setting the criterion in the CampaignCriterion. 

For Language criterions, you cannot SET (or update) the language. You must first REMOVE the previous Language then ADD the new one.

jona...@garagecoders.net

unread,
Sep 11, 2015, 5:03:02 PM9/11/15
to AdWords API Forum
Th object language received the type so the type is Language, as I put in the previous request, o maybe I just need to remove the language and after added.

Anthony Madrigal

unread,
Sep 11, 2015, 5:28:00 PM9/11/15
to AdWords API Forum
Hi,

My initial solution matched your SOAP request when I tested it. 

However, when I tested it using the solution I most recently suggested, I got a SOAP request similar to the one below:
    <soapenv:Body>
            <operations>
                <operator>ADD</operator>
                <operand>
                    <campaignId>XXXXXXXXX</campaignId>
                    <criterion xmlns:ns2="https://adwords.google.com/api/adwords/cm/v201506" xsi:type="ns2:Language">
                        <ns2:id>1019</ns2:id>
                    </criterion>
                </operand>
            </operations>
        </mutate>
    </soapenv:Body>

Hope this helps!

Regards,
Anthony
AdWords API Team
Message has been deleted

jona...@garagecoders.net

unread,
Sep 14, 2015, 7:41:33 PM9/14/15
to AdWords API Forum

I don´t have an API like java or .NET, so first I want to update the language from soapUI, so I have problems even with soapUI and I got the error that i put before, I remove the language and after I try to add the new one buu the error is the same, In soap how can i create the necessary tags That i need, like in the example of java.

Anthony Madrigal

unread,
Sep 15, 2015, 10:34:38 AM9/15/15
to AdWords API Forum
Hi Jonathan, 

To add a language to your campaign, your SOAP XML request should look like:

<?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/v201506" soapenv:mustUnderstand="0">
            <ns1:clientCustomerId>XXXXXXXXX</ns1:clientCustomerId>
            <ns1:developerToken>XXXXXXXX</ns1:developerToken>
            <ns1:userAgent>XXXXXX (AwApi-Java, AdWords-Axis/2.2.0, Common-Java/2.2.0, Axis/1.4, Java/1.7.0-google-v6, maven)</ns1:userAgent>
            <ns1:validateOnly>false</ns1:validateOnly>
            <ns1:partialFailure>false</ns1:partialFailure>
        </ns1:RequestHeader>
    </soapenv:Header>
    <soapenv:Body>
            <operations>
                <operator>ADD</operator>
                <operand>
                    <campaignId>XXXXXXXXXX</campaignId>
                    <criterion xmlns:ns2="https://adwords.google.com/api/adwords/cm/v201506" xsi:type="ns2:Language">
                        <ns2:id>1019</ns2:id>
                    </criterion>
                </operand>
            </operations>
        </mutate>
    </soapenv:Body>
</soapenv:Envelope>

If your request was successful, you should get SOAP response similar to this:

<?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/v201506">
            <requestId>XXXXXXXXXXXXX</requestId>
            <serviceName>CampaignCriterionService</serviceName>
            <methodName>mutate</methodName>
            <operations>1</operations>
            <responseTime>130</responseTime>
        </ResponseHeader>
    </soap:Header>
    <soap:Body>
        <mutateResponse xmlns="https://adwords.google.com/api/adwords/cm/v201506">
            <rval>
                <ListReturnValue.Type>CampaignCriterionReturnValue</ListReturnValue.Type>
                <value>
                    <campaignId>XXXXXXX</campaignId>
                    <isNegative>false</isNegative>
                    <criterion xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="Language">
                        <id>1019</id>
                        <type>LANGUAGE</type>
                        <Criterion.Type>Language</Criterion.Type>
                        <code>ar</code>
                        <name>Arabic</name>
                    </criterion>
                    <CampaignCriterion.Type>CampaignCriterion</CampaignCriterion.Type>
                </value>
            </rval>
        </mutateResponse>
    </soap:Body>
</soap:Envelope>

jona...@garagecoders.net

unread,
Sep 15, 2015, 6:23:47 PM9/15/15
to AdWords API Forum
Thanks, now I'm able to update the language, first I remove the previous language and after I add a new one, ir order to update the location or the platform, do I need to do the same ?, first delete the previous location and after add the new one ? 
and the same for platform ? 
thanks.

Anthony Madrigal

unread,
Sep 16, 2015, 9:53:08 AM9/16/15
to AdWords API Forum
Hi Jonathan,

Yes, in order to "update" a Location, you will first need to REMOVE the previous location then ADD a new one. However, for Platforms, all you need to do is use the SET operator.
Reply all
Reply to author
Forward
0 new messages