Adwords API returns Sitelinks errors for other objects

125 views
Skip to first unread message

Wesley Bowman

unread,
Jun 4, 2019, 5:16:00 AM6/4/19
to AdWords API and Google Ads API Forum
I am sending a batch job through the Adwords API with the following operations:

[
   
{
       
'operand': {
           
'adGroupId': 68069102381,
           
'extensionType': 'SITELINK',
           
'extensionSetting': {
               
'extensions': [
                   
{
                       
'xsi_type': 'SitelinkFeedItem',
                       
'sitelinkText': '008642-74-86 really long field to make all the things fail',
                       
'sitelinkLine2': '008642-74-86 really long field to make all the things fail',
                       
'sitelinkLine3': 'stuff',
                       
'sitelinkFinalUrls': {'urls': ['https://channable.com']},
                   
}
               
]
           
},
       
},
       
'operator': 'ADD',
       
'xsi_type': 'AdGroupExtensionSettingOperation',
   
},
   
{
       
'operand': {
           
'ad': {
               
'id': -2,
               
'path1': '',
               
'path2': '',
               
'xsi_type': 'ExpandedTextAd',
               
'finalUrls': 'https://channable.com',
               
'description': 'd1',
               
'description2': 'd2',
               
'headlinePart1': 'h1',
               
'headlinePart2': 'h2',
               
'headlinePart3': 'h3',
           
},
           
'status': 'ENABLED',
           
'xsi_type': 'AdGroupAd',
           
'adGroupId': 68069102381,
       
},
       
'operator': 'ADD',
       
'xsi_type': 'AdGroupAdOperation',
   
},
]

The batch job id I got for this was:
1488888306

This batch job's results were the following:

[OrderedDict([('errorList',
               
OrderedDict([('errors',
                             
[OrderedDict([('@xmlns:xsi',
                                           
'http://www.w3.org/2001/XMLSchema-instance'),
                                           
('@xsi:type', 'StringLengthError'),
                                           
('fieldPath',
                                           
'operations[0].operand.extensionSetting.extensions[0].sitelinkText'),
                                           
('fieldPathElements',
                                           
[OrderedDict([('field',
                                                           
'operations'),
                                                         
('index', '0')]),
                                             
OrderedDict([('field',
                                                           
'operand')]),
                                             
OrderedDict([('field',
                                                           
'extensionSetting')]),
                                             
OrderedDict([('field',
                                                           
'extensions'),
                                                         
('index', '0')]),
                                             
OrderedDict([('field',
                                                           
'sitelinkText')])]),
                                           
('trigger', None),
                                           
('errorString',
                                           
'StringLengthError.TOO_LONG'),
                                           
('ApiError.Type',
                                           
'StringLengthError'),
                                           
('reason', 'TOO_LONG')]),
                             
OrderedDict([('@xmlns:xsi',
                                           
'http://www.w3.org/2001/XMLSchema-instance'),
                                           
('@xsi:type', 'StringLengthError'),
                                           
('fieldPath',
                                           
'operations[0].operand.extensionSetting.extensions[0].sitelinkLine2'),
                                           
('fieldPathElements',
                                           
[OrderedDict([('field',
                                                           
'operations'),
                                                         
('index', '0')]),
                                             
OrderedDict([('field',
                                                           
'operand')]),
                                             
OrderedDict([('field',
                                                           
'extensionSetting')]),
                                             
OrderedDict([('field',
                                                           
'extensions'),
                                                         
('index', '0')]),
                                             
OrderedDict([('field',
                                                           
'sitelinkLine2')])]),
                                           
('trigger', None),
                                           
('errorString',
                                           
'StringLengthError.TOO_LONG'),
                                           
('ApiError.Type',
                                           
'StringLengthError'),
                                           
('reason', 'TOO_LONG')])])])),
             
('index', '0')]),
 
OrderedDict([('errorList',
               
OrderedDict([('errors',
                             
[OrderedDict([('@xmlns:xsi',
                                           
'http://www.w3.org/2001/XMLSchema-instance'),
                                           
('@xsi:type', 'StringLengthError'),
                                           
('fieldPath',
                                           
'operations[1].operand.extensionSetting.extensions[0].sitelinkLine2'),
                                           
('fieldPathElements',
                                           
[OrderedDict([('field',
                                                           
'operations'),
                                                         
('index', '1')]),
                                             
OrderedDict([('field',
                                                           
'operand')]),
                                             
OrderedDict([('field',
                                                           
'extensionSetting')]),
                                             
OrderedDict([('field',
                                                           
'extensions'),
                                                         
('index', '0')]),
                                             
OrderedDict([('field',
                                                           
'sitelinkLine2')])]),
                                           
('trigger', None),
                                           
('errorString',
                                           
'StringLengthError.TOO_LONG'),
                                           
('ApiError.Type',
                                           
'StringLengthError'),
                                           
('reason', 'TOO_LONG')]),
                             
OrderedDict([('@xmlns:xsi',
                                           
'http://www.w3.org/2001/XMLSchema-instance'),
                                           
('@xsi:type', 'StringLengthError'),
                                           
('fieldPath',
                                           
'operations[1].operand.extensionSetting.extensions[0].sitelinkText'),
                                           
('fieldPathElements',
                                           
[OrderedDict([('field',
                                                           
'operations'),
                                                         
('index', '1')]),
                                             
OrderedDict([('field',
                                                           
'operand')]),
                                             
OrderedDict([('field',
                                                           
'extensionSetting')]),
                                             
OrderedDict([('field',
                                                           
'extensions'),
                                                         
('index', '0')]),
                                             
OrderedDict([('field',
                                                           
'sitelinkText')])]),
                                           
('trigger', None),
                                           
('errorString',
                                           
'StringLengthError.TOO_LONG'),
                                           
('ApiError.Type',
                                           
'StringLengthError'),
                                           
('reason', 'TOO_LONG')])])])),
             
('index', '1')])]


