How do I set up Google Maps, geocoding and get API keys?
We can display maps on specific pages of your website and mobile app powered by Google Maps.
These pages are:
- Mobile in-app events page
- School closures school page
- Local Directory business page
- Events Calendar - home, event, venue and category pages
We also use Google's Geocoding service, which turns a street address into a set of coordinates.
The sections where we use geocoding are:
- When searching the Events Calendar, if you enter a location
- When searching the Local Directory for businesses near the location, you enter
Google requires each website to have API keys for these services and, where applicable, to restrict a key so it cannot be used on other websites.
To get your API keys, sign up for an account with Google and add a payment card, which will be billed if usage via your website/app exceeds their access quotas.
You can learn more about it and register for Google Maps Platform on its website.
While we can't directly support third-party services, we have put together this guide, which advises how to get set up.
Please remember that Google may change its service at any time, and our instructions are only accurate as of the time they were written.
Setting up your Google account
- When registering, select the Maps and Places products.
- Use a work/company Google account rather than a personal one.
When asked to enter a Project Name, use your radio station name.
If you have a group of stations, you can use the same API keys for all of your stations, so consider using your company's name.
- You'll be asked to create a billing account or select an existing one. Google may charge you if your usage exceeds the quotas they enforce.
- Once you're registered, go to the Google API Console.
- Go to the Google APIs section and enable these APIs:
- In the Google Cloud Platform main menu, navigate to APIs & Services, then Credentials.
Create two API keys. You'll need to paste them into the boxes in our settings page.
For each key, select Restrict Key and set it up as follows:
- For the first one, call it Maps.
In the Application restrictions, choose HTTP referrers.
If you have one website, you can enter its URL.
If you have a mobile app, you'll need to enter your 'staging URL'.
If you have multiple websites/apps, you'll need to enter all their URLs - tap enter to add each one in turn.
We've provided a quick reference page that shows all the URLs for your organisation.
- Go to the API restrictions and add both the Maps Static API and Maps JavaScript API. If you don't see them here, then you didn't successfully enable them earlier.
- The second key is called Geocoding.
- Leave Application restrictions set to none.
- Go to the API restrictions and just select the Geocoding API.
Once you've added your two keys to the settings page, that's all there is to it. Test them by navigating to one of the pages listed at the top of this guide.