Avoid a “Google Maps” map embedded into a web page

2019-04-21 12:14发布

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条回答
甜甜的少女心
2楼-- · 2019-04-21 12:39

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

查看更多
劫难
3楼-- · 2019-04-21 12:43

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

查看更多
登录 后发表回答