So, even though I create a valid ad, I am getting an error for the ad that references the sitelink. This ad does not get created in the adwords account.

If I try a similar batch job with just the ad and no sitelink, I get no problems. We just started noticing this problem recently. Any idea what is going on here?

Google Ads API Forum Advisor Prod

unread,
Jun 4, 2019, 4:29:01 PM6/4/19
to adwor...@googlegroups.com
Hello Wesley,

As specified here, the sitelinkText should be between 1 and 25, inclusive and sitelinkLine2 should be between 0 and 35, inclusive. In your code both fields are exceeding those limits hence you are facing the error. Please correct them and give it a try. 

Regards,
Sai Teja, Google Ads API Team

ref:_00D1U1174p._5001UBlPtt:ref

Wesley Bowman

unread,
Jun 5, 2019, 3:52:46 AM6/5/19
to AdWords API and Google Ads API Forum
Hello Sai,

The point here is that in the batch job I am trying to create an invalid sitelink, but a valid ad.
If I send both of these objects in the same batch job, then the ad also gets the sitelink error, even though that operation has nothing to do with the sitelink. I can comfirm this because if I send the ad in a batch job on its own, then I can successfully create the ad.

Do you know why this might be happening?

Also note that in this case I am purposefully sending an invalid sitelink to replicate this issue. 

Google Ads API Forum Advisor Prod

unread,
Jun 5, 2019, 4:24:54 PM6/5/19
to adwor...@googlegroups.com
Hello Wesley,

Could you please confirm whether the partialFailure field is enabled for your API call?  If not it is expected that the correct operation will also be failed due to the other erroneous operations. Please enable Partial Failures in your API call to let correct AdGroupAd operation to succeed. Let me know if you have any further questions.

Wesley Bowman

unread,
Jun 6, 2019, 1:28:28 AM6/6/19
to AdWords API and Google Ads API Forum
Hi Sai,

We indeed have partial failures enabled.
I haven't seen this issues with any other types of errors, only for sitelinks (i.e. if I have 2 ad operations and one is a failure, then I only get one error while the other succeeds)

Google Ads API Forum Advisor Prod

unread,
Jun 6, 2019, 11:13:58 AM6/6/19
to adwor...@googlegroups.com
Hello Wesley,

I see that you are performing AdGroupExtensionSettingOperation and AdGroupAdOperation which should be performed with 2 different services AdGroupExtensionSettingService and AdGroupAdService. In such two API calls should be done.

In my testing I tried to add 2 operations with two extension settings and I was able to add one operation while the operation is internally kept too long. Since I enabled partial failures to true I was able to perform one operation successfully and the other operation failed. To get more clarity on your API request. I require the SOAP logs of the failed operations. You can enable logging by following the logging section in the Readme.md file in the client library of your choice. 

Wesley Bowman

unread,
Jun 7, 2019, 2:03:31 AM6/7/19
to AdWords API and Google Ads API Forum
I see that you are performing
AdGroupExtensionSettingOperation and AdGroupAdOperation which should be performed with 2 different services AdGroupExtensionSettingService and AdGroupAdService. In such two API calls should be done.

