22

I have a simple web site page with a map (from Google Maps) embedded into an iFrame.

<iframe src="https://www.google.com/maps/embed? .... ></iframe>

See Fiddle as example.

Embedding the map into the page results in Google's cookies being stored on the client's browser.

Is there any way to avoid that?


Why I'm asking this:

in the EU a web site that stores 3rd party cookies on the user's device is required to get informed consent from the user and give her/him discretion to read a long document about cookies and privacy. See Cookies - European commission

A web site that uses only session cookies (non persistent) is not required to get informed consent.

There are many simple websites whose purpose is just to give basic online presence to commercial activities such as restaurants, shops and so on.

Normally those websites only need session cookies (or no cookies at all).

However as many of them use embedded Google Maps' maps to show their location they automatically fall into the category of "websites that stores 3rd party cookies" and must obey all the EU obligations regarding that. I think too much overhead for just displaying a map.

2 Answers 2

24
+50

Maybe you can use cookieless google maps v3:

https://mapsplatform.googleblog.com/2011/10/a-grab-bag-of-maps-api-news.html

The eagle eyed amongst you may have spotted that we have updated all of our documentation to recommend that the Maps APIs be loaded from maps.googleapis.com rather than maps.google.com or maps-api-ssl.google.com. When loaded from maps.googleapis.com, the current implementation of the Maps API v3 does not rely on the exchange of cookies with Google. This improves both the security of the API, and the performance on bandwidth constrained networks. We therefore recommend all sites switch to using maps.googleapis.com.

Link to tutorial:

https://developers.google.com/maps/documentation/javascript/adding-a-google-map

4
  • 2
    Thank you. That was exactly what I was looking for.
    – Paolo
    Commented Dec 24, 2016 at 14:28
  • silly question - this is not free isn't it ? Or just like 90 days trial ? Commented Apr 22, 2021 at 22:27
  • @FenixAoras Take a look at pricing table: cloud.google.com/maps-platform/pricing It looks like you can use for free 200$ bucks montly equivalent of services.
    – charlie_pl
    Commented Apr 23, 2021 at 13:04
  • This also works for maps embedded via iframes.
    – fakemeta
    Commented Sep 11, 2021 at 12:54
4

I've found a very fast way of doing this, which could be also helpful. This site creates a cookie less iframe which can be place for instance, in a visual composer for wordpress maps container https://www.uwp.is.ed.ac.uk/3rd-party-widgets/maps/

I've tested it and it won't load NID cookie, so no need to get consent for it.

Hope it helps

1
  • 1
    The service is managed by the University of Edinburgh and claims to generate a OpenStreetMap interactive map (served by University) with no privacy-invasive cookies. Alas, the service is reserved to the sites related to the University. Currently, the OSM generated map will not get served by the University's servers to unidentified website, and will result in a warning stating "Interactive map disabled". A proper answer here would be explain how they designed their service, since embedding a OSM map normally also results in their (third party) cookies being stored on the client's browser...
    – Tardis
    Commented Aug 30, 2021 at 16:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.