OPERATION_NOT_PERMITTED_FOR_CONTEXT

842 views
Skip to first unread message

cv

unread,
Oct 15, 2020, 10:55:05 AM10/15/20
to AdWords API and Google Ads API Forum
Hi,

I am getting error while adding campaigns to negative placement list.

Response: {"partialFailureError":{"code":3,"message":"The operation is not allowed for the given context., at operations[1].create.campaign","details":[{"@type":"type.googleapis.com/google.ads.googleads.v3.errors.GoogleAdsFailure","errors":[{"errorCode":{"contextError":"OPERATION_NOT_PERMITTED_FOR_CONTEXT"},"message":"The operation is not allowed for the given context.","trigger":{"stringValue":"DISPLAY(DISPLAY_FULL_AUTOMATION)"},"location":{"fieldPathElements":[{"fieldName":"operations","index":"1"},{"fieldName":"create"},{"fieldName":"campaign"}]}}]}]},"results":[{"resourceName":"customers\/XXX\/campaignSharedSets\/XXX~XXX"},{}]} 

Why it was like this?

Thanks,

Google Ads API Forum Advisor Prod

unread,
Oct 16, 2020, 1:13:20 AM10/16/20
to chirag....@gmail.com, adwor...@googlegroups.com
Hi,

Thanks for posting your concern.

I would like to inform you first that API version v3, which you are currently using, is already deprecated as discussed on our Deprecation Schedule document. With this, we recommend that you upgrade to the newest version by following this guide to try out new features in Google Ads API.

After migrating to the newest version, please try the API request again. If the issue persists, you can provide the complete request and response logs, together with the error message and customer ID, so our team can 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._5004Q269XD1:ref

cv

unread,
Oct 16, 2020, 9:35:10 AM10/16/20
to AdWords API and Google Ads API Forum
Hi Ernie,

I am not sure is this the reason.
Because I am facing issue with this account only.

Can you please help?

Thanks

Aditya Naukri

unread,
Aug 5, 2021, 2:30:20 AM8/5/21
to AdWords API and Google Ads API Forum
I am also facing the same issue. I am trying to link my Customer Match UserList to the campaign. Getting the following error using the code:
 

CampaignCriterionServiceClient campaignCriterionServiceClient = googleAdsClient.getLatestVersion().createCampaignCriterionServiceClient();
  UserListInfo userListInfo = UserListInfo.newBuilder().setUserList(userList).build();
  CampaignCriterion campaignCriterion = CampaignCriterion.newBuilder().setCampaign(ResourceNames.campaign(customerId, campaignId)).mergeUserList(userListInfo).build();
  
  CampaignCriterionOperation criterionOperation = CampaignCriterionOperation.newBuilder().setCreate(campaignCriterion).build();
  
  MutateCampaignCriteriaResponse response = campaignCriterionServiceClient.mutateCampaignCriteria(Long.toString(customerId), ImmutableList.of(criterionOperation)); 

ERROR:

request_id: "2aU6KGGvOVHmF06kHCreNA"
Status: Status{code=INVALID_ARGUMENT, description=Request contains an invalid argument., cause=null}.Request ID 2aU6KGGvOVHmF06kHCreNA failed due to GoogleAdsException. Underlying errors:  Error 0: error_code {  context_error: OPERATION_NOT_PERMITTED_FOR_CONTEXT}message: "The operation is not allowed for the given context."trigger {  string_value: "DISPLAY(DISPLAY_FULL_AUTOMATION)"}location {  field_path_elements {    field_name: "operations"    index: 0  }  field_path_elements {    field_name: "create"  }  field_path_elements {    field_name: "user_list"  }}

Google Ads API Forum Advisor

unread,
Aug 5, 2021, 10:13:04 AM8/5/21
to testnaukrica...@gmail.com, adwor...@googlegroups.com
Hello Aditya,

In the future, if a thread is a few months old and no longer active, could you do us a huge favor and just start a new thread? Sometimes, your issue may be different than the last one, and it can be confusing to some other people who may have had their issue already resolved on the thread. I do appreciate that you are checking the forum first, though. 

This time, rather than making you start a new thread, I'll just answer. Thank you for providing the logs with the error. That makes it much easier for me to explain what's going on. For this campaign type, this is working as intended. You cannot add a campaign criterion with a user list to this campaign type. Let me break down the error to show you.
  • The operation is not allowed for the given context. This means that sometimes the operation may work for some configurations, but for your particular configuration, it will not work.
  • trigger {  string_value: "DISPLAY(DISPLAY_FULL_AUTOMATION)"} This is telling you that the campaign type is of type DISPLAY with the subtype of the campaign being DISPLAY_FULL_AUTOMATION. When something is full automation, usually you cannot control the specifics of how the campaign runs. All the choices are automated, and the choices are made for you by the campaign, since the campaign is automated.
  • location {  field_path_elements {    field_name: "operations"    index: 0  }  field_path_elements {    field_name: "create"  }  field_path_elements {    field_name: "user_list"  }} This is telling you that the item you can't add is the user list. 
Putting all these pieces of the error together, this is saying that you can't add a campaign criterion with a user list to a campaign of type DISPLAY (DISPLAY_FULL_AUTOMATION). Google Ads does not allow this based on the current configuration. However, you can do this for other campaign types.

Best,
Nadine Wang, Google Ads API Team

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