OPERATION_NOT_PERMITTED_FOR_CAMPAIGN_TYPE removing adgroup

37 views
Skip to first unread message

Artem Baltser

unread,
Apr 25, 2020, 6:27:12 AM4/25/20
to AdWords API and Google Ads API Forum
Hello, Im trying to remove adgroup from api in SEARCH campaign

if (addedAdGroups != null) {
    try {
        List<AdGroupOperation> operations = new ArrayList<>(10000);

        for (AdGroup adGroup : addedAdGroups) {
            adGroup.setStatus(AdGroupStatus.REMOVED);

            AdGroupOperation operation = new AdGroupOperation();
            operation.setOperand(adGroup);
            operation.setOperator(Operator.SET);

            operations.add(operation);
        }

        adGroupService.mutate(operations.toArray(new AdGroupOperation[0]));
    } catch (ApiException e2) {
        throw new AdwordsFailureException(e2, currentAdwordsAccount);
    }
}

Is It possible to remove adgroup? Im able to remove adgroup manually from ads interface

Also If this option cannot be handled at all please could you tell me how to Implement transactional logic when some adwords operation fails with exception? Thanks

Google Ads API Forum Advisor Prod

unread,
Apr 27, 2020, 12:30:29 PM4/27/20
to abalt...@gmail.com, adwor...@googlegroups.com

Hi Artem,

Thank you for reaching out. It is possible to remove adgroup. Could you please share the complete request and response logs along with the client customer id via the Reply privately to author option for me to further investigate?

Thanks and regards,
Xiaoming, Google Ads API Team



 

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