Sunoco GMB Analytics Dashboard
Back to Projects

Sunoco GMB Analytics Dashboard

Real-time analytics platform for 2000+ fuel station locations with role-based access control, territory management, and performance leaderboards built on React and Supabase.

2024Live
Locations
2,047
+12 this month
Avg Rating
4.2
★★★★☆
Response
87%
↑ 4% vs last mo
Alerts
23
Need attention
Performance by Territory
NE
SE
MW
SW
NW
AT
GL
PA
SO
CE
Top Locations
1
96
2
94
3
91
4
86
5
83
Alerts
Station #2104 — low rating
Station #1832 — no response
14 reviews pending reply

Results

2000+
Locations
Real-time monitoring
5
Territory Managers
Personalized views
4
Access Levels
RBAC implementation
Real-time
Updates
Live metric refresh

Overview

Built for the Parkland marketing team to manage Google My Business presence across 2000+ Sunoco fuel stations. Territory managers get filtered views of their own locations, executives get the full picture, and performance leaderboards drive accountability.

The Challenge

Managing Google My Business presence across thousands of locations requires:

  • Centralized visibility into location performance
  • Territory-level insights for regional managers
  • Comparative analysis to identify underperformers
  • Secure access based on organizational role

Solution Architecture

Tech Stack

  • Frontend: React with TypeScript
  • Backend: Supabase (PostgreSQL + Auth)
  • Hosting: Vercel
  • Data Pipeline: CSV uploads + automated processing

Data Model

Locations ──┬── Performance Metrics
            │
            ├── Territory Assignments
            │
            └── Manager Relationships

Key Features

Real-Time Filtering

Dynamic filtering across multiple dimensions:

  • Geographic region
  • Territory manager
  • Performance tier
  • Time period

Territory Management

typescript
interface Territory {
  id: string;
  name: string;
  manager: User;
  locations: Location[];
  metrics: AggregatedMetrics;
}

Managers see only their assigned locations, while executives get full visibility.

Performance Leaderboards

Rankings based on key GMB metrics:

  • Review response rate
  • Average rating
  • Profile completeness
  • Photo engagement

CSV Upload Workflow

Simple data refresh process:

  1. Export GMB data from Google
  2. Upload CSV to dashboard
  3. Automatic parsing and validation
  4. Real-time metric updates

Role-Based Access Control

Permission Levels

RoleAccess
AdminFull access, user management
ExecutiveAll territories, all metrics
Regional ManagerAssigned territories only
Territory ManagerOwn locations only

Implementation

typescript
// Row-level security in Supabase
create policy "Users see own territory"
on locations for select
using (
  territory_id in (
    select territory_id from user_territories
    where user_id = auth.uid()
  )
);

Dashboard Views

Overview Dashboard

  • Total locations with health indicators
  • Aggregate metrics across portfolio
  • Trend charts for key performance indicators
  • Alert panel for locations needing attention

Location Detail

  • Individual location metrics
  • Review timeline
  • Photo gallery performance
  • Comparison to territory average

Manager View

  • Territory performance summary
  • Location-by-location breakdown
  • Action items for improvement
  • Export capabilities for reporting

Technical Highlights

Performance Optimization

  • Materialized views for aggregate calculations
  • Pagination for large datasets
  • Debounced filter updates
  • Optimistic UI updates

Security

  • Row-level security at database level
  • JWT-based authentication
  • Secure credential storage
  • Audit logging for data access

Results

The dashboard enables:

  • 2000+ locations monitored in real-time
  • 5 territory managers with personalized views
  • Weekly performance reviews using dashboard data
  • Faster review response rates across managed territories