New Google Maps pricings have gone into effect and many have been taken by surprise when recieving the billings for the service, with an increment of up to 1,500% according to some sources. I've been witness to a first bill worth $200 (after the $200 of free usage were spent).
I won't discuss the reasoning behind Google raising their prices so much. Time will tell if that was the right decision for them or not. Evidently, the service carries an associated cost which we need to take into account when making use of Google Maps' API's.
What can we do to reduce the costs associated to our maps?
The first option seems obvious, implement a cheaper alternative solution. You can count on me, should you need help with that.
However, if we opt to keep using Google Maps, we'll need to minimize costs as much as we can. We're about to take a look at how we can achieve such a target.
How to use Google Maps
There's two ways of using Google Maps in our website.
The easiest method is to embed the map. To do this we head to http://maps.google.com/ and locate the adress we want. After that, we click on Share, select Embed map and we'll be given the HTML code we'll add to our website.
This gets better with Google My Maps. This service gives us greater map customization settings. For instance, we can add markers, descriptions, lines, etc. Once we're satisified with the result, we'll obtain the code to add the map to our website.
This way we can add every static map we need to our website. This option proves sufficient in most cases.
If this is all we need, then we're in luck, as this option continues being free of charge.
However, what if we need, for example, generate routes, point out places of interest nearby and/or dynamically generate maps from addresses? In these cases, we'll need to make use of Google Maps' API's and pay for the services.
Structure of Google Maps' API's
We'll find the API's in Google Maps Platform. They're sorted in three large groups, according to the functionalities they offer to their users:
Maps - Generates all sorts of maps, static or dynamic, with the possibility of including Street View. These maps allow for a high degree of customization. This is the more common function which will be used, for instance, to display a map given some geograpghic coordinates or a zip code.
Routes - As the name implies, its used to offer detailed instructions on how to travel from any point on the planet, by any means of travel. The information is updated in real time in most cases. They're frequently used as a complement to a map.
Places - This gives information about places in relation to a geographic localization (for example, restaurants, hotels, musemus, hospitals, schools, etc.), including timetables, reviews and real time information. This is also used as a complement to a map.
The pricing structure is complicated. Essentially, you pay for the petitions made to Google's servers, with prices varying according to the type of petition. We can check the pricing in Google Maps Platform's pricing sheet.
We can make an estimate of our monthly expenses using the price calculator Google offers.
It's important to keep in mid that we're paying for each petition amde, which isn't equal to the number of visits to our webpage. For example, when displaying a map (1 visite) we can make many more petitions (routes, nearby places, street view) depending on the type of map shown.
In summary, we can establish that:
Maps can be used for free in phones and if they're embedded in our website (without indications or street view). Everything else we have to pay for, depending on how we use them.
Google offers a credit of $200 a month, we only have to pay for the usage of the API's once we've gone over that limit. The usage we can make of each service is established in the Pricing Sheet. This credit is taken into account in the calculator. If we're running a small website or if we're developing one for a client, we might be lucky enough to not have to pay anything at all.
It's mandatory to obtain an API key (as we'll see soon after, we might need to obtain more than one key) to use the service. On top of that we're required to establish and enable our billing data, or else we won't be able to use Google Maps Platform's API's.
These are the new rules of the game, so we either adapt to them or find an alternative solution.
Using Google Maps Platform
Step 1 - Setting up our billing account
The first step is to sign up in Google Cloud, if we haven't done so already. Once inside the console, we'll head to the Billing section.
- Establish new payment methods
- Set up the payments: the frequency, our tax data, etc.
- To avoid unwanted surprises, we'll set up budgets with the necessary alerts. It's important to state that the alerts will not block consumption, these simply warn us to take to the necessary means to stay on top of our expenses.
Step 2 - Enable the API's we're going to use
Head to the API's and services section in our account
- Select an existing project or create a new one if we need to. The project is only relevant to keep everything organized, it's the credentials which determine their usage.
- Next, enable the API's. The link will take us to the library where we'll select those we're going to use.
- Once the API's have been enabled, we'll generate the credentials for our devices and servers.
There are numerous tutorials on credential generation out there. I'll keep this short.
When we generate credentials, we select API code in the menu. After that we'll obtain the key which we can use in our projects. The most important thing is to establish usage restrictions in the keys, otherwise any malicious user can take advantage of them. To alleviate this possible abuse, Google limits the use of keys without restrictions by blocking them. This is much more preferrable to a disproportionate bill.
Each API requires its own type of restriction. For instance, Maps requires restriction by url, this way only the visitors of our website can use the key. On another hand, Routes requires restrictions by IP, this way only our server will be allowed to make the petitions. As a result, we might need more than one key once we start up a project which relies on Google Map Platform.
Although Google's new pricing policy hasn't been well recieved, it's still possible in a number of cases to keep using Google Maps for free.
If we aren't lucky enough in that regard, we've briefly glanced over the tools which allow us to keep costs under an acceptable level in our budget.
Finally, we can always resort to alternative providers, should they offer and adequate solution to our necessites at a price which would seem more reasonable.