MetaLocator can import data from multiple sources, including Google Places.
Google Places can be used to enrich the data existing your MetaLocator. For example, to import location hours, photos or to correct names and so forth.
Important: The Google API is not free. Google charges a variable fee per API call based on the type of data requested. Be sure you fully understand the associated costs before configuring Google Places. Google Places data must also be used in compliance with Google's Terms of Use.
Step 1. Obtain a Google API Key.
To obtain a Google API key, follow their instructions here. The steps are generally to :
Create a key
Authorize the Google Places API for the key
Once you have a Google Places API key, configure it in MetaLocator as follows.
Click the User icon in the upper right of the MetaLocator control panel toolbar
Click My User Profile
Click Toggle Advanced Settings
Scroll down to
google_places_api_key
and paste the provided API keyClick Save at the bottom of the screen
Step 2. Create a Google Place ID Field in MetaLocator
To enrich your data from the Google Places API, MetaLocator needs to know the Google Place ID for each record in your data and so the first step here is to create a field to store the PlaceID.
Click Locations, then Fields
Click New, then choose Google Place ID from the Field Type list.
Provide a name for the field, we recommend
Google Place ID
Step 3. Populate the Google Place ID for your locations
Google Place IDs can be populated manually or in bulk.
Populating Google Place ID data manually
Click Locations, then All Records
Find the location for which the Google Place needs updating
Click the name of the location and then the Custom Fields tab.
Enter the name of the location as shown below. Google's Places API will suggest results accordingly.
Choose the suggestion that best matches your result.
Click Save to associate the Google Place ID with the location record.
Populating Google Place ID data in bulk
A background job can be created to regularly attempt to populate the Google Place ID for any records that have no Google Place ID.
Important: Be sure your data is properly geocoded before populating the Google Place ID in bulk. Additionally, any major geocoding issues in the Data Quality Dashboard should be addressed prior.
To create the job, follow these steps:
Click Background processes in the MetaLocator tool bar
Click New and choose PopulateGooglePlaces from the Job Type drop down.
Provide a recognizable name, such as "My Google Places" job.
Populate the parameters as below:
The following parameter is required:
googleplaces_apikey
The following parameters are optional
populate_googleplaces_inputtype
: One ofphone
ortextquery
(default, recommended). When phone is provided, the API will search for locations based on the value found in the phone field. The phone number should be in an international format (E.g. +18002316526). MetaLocator will attempt to format the phone automatically. If no value ortextquery
is provided for this option, the system will search based on the Name field. It is therefore important that the name field value represent the real location name as found on Google. The API is great at handling differences in spelling but may not find results when the Name field is improperly set.
With data geocoded, and the job properly configured. The system is ready to obtain a Google Place ID for each location. This will call the Google Places API once for each record using the Text Search (ID Only) SKU. As of this writing, that API call is free to run.
To run the job,
Click Save
Click Published
Click Scheduled
Optionally, select the checkbox next to the job and choose Force from the toolbar to run the job immediately.
The job will run and process any Geocoded records without a Google Place ID value set.
For those locations where inconclusive or no matches are found, the Google Place ID field will contain
NO_MATCH - The API returned no matches when searching for the location by name, or by phone within 5 miles of the geocoded latitude and longitude. In these cases, the Google Place ID should be populated manually as described above.
Importing Data from Google Places
With a Google Place ID populated for each record as described above, click Locations, Import, and choose Google Places from the list of Data Sources:
Enter your API Key if not already provided
Choose the appropriate Place Details value to populate the desired fields. The lower the tier of place details requested, the lower the cost. MetaLocator currently supports the following fields.
Place ID: Unique identifier for each place.
Name: Name of the place.
Formatted Address: The complete address as returned by Google Places.
Address Components: City state country and postal code fields
Latitude and Longitude: Geographical coordinates of the place.
Phone Number: Internationally formatted phone number.
Website URL: URL of the place’s official website.
Opening Hours: Information on the operating hours of the place. they should be translated into metal locators hours format ready for import
Image: Primary image associated with the place.
Photo Gallery: Array of additional photos available for the place.
Rating: Average user rating for the place.
Reviews: Individual user reviews that represent a summary of user sentiment as determined by Google, including the text of the review, author name, rating, and date. Google Places includes up to 5 reviews.
Types: Array of place types (e.g., restaurant, park, museum). These can be imported into a MetaLocator Category field.
User Ratings Total: The total number of ratings for the place.
Limit photos (optional)
Google requires a separate API call for each photo, and making those API calls can significantly slow down the import operation. Set this to zero to skip importing Photos entirely.
Limit Records (optional)
To limit the number of API calls made during import, this parameter can be set to a lower number here, and then later modified in the job configuration.
Click Next to extract the initial data import from Google Places. This can take a few minutes depending on the number of records.
Make any mapping choices. Many users choose to exclude the Name, Address, City, State and Phone fields to preserve their own information. Map any fields to Ignore that should not overwrite existing data. If included in the import, the AverageRating can be mapped to a custom decimal field of the same name. Additionally userRatingTotal can also be mapped to a custom integer field. PlaceTypes can also be imported as a Category field if required for your application.
Choose Update Existing & Skip New on the options screen.
Choose Finish.
At this point your data will be updated to include the selected information from Google Places.
Leveraging Google Places Review Data
Google Places provides specially limited review data. It includes up to 5 actual reviews which include a star rating and commentary and then an "Average Rating" and a "User Rating Total" which represents the total number of reviews that contribute to the Average Rating.
To display these values in the locator as "star" reviews, the Review Summary field can be customized as shown below. In this example we have created the custom fields AverageRating and userRatingTotal in MetaLocator and populated the data from the Google Places API as described above.