Different errors (quota, disabled, bad API key, or none) when loading Google Maps API JavaScript - google-maps

We ported our site to Google maps, but we get different errors when loading a map using the JavaScript Maps API (v3 of course). Other times the map loads correctly. The two most prominent errors are:
"Google has disabled use of the Maps API for this application. See the
Terms of Service for more information
http://www.google.com/intl/en_US/help/terms_maps.html." (JS Alert)
And:
"This site has exceeded its daily quota for maps. If you are the
creator of this site, please visit the documentation to learn more."
(this is a DOM overlay)
Live minimal example:
This code is not yet live but there's a minimal example here: http://mappat.com/maptest.php. It is simply Google's own Hello World example with our key filled in and even that gives problems.
Network traffic inspection:
I noticed the first error is shown when 'AuthenticationService.Authenticate' fails (returns [0,5,0]), the second when 'QuotaService.recordEvent' returns [0,null,0]. These are remote calls from within the SDK and I don't know if these details are relevant.
What we tried:
Billing is enabled by the way and we stay way below our quota limits. I tried a lot of things already, new key, waiting a few days, turning the Maps API off and on again in the console, etc. I filled in the allowed referrers but also left it open to allow others. No difference.
I don't dare to start a new project in de dev console because this whole thing started when I did actually just that because I had (different) problems with the server-key. That server part is now working flawlessly btw, kind of ironically.
[Edit: I just tried to leave out the API key when loading the JS maps file, which, fingers crossed, seems to work. But now the server-side calls to places/searchtext start to give random "The provided API key is expired." errors, again (same reason we created the new project). Coincidence? Also, I don't like this option, especially with regards to the future (reaching 25k, going beyond and going Business Account)].
So, I'm stuck. Hence my first SO question ever. Could it be that we are blacklisted? Perhaps because of the duplicate project? Is there a way to find that out and/or to get us 'reset'? Or am I simply overlooking something?
Any help is appreciated because until we solve this, this is a deal-breaker.
Sidenote: I also filed a bug report because I think giving random errors on itself is not expected behaviour. It's up to the dev team to decide if they agree. If not, we still have a problem, hence this SO question.

I think you have a syntax error in your php var dump:
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDYuWR5wqux1_iTmfIWPveheIOr5PhqjEs&?>sensor=FALSE&language=en">
</script>
you have ?> just before sensor

This issue magically disappeared after a week or so.
I didn't get any response from Google, but they may have change/reset something behind the scenes, of course. The bug is still marked 'new', by the way.
My advice to others having this issue is to first check some basic things, since the individual errors I got could also result from actual things you're doing wrong (ie mistake in allowed-referers). If all seems okay after triple checking, just remove the API key from the request, test along like that for a while and retry in a couple of days.

Related

HTTP 403 on images loaded from googleusercontent.com

First off, I don't think my problem is related to these questions: question 1, or question 2.
Because I'm not using authentication anywhere, or any library either (I don't need to).
I'm simply loading some publicly-available album art images in my web application:
// urlList is an array than contains URLs like the examples given below
<img *ngFor="let url of urlList" src="url">
Example URLs:
Glass Mansion, Summertime, Side Effects
99% of the time, it works. But sometimes I get 403 errors on the console for those exact same URLs.
I know they're not related to authentication, because, well. These URLs are publicly accessible.
Debugging this has been difficult, because a few page refreshes later, it magically works again. There's nothing out of the ordinary in logs either (except the GET 403 errors).
What in the world is happening?
I'm using Angular v7.2.15. Browser: Google Chrome
Add referrerpolicy="no-referrer" attribute
<img src="your-google-link-here" referrerpolicy="no-referrer"/>
Within several Google API's (like the gmail API for example), Google uses HTTP403 and/or HTTP429 in order to ratelimit certain requests over certain time periods. I do not know what method you are using, if you are using some sort of API etc, nor do I know how busy or large your webapp is. But rate limiting or fair use compliance could be coming into play.
Gmail API Rate Limit Info Source - https://developers.google.com/gmail/api/v1/reference/quota

Google Maps API for both localhost & production server, as of April 2019

