Set the product's location details
- Open the product and go to the Details tab.
- Enter the latitude and longitude by hand or use Pick location from the map, which also has an address search.
- Save.
Show the location on a Google map
A Google map is an alternative to the OpenStreetMap map. When a Google Maps API key has been set in Johku, the product page shows a Google map instead of the OpenStreetMap map. Showing a Google map requires three things in addition to the location details, which makes four requirements in total:
- Google Maps API key created and set in Johku, see Get a free Google Maps API key.
- Billing details set in Google's Cloud service (ordinary map use stays within Google's free quota).
- Cookie management enabled in your shop. Google maps can't be shown without cookie consent management, see Cookies and cookie consent on your Johku storefront.
When all four requirements are met, the Google map is shown on the product page to visitors who accept marketing and statistics cookies. A visitor who doesn't accept them doesn't see a map on the product page, because the OpenStreetMap map isn't shown when a Google Maps API key has been set. If you want to return to the OpenStreetMap map, clear the Google Maps API key field under Settings → Storefront → Other in the Johku admin and save.
Show another map service's map
If your location is shown in another map service, you can embed its map on the product page:
- Get the embed code from the map service you use. The code must be in iframe format; script-based embeds don't work.
- Open the product's Details tab and paste the code into the Custom map code field.
- Save and check that the map is shown on the product page.
Result
The product page shows a map with your location marked on it.
If the map isn't shown
There is an empty space or an error message in place of the Google map. The Google map is shown only to a visitor who has accepted marketing and statistics cookies, so first check your own cookie choice. If you have accepted them, one of the four requirements is missing. Check in order: the product's location details, the API key in Johku, the billing details in Google Cloud and the status of cookie management. If you recently switched to your own domain, add the new address to the API key's allowed addresses.
The embedded map isn't shown correctly. Check that the embed code is in iframe format and that your location is shown in the map service itself.