Skip Navigation

[Resolved] Google Maps Geocoding API generates a huge number of requests

This thread is resolved. Here is a description of the problem and solution.

Problem:
Google Maps Geocoding API generates a huge number of requests

Solution:
Please make sure that you did not deleted the cache entry from maps address cache or entries from "toolset_maps_address_cache" database table.

You can find the proposed solution in this case with the following reply:
- https://toolset.com/forums/topic/google-maps-geocoding-api-generates-a-huge-number-of-requests/#post-2371447

Relevant Documentation:

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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

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 8 replies, has 2 voices.

Last updated by nadavL 1 year, 11 months ago.

Assisted by: Minesh.

Author
Posts
#2370559

Hi, in the past few days, Geocoding API generates a huge number of requests.
Around 3000 per day, compared to around 80 before.

There's no increase in the number of visitors.

Regardless of this ticket, please note that sometimes when I try to open a support ticket, I only have a chat option. The chat never works and after a while, I get an option to open a ticket using email, but when I click that option I get a 404 page.

Please advise.
Thanks,
Nadav

#2370681

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Regarding chat issue, there seems to be issue and its known to us and it should be fixed soon.

We just published the following ticket that should help you to implement the static maps using google map that should help you to lower the google map cost:
=> https://toolset.com/forums/topic/without-openstreet-maps-how-can-we-make-google-maps-cheaper/

Another thing is that, you should make sure there is no bot running on your site that uses the map API as Toolset's role is to offer the the map feature offered by google.

You may try to add your custom search which have address field search for loggedin users only to make sure there is no spam requests.

#2370731

Thanks Minesh but static maps are what I need.

Please note that I don't have an address search option, I only display places on a map. Could you please explain how I can make the map visible only to registered users?

Regarding the bot. If there was some bot running on my site, wouldn't I see an increase in the number of visitors to my site?

Thanks

#2370751

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

You can use the conditional block or [wpv-conditional] shortcode to display the conditional content.

Here is the doc about how you can check the user role and check and setup the condition that if current user role is not empty then you can display your map:
- https://toolset.com/course-lesson/using-toolset-conditional-block/#conditions-based-on-user-roles

Regarding the bot. If there was some bot running on my site, wouldn't I see an increase in the number of visitors to my site?
==>
I'm not sure as I honestly I do not have any expertise exploring bot, maybe google support should answer this question in this regard.

#2370927

I spoke with Google support.
They told me that my Geocoding requests are actually being generated from the server side.
They asked me for a list of servers' IPs.

I'm checking with my hosting provider, but wanted to ask if it might be related to Toolset servers. Is there any communication with Toolset servers for that process?

Thanks

#2371439

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Toolset uses the custom table to store the address field value to the database table "toolset_maps_address_cache " that will help to minimize the number of map request if the address is available in cache table. Toolset uses
=> https://toolset.com/course-lesson/data-caching-for-maps-addresses/

You can also check for missing address entries and if found those will be added to the cache table:
=> https://toolset.com/course-lesson/data-caching-for-maps-addresses/#checking-for-missing-cache-entries

Those are the points where there is a possibility that toolset uses google API.

Please check what IP is causing this and if Toolset is involved we are happy to look at it.

#2371443

I can't check which IP causes this. Google won't tell me the IP as it's private data. They asked me to tell them the IP of the servers I work with.
There's a good chance it's my hosting provider. Do the API requests arrive from the hosting server or from the user's IP?

Also, when I clear the site cash, does it delete the addresses database Toolset store? If so, that might explain the increase, as I was clearing cash many times in the past few days.

#2371447

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Yes, clearing the cache means if address is not found in "toolset_maps_address_cache " table, then it will fire the request so as you said that explains why the number of request is raised.

When you try to load the page/post that holds the address field, Toolset first look the cache table, if its available in cache table then it wont fire the google request to fetch the address field information, if the address is not found then it will fire the request.

#2371449

My issue is resolved now. Thank you!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.