TLDR
My code works fine on my laptop when accessed as file://<path>/index.html, but neither on my laptop with an Apache server running when accessed as http://<path>/index.html, nor on my real (production) server. I see no errors on the console, but the map is just a grey rectangle.
[Update] I moved to LeafletJS shortly after asking this question, and recommend others to do so too.
It has been a few years since I coded any Google Maps applications.
It seems that, as of last year, it is now necessary to have an API key, by providing it with credit card details, and to provide it with each API call.
Unfortunately, there is a lot of of information about this, much/most of it out of date and/or contradictory.
Can anyone point to the canonical guide, preferably with screenshots, of how to configure this?
I wish to draw a map, and add some makers, which will require reverse geocoding, such that I provide a street address and convert it to lat/long in order to place the markers.
Sounds simple enough, but which of the many thousands of "helpful" site has gotten it right?
For instance, what seems to be the current Google help page speaks of
From the Navigation menu, select APIs & Services > Credentials.
On the Credentials page, click Create credentials > API key
But I can't even see that menu option :-(
[Update] If it helps any, the error message in the developer console said :
Geocoding Service: You must use an API key to authenticate each request to Google Maps Platform APIs. For additional information, please refer to http://g.co/dev/maps-no-account For more information on authentication and Google Maps JavaScript API services please see: https://developers.google.com/maps/documentation/javascript/get-api-key
[Update] I am trying to access the API like this
<script src="maps.google.com/maps/api/…>
and
var url = 'https://maps.googleapis.com/maps/api/geocode/json?address=' + comapnyLocation +'&key=XXXX';
$http.get(url)
[Update++] in the developer console, I see a bunch of errors along the lines of:
aliextension.com/wp-content/uploads/2017/08/JAR.png:1 GET https://aliextension.com/wp-content/uploads/2017/08/JAR.png net::ERR_CONNECTION_TIMED_OUT
I have no idea what aliextension is, nor does it appear in my code (maybe in some minified JS?)
Ok, it is something to do with AliExpress (Ali Baba). I removed it & the timeout messages go away, but I still have problems.
If I load the index.html into Chrome as a file://, then it works just fine. But, if I load it `as http://, where I have a Xampp Apache server running, the map box remains grey, although I see no error messages. The same thing happens on my real server :-(
This page should be your starting point:
https://developers.google.com/maps/documentation/javascript/tutorial
it helps you working with Google map javascript API.
To embedded a google map to your website read the overview page in the above link.
To add markers to your google map read this page:
https://developers.google.com/maps/documentation/javascript/adding-a-google-map
To do reverse geocoding read this page:
https://developers.google.com/maps/documentation/javascript/geocoding
That all i need to work with google map. I think you can do the same too.
The cause for this is quite likely an API key restriction.
In order to permit these host-names or IP addresses, you have to:
a) go to the credentials panel and select the according project, then click on "Api key".
b) there you can loosen the restrictions, for HTTP referrers (for web-sites)
... or for IP addresses (in case these are server-side requests).

Can't get rid of "Site Contains Malware" warnings

We've been having this problem for the last month, and it is getting really old. :( I'd love any help or advice.
We have a Facebook app that provides users a simple way to make tabs for pages. Some malicious actors were using our app to host redirects - which we have now blocked. As far as we can tell, there is not any more redirect abuse. Okay, here's where it gets weird.
We've got 12 "apps", each of which has identical functionality but different paths on our domain. For example:
http://raw2.statichtmlapp.com/tab/1/...
http://raw2.statichtmlapp.com/tab/2/...
http://raw2.statichtmlapp.com/tab/3/...
All urls beginning with the path /tab/2 are getting the warning, and all the other urls are fine. Gah.
We have read the documentation thoroughly about how to rectify this sort of thing, to no avail. https://developers.google.com/webmasters/hacked/docs/request_review suggests that we should use the webmaster console to request review for Malware or Spam, but our console says there is no problem with the domain.
We have submitted requests for review of phishing multiple times at http://www.google.com/safebrowsing/report_error/, but nothing happens.
I suspect that part of the issue may be an anti-abuse measure we have in place. The content in our app is only available when embedded inside Facebook, with a signed request that comes along with the iframe url from Facebook. So if a Google system attempts to directly craw urls that have been flagged, it will get either empty pages or errors. But we don't want to make the content available on the open internet for fear of phishing abuse (which is why we lock it down now), and we don't want to try to detect Google and just serve them the content, because that feels like something they would likely detect as suspicious and cause further flagging.
Any advice on what to do? It is incredibly frustrating to have a bunch of walls come slamming down like this, with very little we can do. Thank you so much for any help!
Aha! After a helpful reply on the Google Webmaster Central help forum, we got it cleared up. We needed to add the blocked url as a new site in the search console, not just the root domain. That made a security issue show up, and that enabled us to request a review, and finally get this cleared up.

