New Error with Geocoder
$GLOBALS['GEOCODER_GOOGLE_API_KEY'] = '***Your API Key Here***';
Hi nmsinc, did you resolve this?
IT, I'm getting this notice on a site as well and I'm trying to update to the latest Geocoder plugin. This is in the interactivetools readme:
"Note that the Google Geocoding API no longer requires a Maps API key. You'll
only need a Maps API key if you choose to use Google Maps API v2."'
But it also says:
"First, if you're planning to display your geocoded addresses on a Google Map,
you'll need to get an API key. The steps to do this are below:"
When I go to this URL, it's nothing like the readme file and there is a get started button with the cloud that wants me to create a project and then setup an account. I created the project but when continuing, it then lists my credit cards and a free trial button. Am I doing this correctly? A free trial leads to a paid account. If this embedded map gets over a certain number of visits am I going to get charged? I have too many sites to start putting my CC in there. We have to pay now or what? If that's the case, even with multi location businesses, I'm doing a pic of a map and a link to directions which pops open the app on your phone anyway. The most complex thing I'm doing is having visitors enter their address and clicking get directions. Unnecessary these days. However, I do a few franchises and yes, it would be nice to show the nearest location and miles on their website.
Anyway, I'm lost. Please explain how I get a free API with a limited amount of visits or has this changed?
My errors apply to a client website. I have two issues:
1. I have customized the current geocoder package and the new update cause my client's pages (multiple) to error out.
2. My client feels that I should have known that Google was going to change protocols on their geo site and I should fix all of the code for FREE.
I did contact Google the same way that you did and I do not understand why they need our CC as well. Each page constitutes a project the way I understand it and I'm not sure if they give a multi project (page) key or separate keys for each page. Very confusing!!!!
Due to some recent changes by Google (https://developers.google.com/maps/billing/important-updates), the info in the plugin readme.txt is no longer 100% accurate. We've been looking into the changes and will be updating our documentation with the next plugin release, but for now, I can share some of this new information with you here.
Google now provides a $200/month credit towards their API services. This translates to 40,000 geocoding requests per month (https://cloud.google.com/maps-platform/pricing/sheet/), which should be sufficient for most projects. Accessing the API does now require setting up a billing account with a CC number, but the credit will be applied automatically each month.
If you are at all concerned about exceeding the credit, it's possible to set a hard cap on API usage using quota limits (https://cloud.google.com/apis/docs/capping-api-usage). These limits are per-day, so for the Geocoding API that would work out to roughly a "1300 requests per day" quota limit to stay under $200. Budget alerts are also available (https://cloud.google.com/billing/docs/how-to/budgets) to get notifications about overall billing account usage.
To get an existing API key up and running with the new system, you can try checking out this link: https://cloud.google.com/maps-platform/user-guide/ and clicking on the Transition Tool. This tool will help identify any steps you'll need to take to reactivate the API. Alternately, here are our updated instructions for setting up a new key:
- Visit https://developers.google.com/maps/documentation/geocoding/get-api-key
- Click 'Get Started'
- Select 'Maps' and click 'Continue'
- Click the drop-down to either select an existing project or create a new one, 'Next'
- Follow the steps to create/enable a billing account for this project.
- Accept the prompt to enable the Maps API.
- Copy the API key and paste it into the value for $GLOBALS['GEOCODER_GOOGLE_API_KEY'], and click 'Done'
- (Optional) Click 'Secure Credentials'
- Under Application Restrictions, select HTTP Referrers
- Add the domain for the website(s) this API key will be used on (for example localhost, example.com, 184.108.40.206)
- Click API restrictions
- Select the Geocoding API from the dropdown
- Click Save
Let me know if you have any questions, or if there's anything else I can help with.