8

I'm trying to embed a Google Map in a way that does not use cookies, because of the EU cookie law.
I want to use the Embed API because it can display the place information (rating, directions button...).

I know the Maps JavaScript API does not use cookies and works through the domain maps.googleapis.com.
However, the Maps Embed API uses www.google.com, which sets a NID cookie.

If I try and replace the URL like so

<iframe
  width="600"
  height="450"
  frameborder="0" style="border:0"
  src="https://maps.googleapis.com/maps/embed/v1/place?key=MY_API_KEY&q=Space+Needle,Seattle+WA" allowfullscreen>
</iframe>

There's a 1s flash where it displays it properly but then there's the "Something's wrong" error overlayed.
In the console, this error is returned:

Google Maps JavaScript API error: UnauthorizedURLForClientIdMapError
https://developers.google.com/maps/documentation/javascript/error-messages#unauthorized-url-for-client-id-map-error
Your site URL to be authorized: https://maps.googleapis.com/maps/embed/v1/place?key=MY_API_KEY&q=Space+Needle,Seattle+WA

Is there a way to use the Embed API without cookies?

SlimDeluxe
  • 733
  • 8
  • 18

1 Answers1

0

You should have put your API_KEY where indicated. That URL in the iframes contains "MY_API_KEY", you should replace it with the key you get from the Google Developer Console.

Dakatine
  • 2,734
  • 1
  • 19
  • 20