Yext's Google Business Profile Native source lets you authenticate directly with the API via OAuth and pull business data into Yext's Connectors framework. Once data is pulled in, you can use the transform library to clean, format, and upload it, and optionally set a recurring sync schedule.
There are two ways to get started:
- Native Connector source (outlined in this resource): build a custom connector from scratch. Requires some familiarity with Google's Business Information APIs.
- No-code app: install a pre-built connector app. See the Install Google Business Profile Connector App guide.
Create a Google Business Profile Source Connector to Import Data
Note: If you have existing location data in your Yext account that you would like to enrich with data from your Google Business Profile account, make sure that the Entity IDs of your locations in your Yext account match the Store Codes in your Google Business Profile account. If this is not the case you will create new locations in your Yext account or add data to the wrong locations.
- Navigate to Knowledge Graph > Connectors and click + Add Connector in the top right corner.
- Click the Google Business Profile source and select the preferred operation.
- Select your Linked Account. If you have yet to link your account, you can click Add a Linked Account. You will then be redirected to the Linked Accounts page, where you can follow the flow to add a Google Linked Account. Be sure to check off https://www.googleapis.com/auth/business.manage as your scope, and return to the connector flow after linking the account.
- In the Location Group field, input the ID associated with the Location Group from which you wish to pull entity information. You can find this in the URL in Business Profile when you are viewing your location group, e.g.,
https://mybusinessbusinessinformation.googleapis.com/v1/{location-group-ID}/locations. - (Only for Fetch Locations With Filters Operation) In the Filter field, input the field you would like to filter on. You can use Google Business Profile’s API documentation on filtering to learn what syntax is expected (e.g., representing spaces with
+and quotation marks with%22). - Click Continue.
- Now you’ll choose which selectors from Google’s API response to pull information from. We recommend clicking Add Default Selectors to quickly see all the available information; however, you can also individually add selectors if you only need to import a few fields.
- You can now add whatever transforms you’d like if your data is not formatted properly. When you’re finished, click Continue.
- In the final step, choose the Entity Type you’d like to bring in, and map the selectors you specified to Yext fields. Click Save, name the connector, and run it either now or later.
Operations
| Operation | Description |
|---|---|
| Fetch Locations | Pulls all locations from the linked Google account. |
| Fetch Locations with Filters | Imports a subset of locations from a Google Business Profile location group using a filter. |
| Fetch Hotels | Pulls hotel-specific location information using Google's separate Lodging endpoint. Use this for Hotel entities. |
Settings
Location Group
This is the ID associated with the Location Group in Google Business Profile.
Filter
For the Fetch Locations with Filters operation, there is an input to add labeled Filters.
Here, input the field you would like to filter on to specify what data you want to pull into the platform.
See Google’s API documentation on filtering to learn what syntax is expected.
The base URL of the API call sent to Google with this operation looks something like this:
https://mybusinessbusinessinformation.googleapis.com/v1/accounts/{accountId}/locations?readMask=name,languageCode,storeCode,title,phoneNumbers,categories,storefrontAddress,websiteUri,regularHours,specialHours,serviceArea,labels,adWordsLocationExtensions,latlng,openInfo,metadata,profile,relationshipData,moreHours&filter=
Whatever you input in the Filter field will be appended to this URL, and you can filter based on any field. For example, in order to pull in only restaurants in a location group that is categorized as “Bed and Breakfast” or “Cottage”, input categories=bed_and_breakfast+OR+categories=cottage in the Filter field. Or, to only input locations in Great Britain, you could add the filter input storefront_address.region_code="GB".
When filtering by a category, make sure not to include the gcid portion of the ID.
Recommended Transforms
Because Google exports data in a slightly different format from the way Yext has to ingest it, you’ll likely need a few transforms in any connectors that you build from scratch.
Below are some recommended transforms for building a connector using the GBP source:
Address
- Google returns addresses in one field called
addressLines, but Yext accepts addresses in separate lines. Use a Split Column transform with a comma delimiter to create three new columns for each line of the address. - Map each of these selectors to the fields Address > Line 1, Address > Line 2, and Address > Line 3.
Categories
- First, you will need to map both the Primary Category and Additional Categories to the Yext Category field. Use a Merge Columns transform to combine these two fields.
- Call the new field Categories and map to the Yext Categories field in the final stage of the connector.
- Use a Find and Replace transform to strip both category fields of their
categories/prefix, which Yext cannot ingest. - Use the built-in Map Publisher Categories field to translate Google Category IDs into Yext Category IDs.
Hours
- Make sure to create selectors for opening and closing times for each day of the week, as you’ll need to map them all separately.
- The selector JMESpaths should look something like
regularHours.periods[?openDay=='MONDAY'].openTime.
- The selector JMESpaths should look something like
- Then, choose one of the following:
- Write a typescript function to convert the formatting into HH:DD, or
- Use a series of Find and Replace or Extract Text transforms.
If you get stuck, download an out-of-the-box connector and apply one of the function transforms included, such as handleHolidayHours or convertAdditionalHours.
Troubleshooting
Below are common reasons for entity failures in connectors using the GBP source, and steps to address them. Note that at this time, if an entity’s field contains an invalid value, the entity will fail and no fields will be brought into the Knowledge Graph.
Address Errors
To ensure accurate location listings, pages, and search results, Yext maintains strict address validation that might cause GBP entities to fail. The two most common reasons for failure when using the connector apps are:
- “Value is not a valid region.” (The Region field is blank, or the state code is invalid)
- “Address must include a city.” (The City field is blank)
Google Business Profile allows you to upload locations that do not contain addresses or cities; however, Yext does not. There is no reason not to update this data in GBP, so the best solution is to ensure that the corresponding locations contain accurate values in Google.
Duplicate Entity ID
Occasionally, users will have multiple locations in their Google Business Profile instance that contain the same store code. That will cause the following error to surface in the Entity Diagnostics sheet:
- Error creating entity:
DUPLICATE_EXTERNAL_ID
Because the connectors automatically map GBP Store Code to Entity ID in Yext, and the platform does not allow duplicate entity IDs, you will want to ensure that the Store Codes in Google are unique. The Entity Diagnostics sheet will tell you exactly which entities contained duplicate external IDs.
Photo Validation Errors
Any photos manually uploaded to Google that do not meet their requirements will fail in the Yext connector. For more specifics on Google photo requirements, see the Photo Guidelines for Publishers reference.
Find the field that triggered the error. It will be one of the following:
- Photo Gallery
- Google Cover Photo
- Google Logo
To handle these errors, you can take one of the following actions:
- Remove the photo from the location in Google Business Profile.
- In the Entity Diagnostics file, look at which entity failed. The ID in this column will reflect the Store Code ID in GBP. Find that location in your GBP instance and remove the photo causing the error.
- Unmap the corresponding photo field in the connector framework.
- Identify the correct field, then return to the last step of the connector configuration.
- Unmap the corresponding field by clicking on the field, selecting Clear, and then Apply.