Updating Feed Attributes (related to Upgraded URLs)

116 views
Skip to first unread message

Stacie Waleyko

unread,
May 23, 2015, 12:12:34 AM5/23/15
to adwor...@googlegroups.com
Hello,

We are working on migrating our sitelinks to use upgraded URLs. We are using feed services to create sitelinks with link text going in attribute #1 and the URL in attribute #2. New sitelinks are created with upgraded URLs that are stored with attribute #2 (attribute #2 is of type URL_LIST). For old sitelinks that have destination URLs attribute #2 is of type URL. Ideally we would like to maintain consistency across the system and have attribute #2 always correspond to an upgraded URL for *both* new and migrated sitelinks. To migrate old sitelinks I tried to change attribute #2 from URL to URL_LIST but I got an error. Is there any way to edit a FeedAttribute? The only other way we could maintain consistency in our system would be to create an additional attribute. Attribute #2 would have to always be of type URL for the old destination URLs and then there would be a new attribute #3 of type URL_LIST. This could work but I'm worried the URL type might one day sunset since destination URLs are no longer being supported. What is the best way to approach this? Also, I was not able to find a guide for migrating sitelinks with feed services. Any documentation on this would be greatly appreciated.

Thanks,

Stacie



The feed I'm trying to edit:

2015-05-22 20:33:24,698 [P2T1] INFO  c.g.a.a.a.l.c.A.soapXmlLogger - SOAP 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/v201502">
            <requestId>000516b770aedad90ab64ea1d40034a7</requestId>
            <serviceName>FeedService</serviceName>
            <methodName>get</methodName>
            <operations>0</operations>
            <responseTime>214</responseTime>
        </ResponseHeader>
    </soap:Header>
    <soap:Body>
        <getResponse xmlns="https://adwords.google.com/api/adwords/cm/v201502">
            <rval>
                <totalNumEntries>1</totalNumEntries>
                <Page.Type>FeedPage</Page.Type>
                <entries>
                    <id>26292527</id>
                    <name>SiteLinkExtension</name>
                    <attributes>
                        <id>1</id>
                        <name>linkText</name>
                        <type>STRING</type>
                        <isPartOfKey>false</isPartOfKey>
                    </attributes>
                    <attributes>
                        <id>2</id>
                        <name>siteLinkUrl</name>
                        <type>URL</type>
                        <isPartOfKey>false</isPartOfKey>
                    </attributes>

                    <status>ENABLED</status>
                    <origin>USER</origin>
                </entries>
            </rval>
        </getResponse>
    </soap:Body>
</soap:Envelope>



SOAP request/response for trying to update attribute #2:



<?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/v201502" soapenv:mustUnderstand="0">
            <ns1:clientCustomerId>redacted</ns1:clientCustomerId>
            <ns1:developerToken>redacted</ns1:developerToken>
            <ns1:userAgent>redacted</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/v201502">
            <operations>
                <operator>SET</operator>
                <operand>
                    <id>26292527</id>
                    <name>SiteLinkExtension</name>
                    <attributes>
                        <id>1</id>
                        <name>linkText</name>
                        <type>STRING</type>
                        <isPartOfKey>false</isPartOfKey>
                    </attributes>
                    <attributes>
                        <id>2</id>
                        <name>siteLinkUrl</name>
                        <type>URL_LIST</type>
                        <isPartOfKey>false</isPartOfKey>
                    </attributes>

                    <status>ENABLED</status>
                    <origin>USER</origin>
                </operand>
            </operations>
        </mutate>
    </soapenv:Body>
</soapenv:Envelope>

