Hi,
I’m trying to update texts for an AdgroupAd using the following code (using
GoogleAds API):
{
$appAdInfo = new AppAdInfo();
$headlinesAssets = $this->stringArrayToAdAssetTextArray(['Head', 'Head2']);
$appAdInfo->setHeadlines($headlinesAssets);
$descriptionsAssets = $this->stringArrayToAdAssetTextArray(['Decs1']);
$appAdInfo->setDescriptions($descriptionsAssets);
$appAd = new Ad(['app_ad' => $appAdInfo]);
// Creates an ad group ad to hold the above ad.
$adGroupResourceName = new StringValue(['value' =>
ResourceNames::forAdGroup($this->account_google_id,XXXXXXX)]);
$adGroupAd = new AdGroupAd([
'ad_group' => $adGroupResourceName,
'ad' => $appAd
]);
$adGroupAdOperation = new AdGroupAdOperation();
$adGroupAdOperation->setUpdate($adGroupAd);
$adGroupAdOperation->setUpdateMask(FieldMasks::allSetFieldsOf($adGroupAd));
$operations[] = $adGroupAdOperation;
return
$this->adGroupAdServiceClient->mutateAdGroupAds($this->account_google_id,
$operations);
}
Getting error: "Request contains an invalid argument.”
Error log:
Method Name: /google.ads.googleads.v2.services.AdGroupAdService/MutateAdGroupAds
Host: googleads.googleapis.com
Headers: {
"x-goog-api-client": "gl-php\/7.1.23 gapic\/ gax\/1.0.3 grpc\/1.20.0",
"x-goog-request-params": "customer_id=2944805093",
"developer-token": "REDACTED",
"login-customer-id": "6330691878"
}
Request:
{"customerId":"2944805093","operations":[{"updateMask":"adGroup,ad.resourceName,ad.id,ad.finalUrls,ad.finalAppUrls,ad.finalMobileUrls,ad.trackingUrlTemplate,ad.urlCustomParameters,ad.displayUrl,ad.type,ad.addedByGoogleAds,ad.devicePreference,ad.urlCollections,ad.name,ad.systemManagedResourceSource,ad.textAd,ad.expandedTextAd,ad.callOnlyAd,ad.expandedDynamicSearchAd,ad.hotelAd,ad.shoppingSmartAd,ad.shoppingProductAd,ad.gmailAd,ad.imageAd,ad.videoAd,ad.responsiveSearchAd,ad.legacyResponsiveDisplayAd,ad.appAd.mandatoryAdText,ad.appAd.headlines,ad.appAd.descriptions,ad.appAd.images,ad.appAd.youtubeVideos,ad.appAd.html5MediaBundles,ad.legacyAppInstallAd,ad.responsiveDisplayAd,ad.displayUploadAd,ad.appEngagementAd,ad.shoppingComparisonListingAd","update":{"adGroup":"customers\/2944805093\/adGroups\/76171208785","ad":{"appAd":{"headlines":[{"text":"Head"},{"text":"Head2"}],"descriptions":[{"text":"Decs1"}]}}}}]}
Response
-------
Headers: {
"request-id": "UiFATkF14S65Okv7gIbq6w",
"date": "Thu, 22 Aug 2019 07:32:51 GMT",
"alt-svc": "quic=\":443\"; ma=2592000; v=\"46,43,39\""
}
Fault
-------
Status code: 3
Details: Request contains an invalid argument.
Failure: {}
Please advise.
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
---
You received this message because you are subscribed to the Google Groups
"AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/adwords-api/a36b9eb9-9a80-406f-ba0b-345bbe5f6674%40googlegroups.com.