Overview
Before generating reports, you need to:- Add a client record with their website details
- Connect their Google account via OAuth
- Select their Search Console property and Analytics property
Prerequisites
- Google APIs configured
- An active Reportr subscription (or trial)
- Google account with access to client’s Search Console and Analytics
Client Limits by Plan:
- Free: 1 client
- Starter: 5 clients
- Professional: 15 clients
- Agency: 50 clients
/workspace/source/src/lib/plan-limits.ts:15-43 for plan limits.Step 1: Add a New Client
Navigate to Clients page
From your dashboard, click Clients in the sidebar or navigate to
/dashboard/clientsFill in client details
Required fields:
- Client Name: The client’s business name (min 2 characters)
- Website URL: Full URL including
https://(must be valid URL format)
- Contact Name: Client’s primary contact person
- Contact Email: Valid email address for the client
Step 2: Connect Google Account
Start OAuth flow
After creating the client, click Connect Google Account on the client card.Alternatively, click the client name → Settings → Connect Google Account
Authorize Google access
You’ll be redirected to Google’s OAuth consent screen. Review the permissions:
- Google Search Console - Read-only access to search analytics
- Google Analytics - Read-only access to Analytics data
The OAuth flow is handled by
/workspace/source/src/app/api/auth/google/authorize/route.ts and the callback is processed at /workspace/source/src/app/api/auth/google/callback/route.tsWhat Happens During OAuth?
When you authorize Google access, Reportr:-
Requests OAuth scopes (see
/workspace/source/src/lib/google/config.ts:3-6): -
Receives tokens from Google:
- Access token (expires in ~1 hour)
- Refresh token (used to get new access tokens)
-
Stores encrypted tokens in your database:
googleAccessToken- Current access tokengoogleRefreshToken- Long-lived refresh tokengoogleTokenExpiry- When access token expiresgoogleConnectedAt- Connection timestamp
-
Automatically refreshes access tokens when they expire using the refresh token logic in
/workspace/source/src/lib/google/config.ts:16-32
Step 3: Select Search Console Property
View available properties
After connecting Google, click Configure Properties on the client card.Reportr will fetch all Search Console sites accessible with your connected Google account.
Choose the correct site
Select the Search Console property that matches your client’s domain:
https://example.com- HTTPS sitehttp://example.com- HTTP sitesc-domain:example.com- Domain property (recommended)
Step 4: Select Analytics 4 Property
View GA4 properties
In the same configuration screen, Reportr will list all Google Analytics 4 properties you have access to.
Only GA4 properties are shown. Universal Analytics (UA) properties are not supported.
Select the client's property
Choose the GA4 property that corresponds to this client’s website.Properties are listed with:
- Property name
- Property ID (e.g.,
properties/123456789)
Verification
After completing the setup, verify the client is properly configured:Check connection status
On the Clients page, the client card should show:
- ✅ Google Connected
- ✅ Search Console Configured
- ✅ Analytics Configured
Managing Multiple Clients
Using Different Google Accounts
If your clients use different Google accounts for their properties:-
Shared account approach (recommended):
- Have clients grant you Editor access to their Search Console and Analytics
- Connect all clients using your agency’s Google account
- Benefit: Single login, easier management
-
Individual account approach:
- Disconnect the current Google connection
- Re-authorize with a different Google account for each client
- Limitation: You need to re-authenticate when switching between clients
Bulk Client Setup
For agencies with many clients:Prepare client list
Create a spreadsheet with:
- Client names
- Website URLs
- Contact information
- Search Console property URLs
- GA4 property IDs
Add clients sequentially
Use the UI to add clients one by one, or use the API endpoint:See
/workspace/source/src/app/api/clients/route.ts:18-95 for the implementation.Troubleshooting
”Client not found or unauthorized”
Problem: Cannot access a client you created Solution:- Ensure you’re logged in with the same account that created the client
- Clients are isolated by user ID for security
- Check database for
userIdmatching in theclientstable
No Search Console Sites Found
Problem: Property list is empty after connecting Google Solution:- Verify the connected Google account has Search Console access
- Check that sites are verified in Google Search Console
- Grant your Google account Owner or Full User permission
- Wait 24 hours after adding a new site to Search Console
Wrong Analytics Property Listed
Problem: Can’t find the correct GA4 property Solution:- Confirm the property is GA4, not Universal Analytics
- Verify your Google account has at least Viewer access to the property
- Check Google Analytics to confirm property exists
- Properties may take time to appear after being created
Token Refresh Failures
Problem: “Google account not connected” error after initial connection Solution:- Refresh tokens can expire if:
- User revokes access in Google Account settings
- App is removed from authorized apps
- Refresh token hasn’t been used for 6 months
- Fix: Disconnect and reconnect the Google account
- Reportr automatically attempts token refresh (see
/workspace/source/src/lib/google/config.ts:16-32)
“Email verification required”
Problem: Cannot add clients despite being logged in Solution:- Free plan users must verify their email before adding clients
- Check your inbox for verification email
- Paid subscription users bypass this requirement
- See the check in
/workspace/source/src/app/api/clients/route.ts:23-39
Client Data Schema
For reference, here’s what’s stored for each client (from/workspace/source/prisma/schema.prisma:73-108):
| Field | Type | Description |
|---|---|---|
id | String | Unique client identifier |
name | String | Client business name |
domain | String | Client website URL |
contactEmail | String? | Contact email (optional) |
contactName | String? | Contact name (optional) |
googleRefreshToken | String? | OAuth refresh token (encrypted) |
googleAccessToken | String? | Current access token (encrypted) |
googleTokenExpiry | DateTime? | Token expiration time |
googleConnectedAt | DateTime? | When Google was connected |
gscSiteUrl | String? | Search Console property URL |
gscSiteName | String? | Search Console property name |
ga4PropertyId | String? | Analytics property ID |
ga4PropertyName | String? | Analytics property name |
userId | String | Owner’s user ID (for isolation) |
lastReportGenerated | DateTime? | Last report timestamp |
totalReportsGenerated | Int | Count of all reports |
Next Steps
With clients connected, you’re ready to generate reports:Generate Reports
Create AI-powered SEO reports for your clients
Customize Branding
Add your agency’s logo and colors to reports