Again, I am using a Batch Job to send these operations. This uses the BatchJobService. If you look at the operations I posted in the initial post, you will find that I do specify both the AdGroupExtensionSettingService and the AdGroupAdService as the xsi_type of each operation. We send all of our operations via the BatchJobService, and haven't been seeing any issues except for the ones I described above. As a reminder, the issue we are seeing is specifically if we send an invalid sitelinks operation and any other operation in the same batch job. When this happens, we get sitelink's errors for the objects that are not sitelinks (in my example, for an ad).

To give you as much information as possible, I tried pushing the same operations again (I obtained the same result as well), but this time I enabled the SOAP logs. Because I pushed again, I have a new batch job and therefore a new batch job id.

batch job id = 1501998529

What follows is the SOAP logs for the operations and response that I posted in the initial post:

[2019-06-07 07:44:14,029 - googleads.soap - INFO] Request made: Service: "BatchJobService" Method: "mutate" URL: "https://adwords.google.com/api/adwords/cm/v201809/BatchJobService"
[2019-06-07 07:44:14,029 - googleads.soap - DEBUG] Outgoing request: {'SOAPAction': '""', 'Content-Type': 'text/xml; charset=utf-8', 'authorization': 'REDACTED'}
<soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/">
 
<soap-env:Header>
   
<ns0:RequestHeader xmlns:ns0="https://adwords.google.com/api/adwords/cm/v201809">
     
<ns0:clientCustomerId>2740564982</ns0:clientCustomerId>
      <ns0:developerToken>REDACTED</
ns0:developerToken>
     
<ns0:userAgent>channable (AwApi-Python, googleads/18.1.0, Python/3.6.7, zeep)</ns0:userAgent>
     
<ns0:validateOnly>false</ns0:validateOnly>
      <ns0:partialFailure>true</
ns0:partialFailure>
   
</ns0:RequestHeader>
  </
soap-env:Header>
 
<soap-env:Body>
   
<ns0:mutate xmlns:ns0="https://adwords.google.com/api/adwords/cm/v201809">
     
<ns0:operations>
       
<ns0:operator>ADD</ns0:operator>
        <ns0:operand/
>
     
</ns0:operations>
    </
ns0:mutate>
 
</soap-env:Body>
</
soap-env:Envelope>

[2019-06-07 07:44:14,830 - googleads.soap - DEBUG] Incoming response:
b
'<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">\n  <soap:Header>\n    <ResponseHeader xmlns="https://adwords.google.com/api/adwords/cm/v201809">\n      <requestId>00058ab55218d2cc02ab424a590ca754</requestId>\n      <serviceName>BatchJobService</serviceName>\n      <methodName>mutate</methodName>\n      <operations>1</operations>\n      <responseTime>146</responseTime>\n    </ResponseHeader>\n  </soap:Header>\n  <soap:Body>\n    <mutateResponse xmlns="https://adwords.google.com/api/adwords/cm/v201809">\n      <rval>\n        <ListReturnValue.Type>BatchJobReturnValue</ListReturnValue.Type>\n        <value>\n          <id>1501998529</id>\n          <status>AWAITING_FILE</status>\n          <uploadUrl>\n            <url>https://batch-job-upload-prod-ebe9b43.storage.googleapis.com/311377146/1501998529.operations.xml?GoogleAccessId=926043054183-rbu1gkdus...@developer.gserviceaccount.com&amp;Expires=1560491054&amp;Signature=n%2Fwk7W%2BUEs73lc3ne2YEmQDw1U8wlUHkHzPMj%2F6RRaiEHJ8AUSpPcuW9rY%2FjyFoYELxOlMGcyrLR8cwzNI%2BLL4AsOKCN01VnQe7V1NGD0axVhyY596%2FFNfqY2bW5xmivb9G7DrI7lO0MeuscmgiocDLKtiaahubfc2c%2FN%2B9Ah7w1Blq%2FyTB0xvI%2F1tA4Opx%2BvZjP7uPgwslq%2Fn1lMq2qodsi9FUO9fiHI2cFjKzdL8j28%2BV8iYgoRgT8hHzglubDX31hiiMHYfrR9odhmq%2BThYnziojPcCSE6uZrSkGBVoAyfQoAeL9ksz0MGj3VfRGaiglwF%2BAz9H0fTt5WFT7Dbw%3D%3D</url>\n            <expiration>20190614 074414 Europe/Amsterdam</expiration>\n          </uploadUrl>\n          <diskUsageQuotaBalance>1048576</diskUsageQuotaBalance>\n        </value>\n      </rval>\n    </mutateResponse>\n  </soap:Body>\n</soap:Envelope>\n'
[2019-06-07 07:44:15,871 - googleads.soap - INFO] Request made: Service: "AdGroupExtensionSettingService" Method: "mutate" URL: "https://adwords.google.com/api/adwords/cm/v201809/AdGroupExtensionSettingService"
[2019-06-07 07:44:15,871 - googleads.soap - DEBUG] Outgoing request: {'SOAPAction': '""', 'Content-Type': 'text/xml; charset=utf-8', 'authorization': 'REDACTED'}
<soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/">
 
