Im facing a problem with Google Maps Javascript API V3. The console log shows:
Google Maps API error: RefererDeniedMapError https://developers.google.com/maps/documentation/javascript/error-messages#referer-denied-map-error
Google documentation about this error is damn poor and even when he says to check Developer Console searching for more details i can't manage to find any more details about that errors, it may be related to some of the info posted in the following list. I saw that in the Google Console you can somehow enable logging or other stuff but it needs Google SDK which atm i can't afford to configure since it would mean going out of budget
The question is already asked here: Javascript error in Google Maps API v3 (RefererDeniedMapError) but none of the answer could help me.
Here's what i've tried so far:
- Regenerating Google Api
- Enabling/disabling domain restriction in the Google Console
- Changed key from browser to server
- Trying to understand if the domain was for some reason banned by Google
- Creating new project on Google Console and generating a whole new Javascript API key without (from the beginning) domain restriction
Let me give some more background data:
- Im working for an external client on an already existent site, he knows nothing about pre-existing google accounts that may have an api key already configured (they were using some Google API services but thats all i know)
- I managed to discover they have been contacted by google about the API usage quota but again i don't know what the comunication details where about.
- They have an IIS server and im buiding the new site in a subdirectory of their main domain
- I've noticed that somehow a self-request (ajax) from the new website to self site results in an cross-domain request which is really weird in my opinion, too bad i don't know what their server configuration is in more details.
- I've checked the free plan for Google Api and the limit is 25K daily, the client said he shoudn't be able to go that high but he is willing to pay to re-enable the API's
- I've tested a newly generated API on local environment & other testing live domain and it looks like working, but as soon as i try those keys on the guilty domain the Error pops out
My question are:
- Is there a safe way to understand if the domain is somehow banned by google for API's overquota usage or some other reasons?
- How can i be sure that creating a billing account for the domain and allowing the API plan to go higher then 25k will enable my plan again?
- Is it a javascript-related problem? I think i've did all i could to check this part but i'm open to suggestions.
- Does it matter if there are multiple google accounts referencing the same domain for API usage? I mean that from what i know there may be multiple Google Accounts with different API keys created for the same goal in that domain (domain restriction or not they could be still being used)
You can try the suggestion made in this issue.
You can also check the answer here, if it can help you.
Then if any of the above solutions doesn't helps you, then I think you should consider the recommendation of MrUpsidown.
For everyone who will ever land on this question in the future: turns out it was a domain problem. I managed to contact one from the google support service using their forum: https://code.google.com/p/gmaps-api-issues/
After posting my question there i've been told that the domain i was working on had a past with Google licensing, it had once a commercial plan activated and then someone from the past violated Google's ToS. Sadly there's no way a normal user can check if your domain has violated Google's ToS in the past so i had to wait an answer from the Google Support Team.
Long story short: if you have a domain banned by Google in the past you are in trouble and have 2 way out: - Change your domain to get a fresh one which is not banned - Pay 10,000$ for a Google Licence for work (not a premium one,just "basic" licence) if you want to work again with API. The price is not fantasy, that's what I've been told by google Support.
Hope this will help someone to figure out this poorly documented error.
UPDATE
The documentation has been updated and clear explanation was added:
https://developers.google.com/maps/documentation/javascript/error-messages
So, everybody who faces this issue can submit an appeal form from now on.