Customer reviews are invaluable resources that can provide keen insights into customer satisfaction, business performance, and areas for improvement. For businesses using Google My Business, the wealth of Google review data is often untapped when it comes to analytics. One powerful way to analyze your Google review data (or the Google review data of your clients) is to load that data into BigQuery and then analyze or visualize it in the tool of your choice. You can even get ChatGPT to help you summarize insights in the data!

Photo by henry perks on Unsplash

In this blog post, we’ll explore how to collect Google Business Reviews via API and push them into Google BigQuery for further analysis.

Prerequisites

  • Google My Business Account
  • Google Cloud Account with BigQuery enabled
  • Basic understanding of APIs
  • Basic SQL knowledge

Steps to Collect Google Business Reviews

Step 1: Obtain Google My Business API Access

  1. Go to the Google Cloud Console.
  2. Create a new project or select an existing one.
  3. You’ll need to request access to the Google My Business API before you can begin using it to access data.
  4. After access has been granted, navigate to “APIs & Services” -> “Library” and search for the Google My Business API.
  5. Click “Enable” and create credentials (API Key, Client ID, and Client Secret).

Step 2: Collecting Reviews Using the API

To collect reviews, you will need to make HTTP requests to the Google My Business API.

Here’s the Python script we used to get reviews out of the API.

First, plenty of packages to install and import:

import sys
import json
from pprint import pprint
from googleapiclient import sample_tools
from googleapiclient.http import build_http
from googleapiclient.errors import HttpError
import oauth2client
import pandas as pd
import IPython
import os

Then, the heart of the code (found here) will grab all business accounts associated with your google profile, grab all locations associated with those business accounts, and finally, grab all reviews associated with each of those locations. There are some commented out print statements that can help you with debugging if you run into any issues.

Step 3: Push Reviews Data to Google BigQuery

Before pushing data to BigQuery, you must:

  1. Create a BigQuery Dataset
  2. Create a Table within the dataset to hold the review data.
  3. You’ll also need to create a service account before you can successfully push data to BigQuery.

Data Analysis in BigQuery / Looker Studio

Once your review data is in BigQuery, you can perform SQL analysis on your data, or even prep your data to be used in a visualization tool like Looker Studio / Looker, Tableau, or others. You’ll be able to analyze:

  • How many total reviews each business got in the last year
  • How your trailing 90-day avg. rating compares to the prior 90 days
  • Feed your data into ChatGPT to generalize the most common themes among reviewers who left 3 or fewer stars
Sample Google Reviews data visualized in Looker Studio

Make It Happen

Collecting Google Business Reviews and performing analysis using BigQuery is a powerful way to extract meaningful insights from customer feedback. By automating the process, you can continuously update your data and gain real-time insights into how your business is performing in the eyes of the customer.

Now go turn those 3 stars into 4 stars and those 4 stars into 5 stars!