Error Mutating MultiAssetResponsiveDisplayAd

43 views
Skip to first unread message

soo...@gmail.com

unread,
Oct 21, 2020, 12:57:05 PM10/21/20
to AdWords API and Google Ads API Forum
I'm using the Adwords PHP SDK, trying to update fields of MultiAssetResponsiveDisplayAds. In this test, I'm just trying to update the long headline. The error I get is that I'm not setting all the other fields, but I don't want to change any other field. Sample code below and error output as well.

Code:
$adService = $adWordsServices->get($session, AdService::class);

$multiAssetResponsiveDisplayAd = new MultiAssetResponsiveDisplayAd();
$multiAssetResponsiveDisplayAd->setId($ad_id);

$longHeadlineTextAsset = new TextAsset();
$long_headline = 'New Long Headline';
$longHeadlineTextAsset->setAssetText($long_headline);
$multiAssetResponsiveDisplayAd->setLongHeadline(new AssetLink($longHeadlineTextAsset));

$operation = new AdOperation();
$operation->setOperand($multiAssetResponsiveDisplayAd);
$operation->setOperator(Operator::SET);
$operations[] = $operation;

// Updates the ad on the server.
$result = $adService->mutate($operations);
$updatedAd = $result->getValue()[0];

return "Ad Has been Updated";


Error Message:

CollectionSizeError.TOO_FEW @ operations[0].operand.headlines, CollectionSizeError.TOO_FEW @ operations[0].operand.descriptions, RequiredError.REQUIRED @ operations[0].operand.marketingImages, RequiredError.REQUIRED @ operations[0].operand.squareMarketingImages, AdError.EMPTY_FIELD @ operations[0].operand.finalUrls



Google Ads API Forum Advisor Prod

unread,
Oct 21, 2020, 11:20:42 PM10/21/20
to soo...@gmail.com, adwor...@googlegroups.com
Hi,

Thanks for raising your concern.

Since you are using the 'SET' to the operator field, then it should only update the fields that you've included in the API request. With this, could you provide the complete SOAP request and response logs instead, together with the customer ID and API request ID to further investigate? You can provide the requested details via Reply privately to author option.

Regards,
Google Logo
Ernie John Blanca Tacata
Google Ads API Team
 


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