AdvertisingChannelType for google display ad not working

255 views
Skip to first unread message

Amol Kawale

unread,
Jan 24, 2022, 9:01:23 AM1/24/22
to Google Ads API and AdWords API Forum
Hello Team,

I'm using google ads V8 with PHp. I'm trying to modify search campaign to display campaign but its not working. pls find below requst & response log:

Request:
{"customerId":"3604807397","operations":[{"create":{"name":"Sweply-GD-1134","status":"ENABLED","advertisingChannelType":"DISPLAY","networkSettings":{"targetGoogleSearch":true,"targetSearchNetwork":true,"targetContentNetwork":false,"targetPartnerSearchNetwork":false},"campaignBudget":"customers\/3604807397\/campaignBudgets\/10247143167","startDate":"2022-01-25","endDate":"2022-01-26","manualCpc":{}}}]}

Response
-------
Headers: {
    "request-id": "kMcY6I9ZkPboi-troG_FKQ",
    "date": "Mon, 24 Jan 2022 13:44:07 GMT",
    "alt-svc": "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000,h3-Q050=\":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":"DISPLAY"},"location":{"fieldPathElements":[{"fieldName":"operations","index":0},{"fieldName":"create"},{"fieldName":"network_settings"},{"fieldName":"target_google_search"}]}}],"requestId":"kMcY6I9ZkPboi-troG_FKQ"}  

Pls help me to fix issue for campaign type display ad.

Regards,
Amol

Amol Kawale

unread,
Jan 24, 2022, 9:17:48 AM1/24/22
to Google Ads API and AdWords API Forum
Guys ,

I found this info as well to set channel type as Display but still it not working. Its giving error as in previous message I posted.
responsive ad.png

Amol Kawale

unread,
Jan 25, 2022, 12:25:12 AM1/25/22
to Google Ads API and AdWords API Forum
Any suggestion guys

Google Ads API Forum Advisor

unread,
Jan 25, 2022, 1:50:53 AM1/25/22
to a.ka...@sweply.com, adwor...@googlegroups.com
Hello Amol,

Thank you for posting your concern. Allow me to support you here.

Before proceeding to your concern, I would like to inform you that your post will be deleted containing logs for security purposes.

With regards to your concern, I'm afraid that a campaign type cannot be modified after it was initially created.

As for the issue in the provided API logs, it appears that the target_google_search as 'true' is not possible for the Display campaign. With this, I would suggest setting 'false' value to that and retry the API request again.

Let me know if you have further questions.

Best regards,
Google Logo
Jinky Mandaya
Google Ads API Team
 


ref:_00D1U1174p._5004Q2VOtrw:ref

Amol Kawale

unread,
Jan 25, 2022, 1:56:56 AM1/25/22
to Google Ads API and AdWords API Forum
THanks for reply Jinky. But am not modifying campaign type. I want to create Display ad & it not working after set "AdvertisingChannelType::DISPLAY" that is my conern. Search ad can be created proper. But when am addingAdvertisingChannelType::DISPLAY while display ad creation, it not working. Pls let me know what thing I need to change to create responsive display ad correctly.

Regards,
Amol

Google Ads API Forum Advisor

unread,
Jan 25, 2022, 10:30:53 AM1/25/22
to a.ka...@sweply.com, adwor...@googlegroups.com
Hi Amol,

I work with Jinky and will assist you. Could you try changing this:
"targetGoogleSearch":true,"targetSearchNetwork":true,"targetContentNetwork":false,"targetPartnerSearchNetwork":false.

​​​​​​​to this:

​​​​​​​"targetGoogleSearch":false,"targetSearchNetwork":false,"targetContentNetwork":true,"targetPartnerSearchNetwork":false ?

Regards,

Google Logo
Aryeh Baker
Google Ads API Team
 


ref:_00D1U1174p._5004Q2VOtrw:ref

Carlos Arnau

unread,
Mar 15, 2023, 6:53:50 AM3/15/23
to Google Ads API and AdWords API Forum
Hello,

I'm trying to create a campaign with the AdvertisingChannelType set to 'Display' and I happen to have the same exact error described here. I changed the NetworkSettings to the ones suggested but still I am still getting an error.

message: "Request contains an invalid argument."
code: 3
status: "INVALID_ARGUMENT"
details.errors[0].errorCode.contextError: "OPERATION_NOT_PERMITTED_FOR_CONTEXT"
details.errors[0].message: "The operation is not allowed for the given context."
details.errors[0].trigger.stringValue: "SEARCH_STANDARD"

I've tried different combinations of values but 'target_search_network' cannot be enabled without having 'target_google_search' enabled and 'target_partner_search_network' is only available for certain accounts.

How can I create a campaign that does allow to create responsive display ads?

Thank you!

Google Ads API Forum Advisor

unread,
Mar 15, 2023, 11:46:00 AM3/15/23
to adwor...@googlegroups.com

Hi,

Thank you for reaching out to Google Ads API Forum.



How can I create a campaign that does allow to create responsive display ads?

>> As per this guide, Responsive display ads can be used in Display campaigns. These Display campaigns serve visually engaging ads on the Google Display Network.

If you have already set your campaign AdvertisingChannelType to DISPLAY, that said, if you want to create responsive display ads, can you confirm if the Ad Group your are creating is with type = DISPLAY_STANDARD? As per the enum documentation, this is the default ad group type for Display campaigns. Can you also confirm that you are setting your NetworkSettings target_content_network as true?

If the issue persists after going through the suggested solution, can you please complete request and response logs with the request-id generated on your end when you encountered the errors so our team can further investigate. You can provide it via the Reply privately to author option. If this option is not available, then send it instead on this email address googleadsa...@google.com.