<soap-env:Header>
   
<ns0:RequestHeader xmlns:ns0="https://adwords.google.com/api/adwords/cm/v201809">
     
<ns0:clientCustomerId>2740564982</ns0:clientCustomerId>
      <ns0:developerToken>REDACTED</
ns0:developerToken>
     
<ns0:userAgent>channable (AwApi-Python, googleads/18.1.0, Python/3.6.7, BatchJobHelper)</ns0:userAgent>
     
<ns0:validateOnly>false</ns0:validateOnly>
      <ns0:partialFailure>true</
ns0:partialFailure>
   
</ns0:RequestHeader>
  </
soap-env:Header>
 
<soap-env:Body>
   
<ns0:mutate xmlns:ns0="https://adwords.google.com/api/adwords/cm/v201809">
     
<ns0:operations>
       
<ns0:operator>ADD</ns0:operator>
        <ns0:Operation.Type>AdGroupExtensionSettingOperation</
ns0:Operation.Type>
       
<ns0:operand>
         
<ns0:adGroupId>68069102381</ns0:adGroupId>
          <ns0:extensionType>SITELINK</
ns0:extensionType>
         
<ns0:extensionSetting>
           
<ns0:extensions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns0:SitelinkFeedItem">
             
<ns0:ExtensionFeedItem.Type>SitelinkFeedItem</ns0:ExtensionFeedItem.Type>
              <ns0:sitelinkText>008642-74-86 really long field to make all the things fail</
ns0:sitelinkText>
             
<ns0:sitelinkLine2>008642-74-86 really long field to make all the things fail</ns0:sitelinkLine2>
              <ns0:sitelinkLine3>stuff</
ns0:sitelinkLine3>
             
<ns0:sitelinkFinalUrls>
               
<ns0:urls>https://channable.com</ns0:urls>
             
</ns0:sitelinkFinalUrls>
            </
ns0:extensions>
         
</ns0:extensionSetting>
        </
ns0:operand>
     
</ns0:operations>
    </
ns0:mutate>
 
</soap-env:Body>
</
soap-env:Envelope>

[2019-06-07 07:44:16,776 - googleads.soap - INFO] Request made: Service: "AdGroupAdService" Method: "mutate" URL: "https://adwords.google.com/api/adwords/cm/v201809/AdGroupAdService"
[2019-06-07 07:44:16,776 - googleads.soap - DEBUG] Outgoing request: {'SOAPAction': '""', 'Content-Type': 'text/xml; charset=utf-8', 'authorization': 'REDACTED'}
<soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/">
 
<soap-env:Header>
   
<ns0:RequestHeader xmlns:ns0="https://adwords.google.com/api/adwords/cm/v201809">
     
<ns0:clientCustomerId>2740564982</ns0:clientCustomerId>
      <ns0:developerToken>REDACTED</
ns0:developerToken>
     
<ns0:userAgent>channable (AwApi-Python, googleads/18.1.0, Python/3.6.7)</ns0:userAgent>
     
<ns0:validateOnly>false</ns0:validateOnly>
      <ns0:partialFailure>true</
ns0:partialFailure>
   
</ns0:RequestHeader>
  </
soap-env:Header>
 
<soap-env:Body>
   
<ns0:mutate xmlns:ns0="https://adwords.google.com/api/adwords/cm/v201809">
     
<ns0:operations>
       
<ns0:operator>ADD</ns0:operator>
        <ns0:Operation.Type>AdGroupAdOperation</
ns0:Operation.Type>
       
<ns0:operand>
         
<ns0:adGroupId>68069102381</ns0:adGroupId>
          <ns0:ad xmlns:xsi="http:/
