Navigation überspringen

[Eskaliert zur 2. Ebene] Multiple test requests for Google Maps API

This support ticket is created vor 3 months, 2 weeks. There's a good chance that you are reading advice that it now obsolete.

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 -

Zeitzone des Unterstützers: Asia/Kolkata (GMT+05:30)

Dieses Thema enthält 24 Antworten, hat 1 Stimme.

Zuletzt aktualisiert von Minesh vor 2 months, 2 weeks.

Assistiert von: Minesh.

Author
Artikel
#2853664

Hello Minesh,
Thank you very much. What is the advantage of the second API key? Are the requests then sent on the server side? When exactly is this connection used? I’m curious to hear what your developers say – whether there’s a solution. The verification process results in additional unnecessary costs when using the Google API.

#2853682

Christopher Amirian
Unterstützer

Sprachen: Englisch (English )

Hello, Minesh is off today. I will answer the question to the best of my knowledge.

2nd API key (Toolset Maps settings), what's the advantage?

It's used exclusively for server-side requests, so it's never exposed in the HTML. This lets you keep the front-end key safely restricted by HTTP referrer (domain) while still allowing server-side calls to work.

For more information:
https://toolset.com/course-lesson/creating-a-maps-api-key/

Are requests sent server-side with the 2nd key?

Yes. Toolset uses that second key for server-side calls (e.g. when it needs to geocode addresses / fetch coordinates).

When exactly is the server-side key used?

When there are Address fields whose lat/long are not yet cached in Toolset's map database, Toolset triggers Geocoding to cache them.

Does the 2nd key stop the "verification/probe" costs (autocomplete test requests)?

Not by itself. Those autocomplete requests are browser-side, so they still use your front-end key. The second key only applies to server-side requests.

Thanks.

#2853703

Dear Christopher,
Thank you very much for your feedback. That makes sense. We’ll then wait for Minesh and the feedback from the dev team.

#2854485

Minesh
Unterstützer

Sprachen: Englisch (English )

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

I again created the following sandbox site and you can auto-login to it using the following link:
- versteckter Link

I've created the form which have multiple address field on that:
- versteckter Link

I do not see the multiple request issue I tried with my google API key as well as I tried with your google map API key. This seems to be specific to your site.

#2854503

Hello Minesh,
When I open your test page, it immediately attempts to establish a connection to the Google Maps API using the search term ‘Phoenix’. It appears that this connection is being blocked (403 Forbidden). However, the old API is then automatically activated on your test page, which is not an option for us. The console displays the message ‘Classic AutocompleteService API is working - using classic API’. We would like to block this test query ‘Phoenix’ whilst still using the new API due to the improved billing.

#2854626

Minesh
Unterstützer

Sprachen: Englisch (English )

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

I need to reproduce the issue on the sandbox site I shared.

What if you register your new API key to the sandbox site I shared and tell me if you able to see the issue and if you can see it then I can go ahead and report the issue in front of our Devs.

Please share any steps if I have to follow on the sandbox site I shared that should help me to reproduce the issue.

#2854638

Hello Minesh,
The problem occurs also with the current API key in your sandbox. It is therefore not dependent on the API key.

#2854746

Minesh
Unterstützer

Sprachen: Englisch (English )

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

I've escalated the issue in front of our Devs and they will work on it in order to provide a fix but there is no ETA on what the fix made available.

For now, you may consider to use the JS custom code I shared if that helps.

#2855414

Hello Minesh,
Thank you very much. I’m replying so that the ticket isn’t closed.

#2855491

Minesh
Unterstützer

Sprachen: Englisch (English )

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

The ticket will not be closed as its in escalated state. I'll get in touch with you when I have any update on this issue.