Knowledge base / Platforms

Google Maps not working on Wix: how to fix it

Wix's own Google Maps element doesn't ask you for an API key, so when it breaks the cause is almost always on the Wix side: a consent setting, an unpublished change or a location Google can't place. Custom code you've added yourself is different, and follows Google's normal key rules.

Which kind of map do you have?

Work this out first, because the fixes are different.

  • The built-in Google Maps element. Added from Add Elements → Contact & Forms → Maps (or Full Width Maps) in the Wix Editor. In the Wix Harmony editor it sits under + Add → Elements, in the Form & Contact group. You set the pins with Manage Locations. There is no API key field: Wix handles the connection to Google.
  • A map app from the Wix App Market. Store locators and multi-pin map apps have their own settings panel. Some ask for your own Google key, most don't.
  • Custom code. A Google Maps iframe pasted into an Embed HTML element, or the Maps JavaScript API added through the site's custom code settings or Velo. These use your own Google key, or a keyless share embed.

If you're not sure, click the map in the editor. The built-in element shows a Manage Locations button.

How to tell what's wrong

  • Map missing for new visitors only, works for you: a cookie banner is holding it back until consent.
  • Editor shows the map, live site shows the old one or nothing: the change hasn't been published.
  • Map loads but the pin is in the wrong place: Google matched your address to a different spot.
  • Grey box with “Oops! Something went wrong.”: custom code using the Maps JavaScript API with a key problem. Open the browser console for the exact error.

A custom JavaScript map with a key problem logs something like this in the console:

Google Maps JavaScript API error: RefererNotAllowedMapError
https://developers.google.com/maps/documentation/javascript/error-messages#referer-not-allowed-map-error
Your site URL to be authorized: https://…

Why the built-in element fails

1. The cookie banner is blocking it

This is the most common cause on sites with a consent banner. Wix's Usercentrics cookie banner has an Enable placeholders option under Advanced. With it on, Wix holds back third-party components it manages, which Wix names as including Google Maps and Facebook, until the visitor gives consent. Visitors who decline, or never click the banner, see a placeholder. You don't notice, because you accepted the banner long ago and Wix remembers the choice.

2. The change isn't published

Edits to the map, including new locations, only reach the live site when you click Publish. Wix's own help gives this as the fix when preview and live site differ.

3. Google can't place the address

The element looks addresses up through Google. A new building, a unit number or an unusual format can land the pin in the wrong place or nowhere. Wix recommends using coordinates instead: in Google Maps, right-click the exact spot, copy the latitude and longitude, and paste them into the address field in Manage Locations.

4. A CMS-connected map has items without addresses

If the map is connected to a dataset, every item needs a value in the address field. Wix's help says that if some items lack one, the map won't show any collection items. Add a dataset filter so the address field is not empty.

The fix for the built-in element

  1. 01Open the live site in a private window. If the map is missing and a cookie banner is showing, accept it. If the map appears, the banner is the cause.
  2. 02In your site's dashboard, open Cookie Consent Banner and check the Advanced settings for Enable placeholders. Decide with whoever handles your privacy compliance whether the map may load before consent. If it must wait, make sure the placeholder text tells visitors how to show it.
  3. 03In the editor, click the map, open Manage Locations and check each location. Replace any address that pins wrongly with coordinates.
  4. 04Click Publish, then reload the live site in a fresh private window.
Google Maps and the Wix cookie banner

Wix's GDPR FAQ states that Google Maps isn't integrated with Wix's Cookie Banner solution, and suggests removing the map if you believe local privacy rules mean you shouldn't use it. The placeholder setting in the newer Usercentrics banner is the control that does hold maps back. If you rely on a third-party consent tool added through custom code, check its own rules for Google Maps as well.

If you added a map with custom code

Custom code follows Google's normal rules. A keyless share embed from Google Maps (Share → Embed a map) needs no key. An Embed API iframe (google.com/maps/embed/v1/…?key=) or the Maps JavaScript API needs a valid key, an active billing account and the right API enabled.

The trap specific to Wix is the Embed HTML element. Wix runs that code inside its own iframe, served from a Wix domain rather than your own. A key restricted to yourdomain.com/* can then fail with RefererNotAllowedMapError, because Google sees the iframe's address, not your page's. The console line Your site URL to be authorized prints the exact URL Google saw.

  1. 01Open the live page, press F12 and look at the Console tab. Note the error code. How to read the console covers this in detail.
  2. 02For RefererNotAllowedMapError, add the URL from Your site URL to be authorized to the key's website restrictions in Cloud Console. See the full referrer guide.
  3. 03For ApiNotActivatedMapError, enable the API the code uses (Maps JavaScript API, or Maps Embed API for a /maps/embed/v1/ iframe).
  4. 04For InvalidKeyMapError or MissingKeyMapError, re-paste the key into the code. Check for spaces or a cut-off string.
  5. 05For a billing error, attach an active billing account to the project. See re-enabling a suspended project. Publish after any code change.

For a single location, the simplest fix is often to replace the custom code with the built-in element or a keyless share embed. See replacing a broken iframe embed.

Confirm it is fixed

Open the live, published URL in a private window, so you arrive with no stored consent and no editor session. Check the map with and without accepting the cookie banner, and decide whether that behaviour is what you want. Check on a phone too, because Wix keeps separate mobile settings for the element.

Then run a scan on the page. It loads the page as a first-time visitor would and lists the Google Maps requests and console errors it saw, so you can see whether custom code is still failing behind a working-looking page.

Common questions

Do I need a Google Maps API key for a Wix map?

Not for Wix's built-in Google Maps element. It has no key field and Wix handles the connection to Google. You only need your own key for custom code that uses the Maps JavaScript API or the Maps Embed API, or for an App Market app that asks for one.

Why does the Wix map work for me but not my visitors?

Usually the cookie banner. If placeholders are enabled, Google Maps waits for consent, and you accepted long ago. Test in a private window without accepting the banner to see what new visitors get.

Why is my Wix map pin in the wrong place?

Google matched the address to a different location. In Manage Locations, replace the address with the exact latitude and longitude copied from Google Maps, then publish.

My custom Google Maps code works on a test page but not inside Wix. Why?

Code in an Embed HTML element runs inside a Wix iframe on a Wix domain. If your key is restricted to your own domain, Google rejects it. Add the URL shown in the console's 'Your site URL to be authorized' line to the key's website restrictions.

Check whether this is your error

A scan tells you in about twelve seconds, from a clean session.

Related articles