/www.w3.org/2001/XMLSchema-instance" xsi:type="ns0:ExpandedTextAd">
            <ns0:id>-2</ns0:id>
            <ns0:finalUrls>https://channable.com</ns0:finalUrls>
            <ns0:Ad.Type>ExpandedTextAd</ns0:Ad.Type>
            <ns0:headlinePart1>h1</ns0:headlinePart1>
            <ns0:headlinePart2>h2</ns0:headlinePart2>
            <ns0:headlinePart3>h3</ns0:headlinePart3>
            <ns0:description>d1</ns0:description>
            <ns0:description2>d2</ns0:description2>
            <ns0:path1></ns0:path1>
            <ns0:path2></ns0:path2>
          </ns0:ad>
          <ns0:status>ENABLED</ns0:status>
        </ns0:operand>
      </ns0:operations>
    </ns0:mutate>
  </soap-env:Body>
</soap-env:Envelope>

[2019-06-07 07:44:17,167 - googleads.adwords.batch_job_helper - INFO] Request summary: {'server': 'https://batch-job-upload-prod-ebe9b43.storage.googleapis.com/311377146/1501998529.operations.xml?GoogleAccessId=926043054183-rbu1gkdus...@developer.gserviceaccount.com&Expires=1560491054&Signature=n%2Fwk7W%2BUEs73lc3ne2YEmQDw1U8wlUHkHzPMj%2F6RRaiEHJ8AUSpPcuW9rY%2FjyFoYELxOlMGcyrLR8cwzNI%2BLL4AsOKCN01VnQe7V1NGD0axVhyY596%2FFNfqY2bW5xmivb9G7DrI7lO0MeuscmgiocDLKtiaahubfc2c%2FN%2B9Ah7w1Blq%2FyTB0xvI%2F1tA4Opx%2BvZjP7uPgwslq%2Fn1lMq2qodsi9FUO9fiHI2cFjKzdL8j28%2BV8iYgoRgT8hHzglubDX31hiiMHYfrR9odhmq%2BThYnziojPcCSE6uZrSkGBVoAyfQoAeL9ksz0MGj3VfRGaiglwF%2BAz9H0fTt5WFT7Dbw%3D%3D&upload_id=AEnB2UpoohtYaOJsVCr53yx3yBbyyPH6MvqNwmFlz-Sq7Djj7fDNwNlIWE7B5H4zhFtDxzQ6nv8g8gQQxNKl7d1iuquUcWbroBDV-YP5XHdFikuhLH6vNuA', 'contentRange': 'bytes 0-262143/262144', 'contentLength': 262144, 'isError': False}



Hopefully this is now enough information. You can see from these logs that we do indeed have partial failures on:
      <ns0:partialFailure>true</ns0:partialFailure>

Let me know if I can provide you with anything else.

Google Ads API Forum Advisor Prod

unread,
Jun 7, 2019, 4:53:22 PM6/7/19
to wes...@channable.com, adwor...@googlegroups.com
Hi Wesley,

I've pulled the relevant logs and asked the relevant teams to take a look. I'll keep you posted.

Cheers
Anash

ref:_00D1U1174p._5001UBlPtt:ref

Wesley Bowman

unread,
Jun 14, 2019, 3:19:34 AM6/14/19
to AdWords API and Google Ads API Forum
Hi Anash,

Any news?

Wesley Bowman

unread,
Jun 25, 2019, 2:27:00 AM6/25/19
to AdWords API and Google Ads API Forum
Still no news? It has been quite some time since I have had any update on this post.

On Friday, June 7, 2019 at 10:53:22 PM UTC+2, adsapiforumadvisor wrote:

Wesley Bowman

unread,
Jul 19, 2019, 8:01:32 AM7/19/19
to AdWords API and Google Ads API Forum
This is still a problem for us. Is there any news?

On Friday, June 7, 2019 at 10:53:22 PM UTC+2, adsapiforumadvisor wrote:

Adrian Lara

unread,
Jul 19, 2019, 9:34:38 AM7/19/19
to AdWords API and Google Ads API Forum

Wesley Bowman

unread,
Jul 22, 2019, 7:42:34 AM7/22/19
to AdWords API and Google Ads API Forum
Hi Adrian,

That seems to be a different issue than what I am trying to get solved here.

Adrian Lara

unread,
Jul 22, 2019, 8:18:15 AM7/22/19
to AdWords API and Google Ads API Forum
OK, np.
Reply all
Reply to author
Forward
0 new messages