Google Maps API warning: NoApiKeys

I've been using Google Maps API v3 for some time without an API key, and it worked well.
It still works, but I get a warning in the console:
Google Maps API warning: NoApiKeys
https://developers.google.com/maps/documentation/javascript/error-messages#no-api-keys
I include the script the standard way:
<script src="https://maps.googleapis.com/maps/api/js?libraries=places"></script>
And google.maps.version indicates that I'm using 3.24.2.
In the Google documentation I can only see the different ways to obtain a key, but there is no indication if it's required or not. I noticed the warning today and I'm quite sure it didn't appear a few weeks ago.
Everything is working fine for now, but I'm afraid that maps access without an API key will be ceased in the future. I'm reluctant to register for a key if I don't absolutely need to.
Should I worry about it?
Creating and using the key is the way to go.
The usage is free until your application reaches 25.000 calls per day on 90 consecutive days.
BTW.: In the google Developer documentation it says you shall add the api key as option {key:yourKey} when calling the API to create new instances.
This however doesn't shush the console warning.
You have to add the key as a parameter when including the api.
<script src="https://maps.googleapis.com/maps/api/js?key=yourKEYhere"></script>
Get the key here: GoogleApiKey Generation site
A key currently still is not required ("required" in the meaning "it will not work without"), but I think there is a good reason for the warning.
But in the documentation you may read now : "All JavaScript API applications require authentication."
I'm sure that it's planned for the future , that Javascript API Applications will not work without a key(as it has been in V2).
You better use a key when you want to be sure that your application will still work in 1 or 2 years.
I had the same problem and I found out that if you add the URL param ?v=3 you won't get the warning message anymore:
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?v=3"></script>
Reproduction online
As pointed out in the comments by #Zia Ul Rehman Mughal
Turns out specifying this means you are referring to old frozen version 3.0 not the latest version. Frozen old versions are not updated with bug fixes or anything. But this is good to mention though.
https://developers.google.com/maps/documentation/javascript/versions#the-frozen-version
Update 07-Jun-2016
This solution doesn't work anymore.
Google maps requires an API key for new projects since june 2016. For more information take a look at the Google Developers Blog. Also more information in german you'll find at this blog post from the clickstorm Blog.

what other params can I pass to the google hangout uri?

I recently discovered a parameter to pass to a google hangout uri to make it "on air": reference
I'm also wondering if I can pass any other parameters. I know that we have app_id, but I'm more interested to know if there are other parameters, such as being able to set the title or the hangout in advance, e.g.
https://plus.google.com/hangouts/_?hso=0&title=EdX%20SaaS%20Pairing
Because then I could direct people to https://plus.google.com/u/0/s/%23hangoutsonair%20EdX/hangouts and they could see all the on air hangouts associated with our MOOC. I did experimentally try passing title=, topic= and name= all to no immediate effect ...
I'd also love to know if there's a way to automatically start the live broadcast, or even better have the hangout be automatically associated with and published to our G+ pair programming community:
https://plus.google.com/communities/100279740984094902927
Many thanks in advance
Got this response from Tim Blasi at Google:
I'm a developer working on video calling. Unfortunately, you can not currently configure the video call in the way you are describing. However, we've received a lot of feedback that this is a pain point and we're currently working to address it. We'll keep your request in mind as we move forward.
https://plus.google.com/u/0/103524399391704001670/posts/JGtpxgvdD5H
resurrecting an old thread, but for a good reason.
i recently found that its possible to bypass the landing page and pre-select your user account
https://meet.google.com/lookup/my-room-name?authuser=my-email#account.com
just replace my-room-name and my-email#account.com