Error in adding a Combined Audience to a Standard Display Campaign

287 views
Skip to first unread message

Steve Liu

unread,
Nov 29, 2021, 2:26:43 PM11/29/21
to AdWords API and Google Ads API Forum
Context: Using Ruby on Rails with google-ads-googleads gem (v.12.0.1)

Trying to add a combined audience segment to a standard display campaign - which works just fine via the google ads manager, but when trying to do it programmatically, I bump into the following error:

The human readable version: ERROR IN CREATING GOOGLE CAMPAIGN: operations[0] > create[0] > combined_audience[0] with value: DISPLAY(DISPLAY_STANDARD) because the operation is not allowed for the given context.

The full error object:
<Google::Ads::GoogleAds::V8::Errors::GoogleAdsError: error_code: <Google::Ads::GoogleAds::V8::Errors::ErrorCode: context_error: :OPERATION_NOT_PERMITTED_FOR_CONTEXT>, message: "The operation is not allowed for the given context.", trigger: <Google::Ads::GoogleAds::V8::Common::Value: string_value: "DISPLAY(DISPLAY_STANDARD)">, location: <Google::Ads::GoogleAds::V8::Errors::ErrorLocation: field_path_elements: [<Google::Ads::GoogleAds::V8::Errors::ErrorLocation::FieldPathElement: field_name: "operations", index: 0>, <Google::Ads::GoogleAds::V8::Errors::ErrorLocation::FieldPathElement: field_name: "create">, <Google::Ads::GoogleAds::V8::Errors::ErrorLocation::FieldPathElement: field_name: "combined_audience">]>>

For more context, the code used to add the campaign criterion:
audience = client.operation.create_resource.campaign_criterion do |criterion|
criterion.campaign = client.path.campaign(customer_id, campaign_id)
criterion.combined_audience = client.resource.combined_audience_info do |audience|
audience.combined_audience = audience_resource_name
end
end

response = criteria_service.mutate_campaign_criteria(
customer_id: customer_id,
operations: operations,
partial_failure: true
)

Thanks in advance for any help here

Google Ads API Forum Advisor

unread,
Nov 30, 2021, 9:38:57 PM11/30/21
to st...@marpipe.com, adwor...@googlegroups.com

Hello Steve,

Thank you for reaching out to us.

Can you share to us the complete API logs (request and response with request-id) so our team can further check? Since you're using Ruby, you can enable logging via this guide.

Please send the requested details via the Reply privately to author option. If this option is not available, you may send the details directly to our googleadsa...@google.com alias instead.

Regards,

Reminder: Share your feedback about the Google Ads (AdWords) API! Take the 2021 Google Ads API and AdWords API Annual Survey
 

Google Logo
Mark Kevin Albios
Google Ads API Team
 


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