AdGroupAdService not returning all fields for Expanded Text Ads

264 views
Skip to first unread message

Yaakov Gesher

unread,
Jul 5, 2016, 1:29:29 PM7/5/16
to AdWords API Forum
I'm trying to switch to the latest version of the API, and we have some expanded text ads already live (added via the web interface), but when I try to download their data, the Ad object doesn't have any url fields.  Is there some known reason for this?

Shwetha Vastrad (AdWords API Team)

unread,
Jul 6, 2016, 4:04:11 PM7/6/16
to AdWords API Forum
Hi Yaakov,

Expanded text ads do not use url, displayUrl or finalAppUrls fields. You need to use the finalUrlspath1, and path2 fields to get the URLs associated with the Ad.

Regards,
Shwetha, AdWords API Team.

Yaakov Gesher

unread,
Jul 6, 2016, 5:03:04 PM7/6/16
to AdWords API Forum
Swetha, thanks for your attention, but as I stated above, but none of those fields don't appear at all when I perform a download.
Message has been deleted

Gabriel Abadi

unread,
Jul 6, 2016, 5:49:47 PM7/6/16
to AdWords API Forum
I'm having the same issue. If i ask for the url i don't get it in the response:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <soapenv:Header>
        <ns1:RequestHeader xmlns:ns1="https://adwords.google.com/api/adwords/cm/v201605" soapenv:mustUnderstand="0">
            <ns1:clientCustomerId>4476618128</ns1:clientCustomerId>
            <ns1:developerToken>REDACTED</ns1:developerToken>
            <ns1:userAgent>something (AwApi-Java, AdWords-Axis/2.15.0, Common-Java/2.15.0, Axis/1.4, Java/1.8.0_65, maven, SelectorBuilder, SelectorField)</ns1:userAgent>
            <ns1:validateOnly>false</ns1:validateOnly>
            <ns1:partialFailure>true</ns1:partialFailure>
        </ns1:RequestHeader>
    </soapenv:Header>
    <soapenv:Body>
            <serviceSelector>
                <fields>Id</fields>
                <fields>Status</fields>
                <fields>HeadlinePart1</fields>
                <fields>HeadlinePart2</fields>
                <fields>Description</fields>
                <fields>Path1</fields>
                <fields>Path2</fields>
                <fields>Urls</fields>
                <fields>DevicePreference</fields>
                <fields>AdGroupId</fields>
                <predicates>
                    <field>CampaignId</field>
                    <operator>IN</operator>
                    <values>|| campaign number ||</values>
                </predicates>
                <predicates>
                    <field>AdType</field>
                    <operator>EQUALS</operator>
                    <values>EXPANDED_TEXT_AD</values>
                </predicates>
                <paging>
                    <numberResults>10000</numberResults>
                </paging>
            </serviceSelector>
        </get>
    </soapenv:Body>
</soapenv:Envelope>

2016/07/06 14:39:12 INFO logging.AdsServiceLoggers: 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/v201605">
            <requestId>000536fb0c20fd080a379bcc2d017d1d</requestId>
            <serviceName>AdGroupAdService</serviceName>
            <methodName>get</methodName>
            <operations>1</operations>
            <responseTime>339</responseTime>
        </ResponseHeader>
    </soap:Header>
    <soap:Body>
        <getResponse xmlns="https://adwords.google.com/api/adwords/cm/v201605">
            <rval>
                <totalNumEntries>1</totalNumEntries>
                <Page.Type>AdGroupAdPage</Page.Type>
                <entries>
                    <adGroupId>31098386962</adGroupId>
                    <ad xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ExpandedTextAd">
                        <id>101250493282</id>
                        <type>EXPANDED_TEXT_AD</type>
                        <Ad.Type>ExpandedTextAd</Ad.Type>
                        <headlinePart1> || part 1 || </headlinePart1>
                        <headlinePart2> || part 2 || </headlinePart2>
                        <description> || description || </description>
                        <path1> || path 1 || </path1>
                        <path2> || part 2 || </path2>
                    </ad>
                    <status>ENABLED</status>
                    <approvalStatus>FAMILY_SAFE</approvalStatus>
                    <trademarkDisapproved>false</trademarkDisapproved>
                </entries>
            </rval>
        </getResponse>
    </soap:Body>
</soap:Envelope>


