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!
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
- Go to the Google Cloud Console.
- Create a new project or select an existing one.
- You’ll need to request access to the Google My Business API before you can begin using it to access data.
- After access has been granted, navigate to “APIs & Services” -> “Library” and search for the Google My Business API.
- 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:
- Create a BigQuery Dataset
- Create a Table within the dataset to hold the review data.
- 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
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!