Failed to upload MoneyWithCurrency data

32 views
Skip to first unread message

Feiran Yang

unread,
Dec 5, 2018, 6:02:29 PM12/5/18
to AdWords API and Google Ads API Forum
Hello, I tried to upload some dummy data to test api call for AdCustomizer, everything worked except for type PRICE:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <soapenv:Header>
        <ns1:RequestHeader xmlns:ns1="https://adwords.google.com/api/adwords/cm/v201809" soapenv:mustUnderstand="0">
            <ns1:clientCustomerId>403-422-6537</ns1:clientCustomerId>
            <ns1:developerToken>REDACTED</ns1:developerToken>
            <ns1:userAgent>unknown (AwApi-Java, AdWords-Axis/4.1.0, Common-Java/4.1.0, Axis/1.4, Java/1.8.0_181, maven, SelectorBuilder, SelectorField)</ns1:userAgent>
            <ns1:validateOnly>false</ns1:validateOnly>
            <ns1:partialFailure>false</ns1:partialFailure>
        </ns1:RequestHeader>
    </soapenv:Header>
    <soapenv:Body>
            <selector>
                <fields>FeedId</fields>
                <fields>FeedName</fields>
                <fields>FeedAttributes</fields>
                <predicates>
                    <field>FeedId</field>
                    <operator>EQUALS</operator>
                    <values>85262722</values>
                </predicates>
            </selector>
        </get>
    </soapenv:Body>
</soapenv:Envelope>

11:40:58.603 [main] DEBUG 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/v201809">
            <requestId>00057c440475b6c80a371798270e8d7f</requestId>
            <serviceName>AdCustomizerFeedService</serviceName>
            <methodName>get</methodName>
            <operations>1</operations>
            <responseTime>398</responseTime>
        </ResponseHeader>
    </soap:Header>
    <soap:Body>
        <getResponse xmlns="https://adwords.google.com/api/adwords/cm/v201809">
            <rval>
                <totalNumEntries>1</totalNumEntries>
                <Page.Type>AdCustomizerFeedPage</Page.Type>
                <entries>
                    <feedId>85262722</feedId>
                    <feedName>feedName23</feedName>
                    <feedAttributes>
                        <id>1</id>
                        <name>location</name>
                        <type>STRING</type>
                    </feedAttributes>
                    <feedAttributes>
                        <id>2</id>
                        <name>provider_count</name>
                        <type>STRING</type>
                    </feedAttributes>
                    <feedAttributes>
                        <id>3</id>
                        <name>kw_subvertical</name>
                        <type>STRING</type>
                    </feedAttributes>
                    <feedAttributes>
                        <id>4</id>
                        <name>average price</name>
                        <type>PRICE</type>
                    </feedAttributes>
                </entries>
            </rval>
        </getResponse>
    </soap:Body>
</soap:Envelope>

11:40:58.603 [main] INFO com.care.inteligencia.server.AddAdCustomizer - Successfully updated feed item with adCustomizerFeed id: 85262722, adCustomizerFeed name: AdCustomizerFeedAttribute{id=4, name=average price, type=PRICE}
11:40:58.608 [main] INFO com.care.inteligencia.server.service.GoogleAdsWordsService - currency MoneyWithCurrency{currencyCode=EUR, money=Money{microAmount=200000000}}
11:40:59.132 [main] INFO com.google.api.ads.adwords.lib.client.AdWordsServiceClient.requestInfoLogger - Request made: Service: FeedItemService Method: mutate clientCustomerId: 403-422-6537 URL: https://adwords.google.com/api/adwords/cm/v201809/FeedItemService Request ID: 00057c44048153710a3735d1d50b21b0 ResponseTime(ms): 263 OperationsCount: 1 IsFault: false FaultMessage: null
11:40:59.138 [main] DEBUG com.google.api.ads.adwords.lib.client.AdWordsServiceClient.soapXmlLogger - SOAP request:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <soapenv:Header>
        <ns1:RequestHeader xmlns:ns1="https://adwords.google.com/api/adwords/cm/v201809" soapenv:mustUnderstand="0">
            <ns1:clientCustomerId>403-422-6537</ns1:clientCustomerId>
            <ns1:developerToken>REDACTED</ns1:developerToken>
            <ns1:userAgent>unknown (AwApi-Java, AdWords-Axis/4.1.0, Common-Java/4.1.0, Axis/1.4, Java/1.8.0_181, maven)</ns1:userAgent>
            <ns1:validateOnly>false</ns1:validateOnly>
            <ns1:partialFailure>false</ns1:partialFailure>
        </ns1:RequestHeader>
    </soapenv:Header>
    <soapenv:Body>
            <operations>
                <operator>SET</operator>
                <operand>
                    <feedId>85262722</feedId>
                    <feedItemId>55414680813</feedItemId>
                    <attributeValues>
                        <feedAttributeId>1</feedAttributeId>
                        <stringValue>Munich</stringValue>
                    </attributeValues>
                    <attributeValues>
                        <feedAttributeId>2</feedAttributeId>
                        <stringValue>4256</stringValue>
                    </attributeValues>
                    <attributeValues>
                        <feedAttributeId>3</feedAttributeId>
                        <stringValue>Putzfrauen</stringValue>
                    </attributeValues>
                    <attributeValues>
                        <feedAttributeId>4</feedAttributeId>
                        <moneyWithCurrencyValue>
                            <money>
                                <microAmount>200000000</microAmount>
                            </money>
                            <currencyCode>EUR</currencyCode>
                        </moneyWithCurrencyValue>
                    </attributeValues>
                </operand>
            </operations>
        </mutate>
    </soapenv:Body>
