This question already has answers here:
Googlemaps API Key for Localhost
(10 answers)
Closed 2 years ago.
I am running a copy of the website that I am working on, using a server that runs on localhost:8759. The website uses Google's address autocomplete capability. I have a script element at the bottom of the page with a URL of https://maps.googleapis.com/maps/api/js?key=XXXXXX&libraries=places, with an actual API key in place of the XXXXXX. The API key is restricted so it can only be used from our production and testing servers.
I would like it to work on localhost instead. Initially, I tried running the website on localhost, and the autocomplete didn't work. I saw an error on my console saying Google Maps API error: RefererNotAllowedMapError.
I went to Google's Developer Console, added localhost:8759/* to the list of referrers, and waited over 5 minutes as recommended by Google. The autocomplete still didn't work. I saw an error saying This API project is not authorized to use this API. Please ensure this API is activated in the Google Developers Console.
I tried adding a key with no restrictions and using it. The autocomplete still didn't work. I got an error like the one mentioned in the previous paragraph.
The autocomplete works fine when it is on a page coming from our testing server (which has an IP address in the list of referrers) or production (which has a domain in the list of referrers), but I can't make it work on localhost.
How can I make it work?
In my experience omitting slashes and protocol but including port seems to work:
Eg: localhost:5000 or localhost:8759 in your case
Related
I was asked to implement the Google Tag Manager scripts into the React application. I've added the scripts to head and body of my html file. I've tested the site in the Preview mode of GTM and everything seems to working fine. Clicks and route changes are tracked correctly.
I have one doubt... What about the localhost development ? Is it going to generate unnecessary logs on the analytics (which I have no access to)? Or maybe it's just enough to paste the snippets and that's it?
I can't find an answer so that's why I decided to ask here.
If someone has some experience on that topic - please let me know :)
I would advise you to map separate Google Analytics property IDs by either a datalayer variable, URL or custom JavaScript to return a separate property ID based on whether users are accessing your website from either your localhost development environment, your UAT environment (if any) and then your production environment (or others as applicable).
Essentially you're looking at having something that says "if the URL contains "localhost", return my development property ID", then use this variable name in your Google Analytics tag(s) instead of a static value.
Yes, unfortunately all your existing testing is all in your profile because if you had the production property ID configured and fired off a bunch of events and pageviews, it absolutely collected and sent there as part of the debugging experience. Generally though, that's a low concern on a production app because you make up such a small portion of overall traffic; you're just a couple of blips in the larger dataset.
Hi guys i have a very strange problem. I am tasked to conduct several performance tests on an old Webpage (2004 - something).
The module that is under test is created with ASP.net forms.
Im using Jmeter for the task.
I have used Chrome extention (Blazemeter) to generate the starting script.
But a very strange problem occurs all other pages of the form are fine and dandy... except a page for file upload where upon trying to proceed(Make a POST request) it loses its session and you are redirected to another screen with generic- Would you like to continue last session type of messages appear.
In order to try to debug the problem i wrote a simple Post request on IntelliJ and everything works fine when executed.
I then returned to Jmeter and punched in everything identical to the script and i still get the same problem.
I then decided to try the Jmeter recording proxy ( in case the blazemeter is faulty and assigns some values incorectly) And while i was manualy browsing the form the problem Appears! - when i click on proceed on that specific upload form with the jmeter proxy turned on, it loses session and it shows the "continue last session screen". And i am baffled as to how a simple proxy that records could mess up the sessions. I tried it with a normal proxy (not the Jmeter one) and everything works. So it seems that the problem is in Jmeter or some settings.
Have you guys ever encountered such a problem , or have some insight as to what might cause such behavior. Additional info:
I have worked on ASP.net form before and i am extracting __VIEWSTATE __EVENTARGUMENT and a couple of other hidden variables from the previous response and passing them to the request.
I am using the Multipart/form-data for the upload file module POST and passing the file properly.
As a standart i am using KeepAlive and Follow Redirects but i have tried Redirect Automatically or all of the above switched off.
There is a Cookie Manager set up on Test Plan level and it is working in HC4 - compatibility(tried all others too) based on the requests its working properly.
Cache Manager to 5000 elements.
Certificates seem to be properly imported (for the Jmeter proxy).
I am at this point baffled as to why Jmeter refuses to act properly and i would be very gratefull if someone could help me.
Hi guys il just post an update since i found a work around. So if i record everything with blazemeter (since jmeter proxy doesnt allow me) and after on the upload step i delete the steps and just write a manual request in the body with multipart/form tick turned off and just write the multipart stuff in the headers it seems to work. I still have no idea why it behaves this way.
"Our Google's MAP implementation was working fine when suddenly an alert was being prompt by Google informing to any visitor that Google's MAP was deactivated in our site because it didn't have the correct domain references or because the key was wrong; the same key was working fine in one of our sub-domains, which we use for development purposes, so we were pretty sure that the issue didn't rely on our end. We also double checked the settings on Google's developers console and everything is setup properly.
At the end we removed the key from the API call temporarily until we find a solution; what are the consequences of not including the key and what recommendations could you give us to solve this issue?
We are also using Google's Page Speed technology.
One thing I tried was to make sure that the Referer patterns shown in the Google Developers Console were sufficiently generalised, e.g. *.mysite.com/* rather than mysite.com
This apparently helped but further testing was inconsistent with the alert shown almost always on Windows Safari (5.1.7) and Firefox (29.0.1). In contrast, it was rarely shown on Safari on iOS.
As my web app is unlikely to make 20000 requests a month, I decided to ditch the key and use
<script src="http://maps.googleapis.com/maps/api/js?sensor=false"></script>
So far, this has worked without any apparent issues.
I am making an application with the Google Maps API. I want to be able to have one person on a computer, watch what another person has edited to a map. I am thinking of passing information of the map to a Google Fusion Table. The other person will be able to see everything as a layer. I would like for the program to just run from the user's browser and not build a website for it.
To edit the fusion tables, I need to gain access/tokens. I am currently trying to use these there JavaScript to accomplish this. ScriptSample.html, oauthWindow.html, and gwt-oauth2.js. This is the working example.
When I run them, I get am error that says the redirect URI is incorrect. It says the file I use to redirect does not have authority. My first obvious question is:
How do I give that file authority to redirect?
In my API console, I have it set up as a client-side web application. Should I change it to an installed application?
Currently I have the following settings:
my JavaScript origin is: https://localhost
redirect URI: https://localhost/oauthWindow.html
Thanks
There's no problem with using a localhost url for Dev work - obviously it needs to be changed when it comes to production.
You need to go here:
https://developers.google.com/accounts/docs/OAuth2
and then follow the link for the API Console - link's in the Basic Steps section. When you've filled out the new application form you'll be asked to provide a redirect Url. Put in the page you want to go to once access has been granted.
When forming the Google oAuth Url - you need to include the redirect url - it has to be an exact match or you'll have problems. It also needs to be UrlEncoded.
I'm creating an ASP.NET application which uses Facebook Connect and fbml tags. It also uses the LinkedIn widget. When I run this app in any browser, there are no warnings and everything works. However, in IE, a message like this comes up:
Security Warning:
The current webpage is trying to open a site in your Trusted sites list. Do you want to allow this?
Current site:http://www.facebook.com
Trusted site:http://localhost
(same for LinkedIn.com). I know how to fix this from a client perspective and to stop the security warning showing up. However, is it possible to ensure this message doesn't come up as it could be off putting for users who don't know how to suppress this warning? I haven't tried uploading it to my webhost, so not sure if this message will appear for everyone in production. However, I always get it on my local machine.
(None of my pages use SSL, so I don't think that's the issue. I tried using FB's HTTPS urls but that didn't make a difference).
Thanks
I have come across the IE message many times. Whilst this might not be the case here I always check in Firebug to see if any requests are going to Https (using Net tab). If may be the case that something you are referencing is itself making a call to something else.
Often you get that message if you are serving an https page and then going to fetch an image over http.
Might not help but is the first thing I do in this situation.