Home › Toolset Professional Support › [Resolved] Just noticed huge Google Cloud monthly bills
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
- | 10:00 – 13:00 | 10:00 – 13:00 | 10:00 – 13:00 | 10:00 – 13:00 | 10:00 – 13:00 | - |
- | 14:00 – 18:00 | 14:00 – 18:00 | 14:00 – 18:00 | 14:00 – 18:00 | 14:00 – 18:00 | - |
Supporter timezone: Asia/Kolkata (GMT+05:30)
This topic contains 11 replies, has 2 voices.
Last updated by Minesh 1 year, 3 months ago.
Assisted by: Minesh.
Tell us what you are trying to do?
I was using a different plugin for my therapist directory that included a Google Map search and geocoding. It didn't cost me anything. I switched to Toolset and now find I've been getting charged hundreds of dollars a month by Google Cloud!
Is there any documentation that you are following?
https://toolset.com/course-lesson/data-caching-for-maps-addresses/#checking-for-missing-cache-entries
I checked this and there were only 17 missing entries.
Is there a similar example that we can see?
What is the link to your site?
hidden link
Hello. Thank you for contacting the Toolset support.
Do you have distance custom search publicly accessible? If yes, can you make sure that it should be accessible for login users and not available publicly.
You can also investigate when and with what address the requests to map are increase with what domain.
Please check the following doc that might be the alternative way that help you to cut the cost:
- https://toolset.com/2022/10/how-toolset-and-the-maps-static-api-can-help-you-cut-costs/
Please check the following related ticket that might help you:
- https://toolset.com/forums/topic/high-geocoding-usage-costs-from-google/#post-2360535
- https://toolset.com/forums/topic/spike-in-google-geocoding-api-requests/
Thank you for the reply.
This is not a sudden increase since using Toolset. The bills have been huge every month while using Toolset.
Yes, the search is publicly accessible. It is for members of the general public to find a therapist. It needs to be available publicly.
Yesterday there were only 700 visits to the website, yet there were over 7000 requests to the Geocoding API.
Also, when I look at the APIs & Services page in Google Cloud, it shows that of the thousands of requests to the Geocoding API, 99% are shown as being errors.
Does this point things in a specific direction as far as what the problem could be?
To decrease the number of requests we are using caching but this is not applicable to address search. As your page is public anyone can search for the address and it will be a one request to google API.
I'm not sure yet from where the error comes from, you should try to set your page behind the login and check if still it happens to ensure that no one hijack your google API.
Hi Minesh.
Thank you for your reply.
Unfortunately, putting the search behind a login defeats the purpose of having it.
The large number of Geocoding calls has been present since Toolset was implemented. This isn't a sudden spike that would indicate an attack or hijack.
Please help resolve this.
You will need to keep eye when and on what time and with what request the google API is called.
I already shared the following Doc that might help you to reduce the number of google map API call. Check if that helps:
- https://toolset.com/2022/10/how-toolset-and-the-maps-static-api-can-help-you-cut-costs/
Please check the following suggestion:
- https://toolset.com/forums/topic/without-openstreet-maps-how-can-we-make-google-maps-cheaper/#post-2366001
This is how data caching for Address works with Toolset Maps:
- https://toolset.com/course-lesson/data-caching-for-maps-addresses/
Other than that if you see any things and tell me Toolset is really a cause of this issue you can direct us as we do not have any control over google map API call as we are just passing the address provided by user to google map API.
I have been speaking with Google Cloud Support and they tell me that the same wrong request is being sent multiple times by my Toolset implementation.
99% of my requests are duplicates. There must be a loop somewhere.
Please assist.
This seems to be only related to the Geocoding API. The other APIs requests are fine.
Hi again.
Here are some additional info and questions
- The requests to the Geocoding API that result in an error response are all "zero results" errors; this means the API didn't find the location. Could something be resending the request if it doesn't get a non-error response?
- Settings > Forms > Post Expiration was set to every 5 minutes; is there any way this could be a factor?
- The Address field in my custom post type no longer provides autosuggestions; is this an expected behaviour of when I have reached a quota on my Google Maps API key? Could something else cause this?
Thank you in advance for your assistance. I look forward to your response.
- The requests to the Geocoding API that result in an error response are all "zero results" errors; this means the API didn't find the location. Could something be resending the request if it doesn't get a non-error response?
- Settings > Forms > Post Expiration was set to every 5 minutes; is there any way this could be a factor?
==>
This would be a good hint. What if you disable the post expiration and check if that helps to reduce the number of requests, if yes, that means there is something that interacting with Google map API.
- The Address field in my custom post type no longer provides autosuggestions; is this an expected behaviour of when I have reached a quota on my Google Maps API key? Could something else cause this?
==>
That could be the quota issue. You can go to Toolset => Settings => Maps and click on the button "Check API" and check if it shows any error message in red color.
More info:
- https://toolset.com/course-lesson/creating-a-maps-api-key/#entering-the-maps-api-keys
Thank you for the response.
I have seen some improvement with my recent changes. I am also considering making another. At the moment, I have a new member registration form that is public facing. It has an custom post type Address field that provides autosuggestions.
Could that be causing these excessive geocoding API calls if it's getting hit by bots?
- I considered implementing recaptcha on this form
- However, I don't believe that would help as this Address field gets its autosuggestions before any submit button is clicked
- I am now considering moving the Address information into the Edit profile field that is behind the login instead of having it in the registration form that is before login. Do you think this will make a significant difference?
- Where is it determined if a field uses the Google Maps API, or do Address fields just automatically use the GM API if there is a key in place?
The "Check API" button says that the API appears to be working properly.
With the changes I've made, I now seem to be having a problem with the Map search not working with specific addresses. It seems like it only works if you enter a city, but not an actual address. I'm wondering if it is only working for places/addresses that are already in the cache.
Could this be possible?
If so, can you point me in the direction of potential fixes for this?
Which API does this hit?
Thanks.
- I considered implementing recaptcha on this form
- However, I don't believe that would help as this Address field gets its autosuggestions before any submit button is clicked
==>
Yes, thats correct that will not help much.
- I am now considering moving the Address information into the Edit profile field that is behind the login instead of having it in the registration form that is before login. Do you think this will make a significant difference?
==>
It should be as the Address field will be behind the bars and not accessible publicly. You should try and check.
- Where is it determined if a field uses the Google Maps API, or do Address fields just automatically use the GM API if there is a key in place?
==>
At the Toolset => Settings => Maps tab at top of the page there are options you will have to select if you want to use Google API or Azure API. Please check the following screenshot:
- https://toolset.com/wp-content/uploads/2018/07/toolset-maps-select-and-enter-maps-api-keys.png
Please check the following section that shows how you should create map API key and what google map APIs are involved:
- https://toolset.com/course-lesson/creating-a-maps-api-key/#creating-an-api-key-for-google-maps
I'm not sure what issue you get with custom search, if you can share problem URL and tell me with what address you have issue with I can check further and for that I will require admin access details.
*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.
I have set the next reply to private which means only you and I have access to it.