AdWords is now Google Ads. Our new name reflects the full range of advertising options we offer across Search, Display, YouTube, and more. Learn more

My Business
4.5K members online now
4.5K members online now
For developers who are using the Google My Business API to manage locations
Guide Me
star_border
Reply

Can't delete location through API even though locationState.canDelete is true?

[ Edited ]
Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

I am trying to clean up a dashboard that includes a lot of duplicates that were created in the past through bulk uploads.  The locationState looks like this:

  "locationState": {
    "isDuplicate": true,
    "canUpdate": true,
    "canDelete": true,
    "isDisconnected": true
  },

However when I try to delete one through the API I get the following error:

{
  "error": {
    "code": 400,
    "message": "Location accounts/107949962581374438825/locations/6376401539139641398 has a Google+ page. It can only be deleted by deleting its +page.",
    "status": "FAILED_PRECONDITION"
  }
}

Apparently canDelete doesn't actually mean that you can delete it!  Clearly there is a bug somewhere.

 

The error obviously refers to the fact that the location has a locationKey.plusPageId.  But that ID results in a URL of https://plus.google.com/102838901727492969801 which does not appear to be a working page.  Not even when I navigate to it through the GMB dashboard.  Besides which, I can't find a Google+ API for deleting pages that you don't want.

 

Deleting these locations manually from within the GMB dashboard is not individually hard, but there are thousands of them, and more are being created on an ongoing basis.  This is why I am looking for an automated solution.

 

Is there any way that I can get past this barrier and delete these locations?

 

1 Expert replyverified_user

Can't delete location through API even though locationState.canDelete is true?

Visitor ✭ ✭ ✭
# 2
Visitor ✭ ✭ ✭

Can I please get acknowledgement of this issue and advice about how to handle it?

Re: Can't delete location through API even though locationState.canDelete is true?

Google Employee
# 3
Google Employee

Hi @Ben T,

 

The canDelete boolean field in the LocationState object indicates whether the location can be deleted using the Google My Business UI. Since your location has an associated Google+ page as indicated by a plusPageId in the LocationKey, it cannot be deleted using Google My Business API.

 

We suggest you please use the Google My Business UI to delete a location that has an associated Google+ page.

 

Thanks,

The Google My Business API team

Can't delete location through API even though locationState.canDelete is true?

Visitor ✭ ✭ ✭
# 4
Visitor ✭ ✭ ✭

Is there a reason why automatically created and flagged dups would have non-working Google+ pages assigned to them?

 

If I have no choice, I have no choice.  But hours of manual cleanup of automated mistakes is rather frustrating to go through.

Can't delete location through API even though locationState.canDelete is true?

Visitor ✭ ✭ ✭
# 5
Visitor ✭ ✭ ✭

Hi Shalini,

 

I am facing the similar issue as Ben. 

 

Referring to the Google My Business API documentation (https://developers.google.com/my-business/reference/rest/v4/accounts.locations#locationstate), it states that canDelete - Indicates whether the location can be deleted using the Google My Business API.

 

Please let know if the documentation is out of date or there is still some gap in my understanding.

 

Thanks,

Vipin

Re: Can't delete location through API even though locationState.canDelete is true?

Google Employee
# 6
Google Employee

Hi @Vipin S,

 

If the canDelete boolean field of the LocationState object is true, your location can be deleted using the Google My Business API.

 

Thanks,

The Google My Business API team

Can't delete location through API even though locationState.canDelete is true?

Visitor ✭ ✭ ✭
# 7
Visitor ✭ ✭ ✭

I suspect that you are using terminology in a precise way that is very confusing to anyone who is not embedded in your team's understanding of how things work.

 

What call would you make using the GMB API to delete the location if canDelete is true but there is an entirely useless Google+ page associated with the location?

 

What state does that leave the GMB record in?

 

Did any of this behavior change with the v3 to v4 migration?

Re: Can't delete location through API even though locationState.canDelete is true?

Google Employee
# 8
Google Employee

Hi @Ben T,

 

The only change with the v3 to v4 migration is that if the canDelete field of LocationState is true:

  • In the v3, the location can be deleted using the Google My Business UI (cannot be deleted using the API).
  • In the v4, location can be deleted using the Google My Business API.

Please note, (for both v3 and v4) if location has an associated Google+ page, as indicated by a plusPageId in the LocationKey, it cannot be deleted using the API; instead, use the Google My Business website.

 

Please do let me know if you have any questions!

 

Thanks,

The Google My Business API team

Can't delete location through API even though locationState.canDelete is true?

Visitor ✭ ✭ ✭
# 9
Visitor ✭ ✭ ✭

I'm glad that you now allow deletes through the API.

 

But I've seen useless Google+ pages be automatically created for no particular reason that I understand.  This seriously limits the usefulness of the feature.