</soapenv:Envelope>

11:40:59.138 [main] DEBUG 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/v201809">
            <requestId>00057c44048153710a3735d1d50b21b0</requestId>
            <serviceName>FeedItemService</serviceName>
            <methodName>mutate</methodName>
            <operations>1</operations>
            <responseTime>263</responseTime>
        </ResponseHeader>
    </soap:Header>
    <soap:Body>
        <mutateResponse xmlns="https://adwords.google.com/api/adwords/cm/v201809">
            <rval>
                <ListReturnValue.Type>FeedItemReturnValue</ListReturnValue.Type>
                <value>
                    <feedId>85262722</feedId>
                    <feedItemId>55414680813</feedItemId>
                    <status>ENABLED</status>
                    <attributeValues>
                        <feedAttributeId>1</feedAttributeId>
                        <stringValue>Munich</stringValue>
                    </attributeValues>
                    <attributeValues>
                        <feedAttributeId>2</feedAttributeId>
                        <stringValue>4256</stringValue>
                    </attributeValues>
                    <attributeValues>
                        <feedAttributeId>3</feedAttributeId>
                        <stringValue>Putzfrauen</stringValue>
                    </attributeValues>
                </value>
            </rval>
        </mutateResponse>
    </soap:Body>
</soap:Envelope>

In the uploaded feed file, that price column is empty:

Screen Shot 2018-12-05 at 11.52.31.png


Why it didn't work? Or did I miss something in the codes? I created a MoneyWithCurrency object like this:
MoneyWithCurrency price = new MoneyWithCurrency();
Money money = new Money();
money.setMicroAmount(200000000L);
price.setMoney(money);
price.setCurrencyCode("EUR");

Thanks in advance for your help!

Luis Xander Talag (AdWords API Team)

unread,
Dec 5, 2018, 10:18:16 PM12/5/18
to AdWords API and Google Ads API Forum
Hi Feiran,

Thank you for providing detailed information on your concern. Based on your SOAP logs, I noticed that you use moneyWithCurrencyValue as value to your PRICE. You should take note that the data type for AdCustomizerFeedAttribute.Type PRICE should be STRING and not monetary value. I would suggest to refer to this guide with complete sample code in Java for creating Ad customizers.

Let me know if it works.

Thanks and regards,
Luis
AdWords API Team

Feiran Yang

unread,
Dec 20, 2018, 9:41:21 AM12/20/18
to AdWords API and Google Ads API Forum
Hi Luis, 

Thanks for your reply, it works now according to your solution. Also I was wondering if I could change the type of existing AdCustomizerFeedAttribute? I didn't find it in the code sample and I tried to update it the same way I updated FeedItem, unfortunately it didn't work.

Regards,
Feiran

Luis Xander Talag (AdWords API Team)

unread,
Dec 21, 2018, 1:05:34 AM12/21/18
to AdWords API and Google Ads API Forum
Hi Feiran,

I'm afraid there is no way to update the existing AdCustomizerFeedAttribute via the API as this field is also not mutable via the Google Ads UI. However,  you could add a new object of AdCustomizerFeedAttribute using the API.

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