How to avoid OPERATION_NOT_PERMITTED_FOR_REMOVED_ENTITY error

43 views
Skip to first unread message

Cindy J

unread,
Oct 13, 2016, 10:51:47 AM10/13/16
to AdWords API Forum
Hi there,

I have an account with about 100,000 ad groups, millions of keywords and many campaigns. While I was trying to update keywords, it's quite often to have OPERATION_NOT_PERMITTED_FOR_REMOVED_ENTITY error.

I know I could use campaignService and adGroupService to retrieve active campaigns/ad groups only, and then filter out keywords within these campaigns/ad groups - but because of the volume of ad groups/keywords, it would be really inefficient to perform such check before updating. 

Is there a better way to handle such error or can I set to specifically ignore this error? (I was bulk updating keywords, so one operation failure would lead to failure of the batch)

Thanks,
Cindy

Vishal Vinayak (Adwords API Team)

unread,
Oct 13, 2016, 2:57:36 PM10/13/16
to AdWords API Forum
Hi Cindy,

That is correct. You may see the OPERATION_NOT_PERMITTED_FOR_REMOVED_ENTITY error if you try to update an entity that is already been removed. 

Unfortunately, there aren't too may ways to bypass this mechanism since this is in place to check system's integrity. The correct way to perform this routine, indeed, would be to select only the active campaigns/ad groups and update keywords for those campaigns/ ad groups. More details are available on this forum post.

To group multiple actions in one operation, I would also suggest having a look at the batch job service.

Regards,
Vishal, AdWords API Team

Cindy J

unread,
Oct 13, 2016, 3:59:56 PM10/13/16
to AdWords API Forum
Thanks Vishal!

I also found there's such limit:
  • When using IN and NOT_IN operators in your WHERE clause, you are limited to 10,000 items.
So the best solution would require multiple get to fetch all keywords then?

Vishal Vinayak (Adwords API Team)

unread,
Oct 13, 2016, 4:42:07 PM10/13/16
to AdWords API Forum
Hi Cindy,

In that case, I would recommend keeping the Campaign ID / Ad Group ID - Keyword mapping saved in your local database. You can first perform a basic check on whether an ad group / campaign exists before performing updates on the keyword. Multiple sanity check actions can be grouped into a single operation with a batch job, to optimize the performance. Also, you can set the partialFailure SOAP header to true so that the operations that fail would be ignored.
Reply all
Reply to author
Forward
0 new messages