2015-05-22 20:34:58,293 [P2T1] WARN  c.g.a.a.a.l.c.A.soapXmlLogger - SOAP 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/v201502">
            <requestId>000516b776477cc00abfb9c2160046b0</requestId>
            <serviceName>FeedService</serviceName>
            <methodName>mutate</methodName>
            <operations>0</operations>
            <responseTime>89</responseTime>
        </ResponseHeader>
    </soap:Header>
    <soap:Body>
        <soap:Fault>
            <faultcode>soap:Server</faultcode>
            <faultstring>[FeedError.ATTRIBUTES_DO_NOT_MATCH_EXISTING_ATTRIBUTES @ operations[0].operand.attributes]</faultstring>
            <detail>
                <ApiExceptionFault xmlns="https://adwords.google.com/api/adwords/cm/v201502">
                    <message>[FeedError.ATTRIBUTES_DO_NOT_MATCH_EXISTING_ATTRIBUTES @ operations[0].operand.attributes]</message>
                    <ApplicationException.Type>ApiException</ApplicationException.Type>
                    <errors xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="FeedError">
                        <fieldPath>operations[0].operand.attributes</fieldPath>
                        <trigger/>
                        <errorString>FeedError.ATTRIBUTES_DO_NOT_MATCH_EXISTING_ATTRIBUTES</errorString>
                        <ApiError.Type>FeedError</ApiError.Type>
                        <reason>ATTRIBUTES_DO_NOT_MATCH_EXISTING_ATTRIBUTES</reason>
                    </errors>
                </ApiExceptionFault>
            </detail>
        </soap:Fault>
    </soap:Body>
</soap:Envelope>




Josh Radcliff (AdWords API Team)

unread,
May 26, 2015, 1:22:02 PM5/26/15
to adwor...@googlegroups.com, stacie.wa...@gmail.com
Hi Stacie,

You can only add attributes to a Feed. You won't be able to modify existing attributes of a Feed, e.g., you won't be able to change their types.

I would recommend against relying on specific attribute IDs always being of a specific type. In particular, feeds created by the AdWords system offer no guarantees about which attribute ID will be used for each placeholder field. A better solution would be to use the FeedMapping.attributeFieldMappings to look up the feedAttributeId that corresponds to each placeholder fieldId.

Regarding migrating to extension settings, please check out our Migration Guide, which includes links to code examples in each language.

Thanks,
Josh, AdWords API Team 

Stacie Waleyko

unread,
May 26, 2015, 2:24:33 PM5/26/15
to adwor...@googlegroups.com, stacie.wa...@gmail.com
Hi Josh,

Thanks for the detailed response. Agreed that the best way is to use the attribute field mapping to figure out which placeholder field the attribute corresponds to. We create all our extensions with feed services (we don't use any extensions created by the AdWords UI/system) so it would have been nice to maintain that level of consistency across accounts.

Thank you for the migration guide for extension settings. While we would very much like to migrate to extension settings we have invested a lot of energy in creating a system that works with feed services and currently do not have the resources to migrate to extension settings. Hopefully we can do this in the future. I was mainly looking for a guide to update sitelinks using feed services (not extension settings) but I'm fairly certain that doesn't exist.

Thanks again,

Stacie

Josh Radcliff (AdWords API Team)

unread,
May 26, 2015, 3:17:27 PM5/26/15
to adwor...@googlegroups.com, stacie.wa...@gmail.com
Hi Stacie,

Sorry, I misread your question on migrations. Unfortunately, we don't have a guide specifically on using feed services to migrate to upgraded URLs. The closest example we have is the AddSiteLinksUsingFeeds.java example, which you may be able to modify to:
  • Add attributes to your Feed for the upgraded URL fields
  • Remove your existing FeedMapping and replace it with a new FeedMapping that includes the upgraded URL fields
  • Update your FeedItems, populating the new upgraded URL fields
Cheers,
Josh, AdWords API Team

Stacie Waleyko

unread,
May 26, 2015, 3:55:09 PM5/26/15
to adwor...@googlegroups.com, stacie.wa...@gmail.com
Hi Josh,

Thank you for the pointers! It sounds like I am heading down the right track :-)

Thanks,

Stacie
Reply all
Reply to author
Forward
0 new messages