upload assets failed via google ads api

244 views
Skip to first unread message

amanda yang

unread,
Apr 27, 2022, 4:28:05 AM4/27/22
to Google Ads API and AdWords API Forum
Hello,
I can manually upload asset to asset library, but upload failed via google ads api.
The details are as follows:
google.ads.googleads.client: Request made: ClientCustomerId: xxxxxx,
Host: googleads.googleapis.com, Method: /google.ads.googleads.v9.services.AssetService/MutateAssets,
RequestId: jWhc-nNtLweTeUOGthbh1A, IsFault: False, FaultMessage: None
code: 3
message: "Image has layout problem., at operations[0]"
details {
  type_url: "type.googleapis.com/google.ads.googleads.v9.errors.GoogleAdsFailure"
  value: "\n2\n\003\240\007\026\022\031Image has layout problem.\"\020\022\016\n\noperations\030\000"
}

JohnD

unread,
Apr 27, 2022, 1:16:50 PM4/27/22
to Google Ads API and AdWords API Forum
Hello,

We had the same problem since yesterday, after upgrade to Google Ads API v10.
Some images are working well, but images 512x128 don't.
The same image that give an error is working perfectly if you try to upload it manually by the Google Ads Manager.
On this link seems that 512x128 it's a correct layout for Logo Images --> https://support.google.com/google-ads/editor/answer/57755?hl=en#zippy=%2Cdisplay-ads

PHP Code doing the Request:
```
...
$fileData = file_get_contents($imageUrl);

$imageAsset = new ImageAsset();
$imageAsset->setData($fileData);

$asset = new Asset();
$asset->setName("some image name");
$asset->setType(AssetType::IMAGE);
$asset->setImageAsset($imageAsset);

$operation = new AssetOperation();
$operation->setCreate($asset);

$result = $assetService
->mutateAssets($googleAdsAccountId, [$operation]);
...
```

Response:

```
Google\ApiCore\ApiException

Message:
{
    "message": "Request contains an invalid argument.",
    "code": 3,
    "status": "INVALID_ARGUMENT",
    "details": [
        {
            "@type": "type.googleapis.com\/google.ads.googleads.v10.errors.GoogleAdsFailure",
            "errors": [
                {
                    "errorCode": {
                        "mediaUploadError": "LAYOUT_PROBLEM"
                    },
                    "message": "Image has layout problem.",
                    "location": {
                        "fieldPathElements": [
                            {
                                "fieldName": "operations",
                                "index": 0
                            }
                        ]
                    }
                }
            ],
            "requestId": "Mq_sKUfoj3f9E3afw19pbQ"
        }
    ]
}
```

Where we can get a detailed error or is this a bug from v10 API?.

Regards.

Keegan Kuhn

unread,
Apr 27, 2022, 4:19:12 PM4/27/22
to Google Ads API and AdWords API Forum
This is definitely a bug. We are having the same issue after moving from AdWords API to Google Ads API V9 today. Some images seem to work, but we are getting "Image has layout problem" on specific images for some reason. When I try to upload the exact same image via the Google Ads UI there are no issues and it uploads fine. This seems like a bug, but can we get some insight google?

Here are a couple example images that are resulting in "Image has layout problem" when trying to upload with google ads API v9:

Google Ads API Forum Advisor

unread,
Apr 28, 2022, 9:10:03 AM4/28/22
to keega...@gmail.com, adwor...@googlegroups.com

Hi Amanda and Keegan,

Thanks for reaching out to the Google Ads API Forum.

I understand that you’re experiencing issues when uploading images via API. However, for our team to take a closer look into the issue, could you please provide complete request and response logs with request ID generated for the error that resulted in "Image has layout problem", so that we can provide specific recommendations? Kindly provide logs via reply to author privately option.

Regards,

Google Logo
Yasar
Google Ads API Team
 


ref:_00D1U1174p._5004Q2aO1CB:ref

Keegan Kuhn

unread,
Apr 28, 2022, 1:39:02 PM4/28/22
to Google Ads API and AdWords API Forum
It looks like the responses that were coming back "Image has layout problem" are now working today (with no changes on my side). So seems google engineers may have just fixed this yesterday.

Google Ads API Forum Advisor

unread,
Apr 29, 2022, 12:56:16 PM4/29/22
to keega...@gmail.com, adwor...@googlegroups.com
Hi Keegan,

Thank you for reaching out.

Could you please provide more details on the "Image has layout problem"? so that i can further investigate the issue.

Thanks,
Google Logo
Nirmita
Google Ads API Team
 


ref:_00D1U1174p._5004Q2aO1CB:ref

JohnD

unread,
May 2, 2022, 9:23:38 AM5/2/22
to Google Ads API and AdWords API Forum
Same for our part, the same code is now working well.

Google Ads API Forum Advisor

unread,
May 3, 2022, 5:58:03 AM5/3/22
to adwor...@googlegroups.com

Hi John,

Thank you for providing updates about your concern.

I'm so glad that the issue regarding the layout problem on the image has been resolved.

If you have additional questions that are specific to Google Ads API, feel free to send those over to our team and we would be happy to assist you further.


Best,

Google Logo
Anthony Cyril
Google Ads API Team
 


ref:_00D1U1174p._5004Q2aO1CB:ref
Reply all
Reply to author
Forward
0 new messages