Creating Store Locator via GMB API

Gagandeep Singh
GoMechanic
Published in
3 min readMay 26, 2020

If your business is hyperlocal and you don’t have store locator on your website, It sounds incomplete. Good news is that you don’t have to worry about content to show on these store locator pages, You can use your existing Google My Business Pages data to show content on these store locator pages.

Setting up GMB API:

  • Visit this link and fill this form for basic access to GMB API. Make sure that you enter same email address in form which you’re using with Google My Business account.
  • Once you get the access, open API Console and generate OAuth 2.0 credentials. Make sure you allow these URLs in allowed domains list to avoid redirect URI error.
https://accounts.google.com/o/oauth2/v2/auth
https://oauth2.googleapis.com/token
  • Open OAuth 2.0 playground, GMB API is not categorized under any default scope. You need to define custom scope mentioned below for this and authorize API.
https://www.googleapis.com/auth/business.manage
  • In OAuth 2.0 configuration, Tick the box which says use your own OAuth credentials and enter your credentials. Exchange authorization code and generate access token.
  • Congrats you’re all set, You can test API by sending HTTP requests via OAuth 2.0 Playground. You can find complete list of API references here.
Locations Data via GMB API
Reviews Data via GMB API

Setting up Store Locator:

Technologies Used

Front End — React JS, Redux, Next JS, HTML, Server Side Rendering
Backend — Node JS for fetching data from GMB API’s
API — GMB Location, Reviews and Meta Data API’s are used
Google Map API for fetching map data
Database — Firebase (All data from GMB API is synced in firebase)

Data fetched via GMB Pages for Store Locator

It contains the following Information for all GoMechanic Stores
- Name, Address, Landmark, City, State, Pincode. Map link, Call Option
- Opening Hours
- Payment Options Available at stores
- Store Photos section
- Reviews and Ratings
- Customer Reviews
- GoMechanic Services offered at store
- NearBy Stores
- FAQ Section
- Detailed information about store

Schemas used for SEO

- Local Business Schema
- Faq Schema
- SiteNavigationElement
- SoftwareApplication
- ServicesSchema
- Faq Schema
- SiteNavigationElement
- SoftwareApplication
- ServicesSchema

Other Optimizations in Store Locator

Store locator contains following details
- City Wise list of GoMechanic Stores
- Map View with pins of all stores in specific city
- CallBack Option for customers

We were able to finish this in a week’s timeline, A huge shout out to Akshay Almadi who developed this beautiful store locator.

--

--

Gagandeep Singh
GoMechanic

Tech, Race, Creative Thinker, Web, Code, Turban, Solution, Debugging, Musician, Loves God, family & harmonium!