Search code examples
google-ads-api

Adwords API: Can't remove MyBusiness Location extension


I'd like to remove a location extension with the following code snippet:

FeedOperation feedOperation = new FeedOperation();
feedOperation.setOperand(FeedTemp);
feedOperation.setOperator(Operator.REMOVE);

It removes the location feed but leaves a message at the adwords page which says "invalid setting" (Ungültige Einstellung).See here

When I try to add a new location extension with the API, i get an error that a feed of this placeholder type already exists. I already tried to remove the link between the location and a campaign with the following code without any success:

CampaignFeedOperation campaignFeedOperation = new CampaignFeedOperation();
campaignFeedOperation.setOperand(campaignFeed);
campaignFeedOperation.setOperator(Operator.REMOVE);

My only solution is to manually remove the location extension, which isn't doable for more than 100 customers. Do you got any suggestion what i miss here?


Solution

  • I found my mistake. Prior to removing the feed itself I need to remove the CustomerFeed:

    CustomerFeedOperation customerFeedOperation = new CustomerFeedOperation();
    customerFeedOperation.setOperand(customerFeed);
    customerFeedOperation.setOperator(Operator.REMOVE);