In the other hand if i ask for final url i get this:

    <soapenv:Header>
        <ns1:RequestHeader xmlns:ns1="https://adwords.google.com/api/adwords/cm/v201605" soapenv:mustUnderstand="0">
            <ns1:clientCustomerId>4476618128</ns1:clientCustomerId>
            <ns1:developerToken>REDACTED</ns1:developerToken>
            <ns1:userAgent>something (AwApi-Java, AdWords-Axis/2.15.0, Common-Java/2.15.0, Axis/1.4, Java/1.8.0_65, maven, SelectorBuilder, SelectorField)</ns1:userAgent>
            <ns1:validateOnly>false</ns1:validateOnly>
            <ns1:partialFailure>true</ns1:partialFailure>
        </ns1:RequestHeader>
    </soapenv:Header>
    <soapenv:Body>
            <serviceSelector>
                <fields>Id</fields>
                <fields>Status</fields>
                <fields>HeadlinePart1</fields>
                <fields>HeadlinePart2</fields>
                <fields>Description</fields>
                <fields>Path1</fields>
                <fields>Path2</fields>
                <fields>FinalUrl</fields>
                <fields>DevicePreference</fields>
                <fields>AdGroupId</fields>
                <predicates>
                    <field>CampaignId</field>
                    <operator>IN</operator>
                    <values>622217410</values>
                </predicates>
                <predicates>
                    <field>AdType</field>
                    <operator>EQUALS</operator>
                    <values>EXPANDED_TEXT_AD</values>
                </predicates>
                <paging>
                    <numberResults>10000</numberResults>
                </paging>
            </serviceSelector>
        </get>
    </soapenv:Body>
</soapenv:Envelope>

2016/07/06 14:47:14 WARN logging.AdsServiceLoggers: 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/v201605">
            <requestId>000536fb28ddccc90a37c3cb380a8236</requestId>
            <serviceName>AdGroupAdService</serviceName>
            <methodName>get</methodName>
            <operations>1</operations>
            <responseTime>137</responseTime>
        </ResponseHeader>
    </soap:Header>
    <soap:Body>
        <soap:Fault>
            <faultcode>soap:Server</faultcode>
            <faultstring>[SelectorError.INVALID_FIELD_NAME @ serviceSelector; trigger:'FinalUrl']</faultstring>
            <detail>
                <ApiExceptionFault xmlns="https://adwords.google.com/api/adwords/cm/v201605">
                    <message>[SelectorError.INVALID_FIELD_NAME @ serviceSelector; trigger:'FinalUrl']</message>
                    <ApplicationException.Type>ApiException</ApplicationException.Type>
                    <errors xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="SelectorError">
                        <fieldPath>serviceSelector</fieldPath>
                        <trigger>FinalUrl</trigger>
                        <errorString>SelectorError.INVALID_FIELD_NAME</errorString>
                        <ApiError.Type>SelectorError</ApiError.Type>
                        <reason>INVALID_FIELD_NAME</reason>
                    </errors>
                </ApiExceptionFault>
            </detail>
        </soap:Fault>
    </soap:Body>
</soap:Envelope>

If you need it, this is the response for final urls

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Header>
        <ResponseHeader xmlns="https://adwords.google.com/api/adwords/cm/v201605">
            <requestId>000536fb2904b5b80a37ccc73a026984</requestId>
            <serviceName>AdGroupAdService</serviceName>
            <methodName>get</methodName>
            <operations>1</operations>
            <responseTime>137</responseTime>
        </ResponseHeader>
    </soap:Header>
    <soap:Body>
        <soap:Fault>
            <faultcode>soap:Server</faultcode>
            <faultstring>[SelectorError.INVALID_FIELD_NAME @ serviceSelector; trigger:'FinalUrls']</faultstring>
            <detail>
                <ApiExceptionFault xmlns="https://adwords.google.com/api/adwords/cm/v201605">
                    <message>[SelectorError.INVALID_FIELD_NAME @ serviceSelector; trigger:'FinalUrls']</message>
                    <ApplicationException.Type>ApiException</ApplicationException.Type>
                    <errors xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="SelectorError">
                        <fieldPath>serviceSelector</fieldPath>
                        <trigger>FinalUrls</trigger>
                        <errorString>SelectorError.INVALID_FIELD_NAME</errorString>
                        <ApiError.Type>SelectorError</ApiError.Type>
                        <reason>INVALID_FIELD_NAME</reason>
                    </errors>
                </ApiExceptionFault>
            </detail>
        </soap:Fault>
    </soap:Body>
</soap:Envelope>

Thanks in advance

Shwetha Vastrad (AdWords API Team)

unread,
Jul 6, 2016, 8:55:36 PM7/6/16
to AdWords API Forum
Hi Yaakov and Gabriel,

You need to use CreativeFinalUrls, Path1 and Path2 in the selector to get URL related data for Expanded Text Ads using AdGroupAdService.

Yaakov Gesher

unread,
Jul 10, 2016, 9:07:45 AM7/10/16
to AdWords API Forum
Thanks to your persistence, I got this working now!  

But the documentation is quite unclear, and the API is inconsistent: for regular text ads, the url field is part of the Ad object, without having to request any specific fields.  The API docs do not even make that much clear, and for expanded text ads, there is a note that don't use the displayUrl field, but not that you need to request the url fields specifically.  This could use some attention...

Shwetha Vastrad (AdWords API Team)

unread,
Jul 11, 2016, 6:20:22 PM7/11/16
to AdWords API Forum
Hi Yaakov,

Glad to hear that you got it working. Depending on the values you pass to the selector, some fields may not be populated in the returned Ad object. This document lists all the selectable fields and the corresponding objects they populate. This will come in handy when you are working with other API objects too. 

I hope this helps. 
Reply all
Reply to author
Forward
0 new messages