I want to not set videos in LocalAdInfo

55 views
Skip to first unread message

Emanuele Isaia

unread,
Aug 23, 2022, 9:32:12 AM8/23/22
to Google Ads API and AdWords API Forum
Hi, I'm here asking for support because I want to create my as set with LocalAdInfo and give possibility to upload a youtube video, but ad said on the referece in google ads api. videos field is optional, so I tried to send a payload of LocalAdInfo with no videos field and i got the Too few error on it like is a requested field

Google\ApiCore\ApiException: {
    "message": "Request contains an invalid argument.",
    "code": 3,
    "status": "INVALID_ARGUMENT",
    "details": [
        {
            "@type": "type.googleapis.com\/google.ads.googleads.v11.errors.GoogleAdsFailure",
            "errors": [
                {
                    "errorCode": {
                        "collectionSizeError": "TOO_FEW"
                    },
                    "message": "Too few.",
                    "location": {
                        "fieldPathElements": [
                            {
                                "fieldName": "operations",
                                "index": 0
                            },
                            {
                                "fieldName": "create"
                            },
                            {
                                "fieldName": "ad"
                            },
                            {
                                "fieldName": "local_ad"
                            },
                            {
                                "fieldName": "videos"
                            }
                        ]
                    }
                }
            ],
            "requestId": "JntdZDjYo3c49yE3RDnkOw"
        }
    ]
}

This is my error and 

$adGroupAd = new AdGroupAd([
                    'ad_group' => $adGroupResourceName,
                    'status' => $data['ad_status'],
                    'ad' => new Ad([
                        'final_urls' => $data['ad_final_urls'],
                        'local_ad' => new LocalAdInfo([
                            'headlines' => $headlinesTextAssetArray,
                            'descriptions' => $descriptionTextAssetArray,
                            'call_to_actions' => $callToActionTextAssetArray,
                            // Sets the marketing image and logo image assets.
                            'marketing_images' => $marketingImageAssetArray,
                            'logo_images' => $logoImageAssetArray,
                            'videos' => []
                        ])
                    ])
                ]);

This is like i use it

There is a good way for specify that there is no video in the local ad with PHP sdk for publish the ad anyay?

Google Ads API Forum Advisor

unread,
Aug 23, 2022, 11:03:44 AM8/23/22
to emanuele....@gmail.com, adwor...@googlegroups.com
Hi Lsaia,

Thank you for reaching out to the Google Ads API support team.

To investigate the issue further, could you please provide the complete request and response logs, with the request-id? If you haven't yet, logging can be enabled by navigating to the Client libraries > Your client library (ex. Java) > Logging documentation, which you can access from this link.You can provide it via Reply privately to author option. If this option is not available, you may send the details directly to our googleadsa...@google.com alias instead. Let me know if you have any questions.

Thanks,
Google Logo
Nirmita
Google Ads API Team
 


ref:_00D1U1174p._5004Q2dmh6R:ref
Message has been deleted

Google Ads API Forum Advisor

unread,
Aug 23, 2022, 2:05:10 PM8/23/22
to emanuele....@gmail.com, adwor...@googlegroups.com
Hi Emanuele,

Thank you for your response.

However, I had to delete your most recent reply as it contained the details of your logs. When sending this information, you may do so via the Reply privately to author option or send it directly to our googleadsa...@google.com alias.

Moving forward, as per the LocalAdInfo documentation, videos are optional and should not be required as seen in your API response :

Failure: {"errors":[{"errorCode":{"collectionSizeError":"TOO_FEW"},"message":"Too few.","location":{"fieldPathElements":[{"fieldName":"operations","index":0},{"fieldName":"create"},{"fieldName":"ad"},{"fieldName":"local_ad"},{"fieldName":"videos"}]}}],

That said, allow me to raise this issue to the rest of our support team. We'll reach back to you once we have an update.

Best regards,

Google Logo
Peter Laurence
Google Ads API Team
 


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