Thank you for responding,
>From the example
<https://github.com/googleads/google-ads-php/blob/master/examples/AdvancedOperations/AddAdCustomizer.php#L510>
code to create a ad belong to group id existed so how to create a `ad group
ad` with the type which compatible with the it.
Here is my logic code
$gaCampaign = new Campaign([
'name' => $campaignData->name,
'advertising_channel_type' => AdvertisingChannelType::SHOPPING,
'status' => CampaignStatus::ENABLED,
"start_date" => $campaignData->from_date_ymd,
"end_date" => $campaignData->to_date_ymd,
'campaign_budget' => $budgetResourceName
]);
$adGroup = new AdGroup([
'name' => $campaign->name,
'campaign' => $campaignResourceName,
'type' => AdGroupType::SHOPPING_PRODUCT_ADS,
'status' => AdGroupStatus::ENABLED
]);
$ad = new Ad([
"name" => "Ad - " . $campaign->name,
]);
$ad->setType(AdType::EXPANDED_TEXT_AD);
$expandedTextAdInfo = new ExpandedTextAdInfo([
'headline_part1' => $campaign->headline_part1,
'description' => $campaign->description,
]);
if ($campaign->headline_part2 != null && $campaign->headline_part2 != "") {
$expandedTextAdInfo->setHeadlinePart2($campaign->headline_part2);
}
if ($campaign->headline_part3 != null && $campaign->headline_part3 != "") {
$expandedTextAdInfo->setHeadlinePart3($campaign->headline_part3);
}
if ($campaign->description1 != null && $campaign->description1 != "") {
$expandedTextAdInfo->setDescription2($campaign->description1);
}
$ad->setExpandedTextAd($expandedTextAdInfo);
$ad->setFinalUrls([$campaign->final_url]);
$ad->setDisplayUrl($campaign->final_url);
$adGrroupAd = new AdGroupAd([
'status' => AdGroupAdStatus::ENABLED,
'ad_group' => $adGroupResourceName,
'ad' => $ad
]);
But got an error:
Method Name:
/google.ads.googleads.v5.services.AdGroupAdService/MutateAdGroupAds
Host: googleads.googleapis.com
Headers: {
"x-goog-api-client": "gl-php\/7.4.3 gapic\/ gax\/1.5.0 grpc\/1.31.1",
"x-goog-request-params": "customer_id=3255645407",
"developer-token": "REDACTED",
"login-customer-id": "3466391933"
}
Request:
{"customerId":"3255645407","operations":[{"create":{"status":"ENABLED","adGroup":"customers/3255645407/adGroups/111788458237","ad":{"finalUrls":["seller.quanlythuoc247.com"],"displayUrl":"seller.quanlythuoc247.com","type":"EXPANDED_TEXT_AD","name":"Ad
- Google shopping - US - en#44- 1","expandedTextAd":{"headlinePart1":"Gear
GAG","headlinePart2":"Header line 2","headlinePart3":"Header line
3","description":"Gear gag","description2":"Description 2"}}}}]}
Response
-------
Headers: {
"request-id": "QPtTCKJRGtvtXIrUkpEqOA",
"date": "Tue, 20 Oct 2020 19:52:01 GMT",
"alt-svc": "h3-Q050=\":443\"; ma=2592000,h3-29=\":443\";
ma=2592000,h3-27=\":443\"; ma=2592000,h3-T051=\":443\";
ma=2592000,h3-T050=\":443\"; ma=2592000,h3-Q046=\":443\";
ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000;
v=\"46,43\""
}
Fault
-------
Status code: 3
Details: Request contains an invalid argument.
Failure:
{"errors":[{"errorCode":{"operationAccessDeniedError":"OPERATION_NOT_PERMITTED_FOR_CAMPAIGN_TYPE"},"message":"This
operation is not permitted on this campaign
type","trigger":{"stringValue":"SHOPPING"},"location":{"fieldPathElements":[{"fieldName":"operations","index":"0"},{"fieldName":"create"},{"fieldName":"ad"},{"fieldName":"expanded_text_ad"}]}}]}
Plz help me to fix it.
Vào lúc 10:11:31 UTC+7 ngày Thứ Tư, 21 tháng 10, 2020, adsapiforumadvisor
đã viết:
> Hi,
>
> Thanks for posting your concern.
>
> On the Google Ads API perspective, shopping showcase ads will not be
> available here as discussed on this guide
> <https://developers.google.com/google-ads/api/docs/migration/types>. With
> this, creation of shopping showcase ad group and campaign will not be
> possible also on Google Ads API.
>
> Let me know if you have further questions.
>
> Regards,
> [image: Google Logo]
> Ernie John Blanca Tacata
> Google Ads API Team
>
>
> ref:_00D1U1174p._5004Q26Akuy:ref
>
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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/f586f1c8-ae9c-495d-93b9-ea79517770d7n%40googlegroups.com.