Google Maps APIs sometimes requires domain verification? - google-maps-api-3

I maintain a WordPress store locator plugin, and this week someone told me it wasn't working anymore. Eventually he fixed it by verifying his domain in the API Console.
That this was a solution to some APIs of Google Maps not working was new to me, and it's also the first time someone told me they fixed it this way.
The problem is that I can't find any information in which scenario verifying your domain fixes a Google Maps API related problem. I read through the Geocode API / Google Maps JavaScript API / Google Places API Web Service pages, but no where do I see something about the need to verify your domain ( I could of course have missed it ).
Does anyone know when you need to verify your domain if you want to use the Google Maps APIs? Normally it works fine without doing it, but in his case it wasn't, and I really like to know what he could possible have done to make it a requirement.

You shouldn't need to verify the domain for using Google Maps API.
You need to generate one API Key for your app so you can use it when you call the Google Map JavaScript API like this:
<script src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&callback=initMap" async defer></script>
Substitute the value YOUR_API_KEY for the one that Google generated for you.

Related

gmapsdistance - which API is needed? [duplicate]

I've started getting this error from a Google Maps widget within a CMS I use:
This API key is not authorized to use this service or API. Places API error: ApiTargetBlockedMapError
The error message provides a helpful link to this page, which includes the following text:
ApiTargetBlockedMapError Error
The Maps JavaScript API has not been authorized for the used API key.
Please check the API restrictions settings of your API key in the
Google Cloud Platform Console.
See API keys in the Google Cloud Platform Console. For more
information, see Using API Keys.
I know Google has tweaked this API in the past, so I went to the console and checked the permissions given for the key I am using. It includes these four permissions, include the Maps JavaScript API permission:
Geocoding API
Maps Embed API
Maps JavaScript API
Maps Static API
The only part not working is the address auto-complete. When I change to Don't Restrict Key mode so the key works with all services, it works fine. Any idea which service checkbox I might be missing? I'm wondering if Google is just displaying the wrong error.
Any ideas?
This is what I did. Updated.
Make sure you have enabled all the next Google Maps Services
If you have key restrictions, make sure you add the services like the next image..
Restart the project. It worked.
It turns out that Google has tweaked their permissions settings without updating the error. I had to give access to the Places API as well for the autocomplete to function.
I've submitted a PR to the CMS widget's documentation:
https://github.com/Frojd/wagtail-geo-widget/pull/59/files

How do i tell Openrefine to fetch some data trough the google and facebook API (Grel)

I have a list of around 500 foundations and companies and i need to fetch more data like address, description, lat long, email or phone number, from the google and FB APIs I have found something more or less like this, but it won't work in OpenRefine, i need some help please.
I think it is possible to do beacause there is an addon called spotlight for spreadsheets that is able to fetch Google URLs and Lat Long https://www.youtube.com/watch?v=Vj1v3QfyrgA&feature=youtu.be
https://maps.googleapis.com/maps/api/place/findplacefromtext/output?parameters/json?input=value&inputtype=textquery&fields=photos,formatted_address,name,rating,email,geometry&key=YOURKEY
I have created the FB and Google places and google staic map API already. I have tried different queries, but it won't work unless it is in GREL
value.parseJson().geonames[0].lng
value.parseJson().geonames[0].geonameId
value.parseJson().geonames[0].lat
From the error "This API project is not authorized to use this API" the first thing to check is that you have enabled the Places and/or Geocoding API in the Google Developer console, and you have setup an API Key and that it is showing as a credential for the Places API and/or the Geocoding API
Next step, take OpenRefine out of the equation and check you can get a simple API call working in your browser - using one of the Google Places API examples:
https://maps.googleapis.com/maps/api/place/findplacefromtext/json?input=Museum%20of%20Contemporary%20Art%20Australia&inputtype=textquery&fields=photos,formatted_address,name,rating,opening_hours,geometry&key=<INSERT YOUR API KEY HERE>
If that gives you the same error, you know the issue is not with OpenRefine.
If you are still having problems in OpenRefine make sure you are creating URLs in OpenRefine that are valid for the appropriate Google API based on the documentation for that API and that you are using the correct API key.

Google API javascript

I am doing a custom google map with API
I put the URL link :
https://maps.googleapis.com/maps/api/staticmap?center=Brooklyn+Bridge,New+York,NY&zoom=13&size=600x300&maptype=roadmap&markers=color:blue|label:S|40.702147,-74.015794&markers=color:green|label:G|40.711614,-74.012318&markers=color:red|label:C|40.718217,-73.998284&key=AIzaSyCTFUKmdIRSSod5v1oqhIXJOmkOPMsdFp0
I received this error:
The Google Maps Platform server rejected your request. This API project is not authorized to use this API. Please ensure this API is activated in the Google Developers Console: https://console.developers.google.com/apis/api/static_maps_backend?project=_
I enabled API AND THE error still exist
Can you please help me find the solituion for my problem
In order to use the Google maps api your going to have to first off enable the maps api in the Google developer console for that project. Then you will need to enable billing for the project as there is no longer a free tear for maps api.
Once you have done that you can create an api key and use it in your code.
The Google Maps Platform server rejected your request. This API project is not authorized to use this API. Please ensure this API is activated in the Google Developers Console: https://console.developers.google.com/apis/api/static_maps_backend?project=_
This message means that you have not enabled the maps api for your project. It can take a few minutes before it kicks in if you just enabled it. Make sure you have done it for the cogrect project as well by clicking on the link that it showed you.
You are going to need maps javascript API for a real map and embed it in a div
Here is a basic example on how to achieve that.
In the script tag in the html section you need to replace YOUR_API_KEY for the real one from google.
jsbin example
https://jsbin.com/xiragigegi/edit?html,css,js,output

Google analytics using REST api

I want to add Google analytics manually on each pages and events in my website. Is there any ways to add Google analytics using REST api or any library in PHP. so i can track specific events of my website.
There is no REST API for Google Analytics. You will have to use one of the available libraries provided by Google.
To track particular events, you can use tag manager or simply use custom dimensions.
TL;DR, Google Analytics is great if all you ever use is their GUI dashboard. If you need API access, go with another service.
If you need to access analytics data programmatically, especially if you are using NodeJS, I suggest you use some other service besides Google. Their documentation is incredibly lacking, they try to pigeon-hole you into using a client library rather than steering you in the direction of a REST API, and authenticating is a nightmare. The new v4 API purportedly consists of a single endpoint that you need to query with a complex combination of HTTP body and query params. Again, documentation is nearly non-existent.

What is utmu parameter in google analytics __utm.gif request?

I am trying to make the google analytic __utm.gif request using php. I have broken all the variables and the only one which I don't know about is utmu parameter. It is not documented anywhere.
When I see a pageview tracking request it is appended to the end of request as &utmu=qB~
While doing ecommerce tracking it is appended as &utmu=qBAL~
Please help me with this.
It is a bitmap of all of the methods used to build the request.
Source: http://glucik.blogspot.com/2011/02/utmu-google-analytics-request-parameter.html
utmu doesn't actually contain anything of external meaning. Google uses it to store some internal values that help them improve ga.js. It's not required to make any functionality work, so, your PHP code doesn't need to account for it.
However, you should know there are already a few long-standing PHP-based Google Analytics projects, like Server Side Google Analytics (SSGA), as well as the semi-official Google Analytics for Mobile PHP and PHPGA.

Resources