For the client library, logging can be enabled by navigating to the Client libraries > Your client library (ex. .Java) > Logging documentation, which you can access from this link. Kindly note that it would help us investigate the cause of your error if we have these logs.

Regards,

Google Logo Google Ads API Team


ref:_00D1U1174p._5004Q2VOtrw:ref

Carlos Arnau

unread,
Mar 27, 2023, 6:15:49 AM3/27/23
to Google Ads API and AdWords API Forum
Hello,

Thank you so much, I was able to create the display campaign with the information provided. Unfortunately, it does look like that I'm no able to add a responsive display ad to said campaign. This is the error message I'm getting:

"message": "The required field was not present.",        

                      "location": {                                            
                          "fieldPathElements": [                              
                              {                                                
                                  "fieldName": "operations",                  
                                  "index": 0                                  
                              },                                              
                              {                                                
                                  "fieldName": "create"                        
                              },                                              
                              {                                                
                                  "fieldName": "ad"                            
                              },                                              
                              {                                                
                                  "fieldName": "responsive_display_ad"        
                              }                                                
                          ]                                                    
                      }                      

And this is an extract of the code I'm running to create the adgroup ad operation:

use Google\Ads\GoogleAds\V12\Common\AdImageAsset;
use Google\Ads\GoogleAds\V12\Common\AdTextAsset;
use Google\Ads\GoogleAds\V12\Common\AdVideoAsset;
use Google\Ads\GoogleAds\V12\Common\ResponsiveDisplayAdInfo;
use Google\Ads\GoogleAds\V12\Enums\AdGroupAdStatusEnum\AdGroupAdStatus;
use Google\Ads\GoogleAds\V12\Resources\Ad;
use Google\Ads\GoogleAds\V12\Resources\AdGroupAd;
use Google\Ads\GoogleAds\V12\Services\AdGroupAdOperation;

$adInfo = new ResponsiveDisplayAdInfo([
    'business_name' => 'My business name',
    'marketing_images' => [
        new AdImageAsset(['asset' => 'customers/XXXXXXX/assets/XXXXXXX']),
    ],
    'square_marketing_images' => [
        new AdImageAsset(['asset' => 'customers/XXXXXXX/assets/XXXXXXX']),
    ],
    'youtube_videos' => [
        new AdVideoAsset(['asset' => 'customers/XXXXXXX/assets/XXXXXXX']),
    ],
    'square_logo_images' => [
        new AdImageAsset(['asset' => 'customers/XXXXXXX/assets/XXXXXXX')]),
    ],
    'headlines' => [
        new AdTextAsset(['text' => $headlineOne,]),
        new AdTextAsset(['text' => $headlineTwo,]),
        new AdTextAsset(['text' => $headlineThree,]),
    ],
    'descriptions' => [
        new AdTextAsset(['text' => $descriptionOne,]),
        new AdTextAsset(['text' => $descriptionTwo,]),
    ],
]);

$ad = new Ad([
    'responsive_display_ad' => $adInfo,
    'final_urls' => ['https://www.example.com'],
]);

$adGroupAd = new AdGroupAd([
    'ad_group' => 'customers/XXXXXXX/adGroups/XXXXXXX',
    'status' => AdGroupAdStatus::ENABLED,
    'ad' => $ad,
]);

$operation = new AdGroupAdOperation();
$operation->setCreate($adGroupAd);


Is there something that I'm doing wrong? It does look like that it's not properly attaching the responsive display ad in the ad instance, I've debugged the code and I can get the values of the responsive display ad using the ad methods so could this be that the api is not reading it properly.

Any help would be appreciated, thank you!

Google Ads API Forum Advisor

unread,
Mar 27, 2023, 12:18:22 PM3/27/23
to adwor...@googlegroups.com

Hello Carlos,

Thank you for responding back to us.

It appears that you are encountering an error when trying to add responsive display ads to your campaign. However, the shared snippet would not suffice for us to determine the exact cause of the issue. Would you be able to share to us the complete request and response logs with request ID and request header generated on your end? This is so we can provide precise guidance to the issue at hand.

Note that these logs can be requested or provided to the developer handling the Google Ads API transactions when logging of the API requests has been enabled. You may check here and click your client library for the specific guideline to enable it.

For REST interface requests, you can enable logging via the curl command by using the -i flag. This will cause the tool to include the HTTP response headers in the output.

You may send this privately via "Reply to Author" option. If that option is not available to you, you may directly send it to this alias googleadsa...@google.com.

Regards,

Carlos Arnau

unread,
Mar 28, 2023, 6:35:58 AM3/28/23
to Google Ads API and AdWords API Forum
Hello,

Thank you for your support, after collecting all the request and response data I realized that the missing responsive_display_ad was due a required long headline property that I forgot to add.

IMHO, event though I understand that from the GADS API point of view the object is missing because it is unable to create it with the provided data, the message the user does receive it is not very accurate to what's the real issue, which is a missing required parameter.

Thanks for your time and help!

Google Ads API Forum Advisor

unread,
Mar 28, 2023, 10:20:08 AM3/28/23
to adwor...@googlegroups.com

Hello Carlos,

Thank you for that confirmation. Glad that the issue has been resolved. With regards to the specific error message "The required field was not present", it would help if you would be aware to specific fields when doing this request to avoid this issue in the future. You may check this ResponsiveDisplayAdInfo for your reference. The below article may also help you in creating responsive display ads.


Do not hesitate to come back to us should you encounter any issues with the API in the future.

Regards,

Reply all
Reply to author
Forward
0 new messages