Google Business Profile
Connect, audit, and optimize Google Business Profile locations with 10-dimension scoring and MCP tools
Overview
The Google Business Profile (GBP) integration connects your client's Business Profile locations to the platform, enabling automated audits across 10 scoring dimensions, AI-generated content suggestions, and direct profile updates through the admin UI or MCP tools.
This page is the connection and system guide. For the everyday operating view, start with GBP Operations.
Read This First
In plain language:
- the score matters
- profile truth matters more
- website and GBP should agree
- posts and replies still need sensible review
Prerequisites
- A Google account that owns or manages at least one Business Profile
- Access to Google Cloud Console
- The server running with MongoDB connected
Google Cloud Setup
Step 1: Google Cloud Project
If you already have a Google Cloud project with OAuth configured for GA4/GSC connections, skip to Step 2 — the same project and credentials work for GBP.
- Go to Google Cloud Console
- Create a new project or select an existing one
- Note the Project ID for future reference
Step 2: Enable the GBP APIs
Enable all three Business Profile APIs in your Google Cloud project:
| API Name | Search Term | Direct Link |
|---|---|---|
| My Business Account Management API | mybusinessaccountmanagement | Enable |
| My Business Business Information API | mybusinessbusinessinformation | Enable |
| Business Profile Performance API | businessprofileperformance | Enable |
If you already have GA4 and GSC APIs enabled, these are additional APIs in the same project — not a separate project.
Step 3: OAuth Consent Screen
If you already configured the consent screen for GA4/GSC, just add the GBP scope:
- Go to APIs & Services → OAuth consent screen
- Click Edit App
- On the Scopes step, click Add or Remove Scopes
- Add:
https://www.googleapis.com/auth/business.manage - Save
If creating a new consent screen:
- Choose External user type
- Fill in app name, support email, developer contact email
- Add the scope:
https://www.googleapis.com/auth/business.manage - Add test users (your Google account email) — required while app is in "Testing" status
- Save and continue through all steps
While the app is in "Testing" status, only emails listed as test users can complete the OAuth flow. Move to "Production" publishing status when ready for client use.
Step 4: OAuth Client Credentials
If you already have OAuth credentials for GA4/GSC, use the same ones — no new credentials needed.
If creating new:
- Go to APIs & Services → Credentials
- Click + Create Credentials → OAuth client ID
- Application type: Web application
- Add authorized redirect URIs:
- Production:
https://api.v2.affinitydesign.ca/integrations/google/callback - Local dev:
http://localhost:8000/integrations/google/callback
- Production:
- Copy the Client ID and Client Secret
Step 5: Environment Variables
# Google OAuth (shared with GA4/GSC connections)
GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secret
GOOGLE_REDIRECT_URI=https://api.v2.affinitydesign.ca/integrations/google/callback
For local dev, use http://localhost:8000/integrations/google/callback.
These are the same 3 variables used by GA4 and GSC connections. If already set, GBP works automatically — no additional env vars needed. No GBP-specific API keys are required.
Connecting Locations
Via Admin UI
- Navigate to SEO → Google Business in the admin panel
- Select a client from the picker
- Click Connect GBP (triggers the OAuth popup)
- The OAuth flow hits:
GET /integrations/google/authorize?clientId={id}&serviceType=gbp - User grants
business.managescope - Callback auto-discovers all GBP accounts and locations
- A
Connectiondocument is created withserviceType: "gbp"per location
Via API
# Get the OAuth URL (open in browser)
curl "https://api.v2.affinitydesign.ca/integrations/google/authorize?clientId=CLIENT_ID&serviceType=gbp"
# After completing OAuth, verify the connection exists
curl -H "Authorization: Bearer ADMIN_TOKEN" \
"https://api.v2.affinitydesign.ca/admin/gbp/connections/CLIENT_ID"
What Happens on Connect
- OAuth consent screen with
business.managescope - Token exchange → access + refresh tokens stored in
Connection.oauthTokens - Auto-discovery: lists all GBP accounts → lists locations per account
- First location is set as the default in
serviceConfig - For multi-location businesses, each location gets its own
Connectiondocument - Token auto-refresh:
google-auth.jslistens fortokensevents and persists new credentials
Running Audits
Via Admin UI
- Go to SEO → Google Business
- Click a location card
- Click Run Audit — scores the profile across 10 dimensions
- Or click Auto Audit — scores + auto-commits critical/high fixes
Via API
# Run audit
curl -X POST -H "Authorization: Bearer ADMIN_TOKEN" \
-H "Content-Type: application/json" \
-d '{"clientId": "CLIENT_ID"}' \
"https://api.v2.affinitydesign.ca/admin/gbp/CONNECTION_ID/audit"
# List audit history
curl -H "Authorization: Bearer ADMIN_TOKEN" \
"https://api.v2.affinitydesign.ca/admin/gbp/CONNECTION_ID/audits"
Scoring Dimensions
The audit scores profiles across 10 dimensions (100 points total):
| Dimension | Max Points | What's Checked |
|---|---|---|
description | 15 | Length, keywords, no phone/URL in text |
categories | 15 | Primary + additional categories set |
photos | 10 | Cover, logo, interior/exterior counts |
attributes | 10 | Business attributes populated |
hours | 10 | Regular hours + special hours set |
reviews | 10 | Review count + average rating |
services | 10 | Service items listed |
contact_info | 8 | Phone, website, appointment URL |
posts | 7 | Recent posts within 7 days |
qa | 5 | Q&A section activity |
Vertical detection (services/restaurant/generic) adjusts scoring weights — e.g. restaurants get extra weight on menu/photos, service businesses on service items.
MCP Tools
The MCP plugin exposes 10 GBP tools for use in AI agent sessions:
| Tool | Purpose |
|---|---|
gbp_list_locations(clientId) | See all connected locations |
gbp_get_location(connectionId) | Full location data |
gbp_patch_location(connectionId, ...) | Update description, hours, etc. |
gbp_update_attributes(connectionId, ...) | Set business attributes |
gbp_list_audits(connectionId) | Audit history |
Plus additional read/write tools and 3 resources exposed through the MCP plugin at mcp/plugins/gbp.js.
Troubleshooting
| Issue | Fix |
|---|---|
| "No GBP locations found" after OAuth | The Google account may not own/manage any Business Profiles. Verify at business.google.com |
403 Forbidden on GBP API calls | The mybusinessaccountmanagement API may not be enabled. Check Step 2 |
| Token refresh failures | Check that GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET match the OAuth app that originally issued the tokens |
| "business.manage scope not granted" | The scope wasn't added to the OAuth consent screen. See Step 3 |
| Timeout on location discovery | Large multi-location accounts may take time — discovery runs serially per account |
| Audit returns low score despite good profile | Some fields (posts, Q&A) may require additional API calls or the account may not have that data |
Architecture Reference
OAuth Flow:
Admin UI → GET /integrations/google/authorize?serviceType=gbp
→ Google consent screen (business.manage scope)
→ GET /integrations/google/callback
→ Token stored in Connection.oauthTokens
→ Auto-discovers accounts + locations
API Layer:
routes/gbp.js → 7 admin endpoints (audit, chat, commit, auto)
routes/client.js → 2 client-facing endpoints (read-only)
Utilities:
utils/google-auth.js → OAuth2 client factory + auto-refresh
utils/gbp-client.js → 12 GBP API wrapper functions
utils/gbp-scoring.js → 10-dimension scoring engine
utils/gbp-audit-engine.js → Full audit pipeline (fetch → score → AI content)
utils/gbp-verticals.js → Vertical detection + rules
Models:
models/connection.js → serviceType: "gbp", multi-location support
models/gbp-audit.js → Audit snapshots with scores, gaps, AI content
MCP:
mcp/plugins/gbp.js → 10 tools (read + write) + 3 resources
