Skip Navigation

[Closed] Google Maps Embed API

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
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9: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/Hong_Kong (GMT+08:00)

This topic contains 4 replies, has 2 voices.

Last updated by Luo Yang 1 year, 11 months ago.

Assisted by: Luo Yang.

Author
Posts
#2410845
Embed API Dynamic Address.PNG
Embed API Map Code.PNG

Tell us what you are trying to do? - Use Toolset Maps with Google Maps Embed API (to save costs as they're starting to really add up)

Is there any documentation that you are following? - Yes - https://toolset.com/forums/topic/displaying-a-map-based-on-the-url-provided-by-google-maps/

Is there a similar example that we can see? - Yes - https://toolset.com/forums/topic/displaying-a-map-based-on-the-url-provided-by-google-maps/

What is the link to your site? - OffendersExposed.com.au

Hey Team,

I've got an Embed Map set up correctly (iframe) and it works entirely as it should (thank you for the previous help I got from you guys with setting it up in the first place) except for 1 thing - It pings Google's system as "Dynamic SKU" instead of as "Embed SKU" - meaning it cost me $200 last month instead of $0.

Now, the way it is set up is so that I have a Toolset > Content Template that I use to show all 3000+ listings. On the template is the Embed map (see image 1) and also a field where it has the address written in text form (see image 2). Both are dynamically pulling the content from Toolset > Custom Fields on Toolset > Post Types.

One/both of these are pinging Googles systems as a Dynamic SKU and Google have told me that "there is no usage from Maps Embed API". I asked him to double-check, thinking it must be a glitch, but he said "First of all, I can confirm that you are not calling the Maps Embed API at all. However, using an iframe like you have is one way of implementing it. I can see you are using WordPress, thus my level of support doesn't extend that far."

So I come back to you guys.

Are you able to help at all?
- Does the text use the "Dynamic Maps API"?
- Does the embed map, since it's running through a Toolset "Fields and Text" block, does that mean it still uses the Dynamic SKU, even when it's an iframe/Embed SKU?

Thank you in advance for your help.

#2411301

Hello,

According to Google document:
hidden link

All Maps Embed API requests are available at no charge with unlimited usage.

You need to follow their document to setup the "iframe" HTML tags:
hidden link

See the example codes in above document:

<iframe
  width="600"
  height="450"
  style="border:0"
  loading="lazy"
  allowfullscreen
  referrerpolicy="no-referrer-when-downgrade"
  src="<em><u>hidden link</u></em>
    &q=Space+Needle,Seattle+WA">
</iframe>

You just need to replace location text "Space+Needle,Seattle+WA" with the Types shortcode, for example:
[types field='my-address'][/types]

For the question:
Does the text use the "Dynamic Maps API"?
You need to follow Google document to setup your Google Maps API key:
hidden link
Then use it in your "iframe" HTML tags, and replace "API_KEY", so it will be able to use Google Maps Embed API always.

Does the embed map, since it's running through a Toolset "Fields and Text" block, does that mean it still uses the Dynamic SKU, even when it's an iframe/Embed SKU?
Yes, Types shortcode outputs only the address value dynamically according current post setting.
See our document:
https://toolset.com/documentation/customizing-sites-using-php/functions/#address

#2413621

I'm responding just to leave this open for a few more days; I recently contracted Covid-19 and I can't get to this right now but I want to come back to it.

#2413625

Actually, I'm just going to copy/paste what I wrote to Google. See below:

To briefly explain the setup:
- My website is a search engine.
- We add listings imported from a spreadsheet with the location (suburb, state) auto-filled into a custom field on the website.
- Those listings automatically 'link' with Google maps. (I haven't tested what happens if we make a spelling mistake, yet)
- On the front-end: people can then search their local area (X kilometers from Y center-point) for all the listings in our database listed at those locations. - (Geolocation and, I think, autocomplete APIs, or Places API, or whichever it is)
- On the search results page is even a map that has 'pin points' on it, dynamically showing the results on that page. (Geocoding? Dynamic API?)
- If a person clicks on a listing for more information about that specific one, the content template has a map on it, too. (Embed API)

And now, for some screenshots:

This is the front-end search function: (zoomed out to fit and map-relevant sections circled)

(I made a video instead of images for you guys, for Toolset) - hidden link

And the front-end of a single entry: (also zoomed out and circled)

(See Video)

This is the code/setup I'm using for Embed Maps:

(See Video)

The actual code, itself, is:

"<iframe width="1800" height="250" style="border:0" loading="lazy" allowfullscreen="" referrerpolicy="no-referrer-when-downgrade" src="hidden link

field='suburb-of-offender' output='raw'][/types]
</iframe>"

_

So, basically, someone will search an area and then click through multiple listings in that area - Meaning 1 Geo/Place/Dynamic API usage per 1-40 Embed API usage. (up-to 40 results per page)

And, actually, now that I think about it. If someone clicks OFF the search page (eg. to a listing) and then clicks the BACK button (to go back to the search results) will that count as one or two Geo/Paces/Dynamic API usages? (If two, would 'opening in a new tab' make it into just one?)

But, regardless, if there's zero Embed API usage, but the maps are still working on the pages, that's a big problem; I'm probably being charged at the Dynamic API rate.

_

My only last thought is that on the individual pages (screenshot 2), in the smaller drawn circle ("Blue Mountains" in this case) - is THAT using the "Dynamic API" because it's part of a template that dynamically pulls the content from the custom post type? It's the source for the Embed API map above it; could it be somehow using the Dynamic API (keeping in mind the 'import' function I explained above - how we just import the address field and Google somehow automatically attaches the map location to it)

_

Anyway, I wanted to be as thorough as I could be. Let me know if there's anything else I can do to get to the bottom of all this.

#2413637

I have marked this thread as "Waiting for feedback" status.

Did you get the answers from Google support?
And in Toolset side, Toolset Maps plugin provides cache feature:
https://toolset.com/course-lesson/data-caching-for-maps-addresses/
It should be able to reduce Google Map API requests of your website.

As I mentioned above, you can use two kinds of Google Map API keys in your website:
1) Follow our document to setup the Google map API
https://toolset.com/course-lesson/creating-a-maps-api-key/
Enable: Maps JavaScript API, Geocoding API, and Places API.
Use it in Toolset side

2) Setup another Google Maps API key, enable only: Google Maps Embed API
hidden link
Use it in the Embed map

The topic ‘[Closed] Google Maps Embed API’ is closed to new replies.