Connecting Google
Integrate Google services with af-gemini-connect
Overview
Connecting Google services enables powerful marketing and analytics capabilities:
- Google Analytics 4 (GA4) — Track website traffic and user behavior
- Google Search Console (GSC) — Monitor search performance and indexing
- Google Business Profile (GBP) — Manage local business listings
- Google Ads — Create and manage paid advertising campaigns
This guide covers setting up Google OAuth connections for all these services.
Prerequisites
Before starting, ensure you have:
- Google account with admin access to the desired services
- Google Cloud Project with OAuth 2.0 credentials
- Owner/Editor access to the Google properties you want to connect
Step-by-Step Connection
1. Create a Google Cloud Project
- Go to Google Cloud Console
- Click Create Project
- Enter a project name (e.g., "af-gemini-connect")
- Click Create
2. Enable Required APIs
- In your Cloud Project, go to APIs & Services → Library
- Enable the following APIs:
- Google Analytics API
- Google Search Console API
- Google My Business API (for GBP)
- Google Ads API
- Google Sheets API (optional, for data export)
3. Create OAuth 2.0 Credentials
- Go to APIs & Services → Credentials
- Click Create Credentials → OAuth 2.0 Client ID
- Configure the consent screen:
- Application type: Web application
- Name: af-gemini-connect
- Authorized redirect URIs: Add
https://your-domain.com/oauth/google/callback
- Click Create
- Copy the Client ID and Client Secret
4. Configure Google Connection in af-gemini-connect
- In af-gemini-connect, go to Admin → Integrations
- Select Google tab
- Click Connect Google Account
- Paste your Client ID and Client Secret
- Click Authenticate
- Approve the OAuth consent screen
5. Select Properties to Connect
After authentication, you'll see a list of available Google properties:
- GA4 Properties — Select which properties to connect
- Search Console Sites — Choose which sites to monitor
- Google Business Profiles — Select locations to manage
- Google Ads Accounts — Connect manager or client accounts
Connection Health Monitoring
Once connected, monitor your Google integrations in the Integrations dashboard:
- Connection Status: Active/Inactive
- Last Sync: When data was last refreshed
- API Limits: Usage vs. quota limits
- Error Logs: Any API errors or failures
Troubleshooting
"Invalid credentials" error
- Verify your Client ID and Client Secret are correct
- Ensure the Google Cloud Project is in the same organization as your properties
- Check that the APIs are enabled for your project
Missing properties in the list
- Confirm you have admin access to the properties
- Check that the properties are in the same Google account
- Try disconnecting and reconnecting
API quota exceeded
- Review your API usage in Google Cloud Console
- Request quota increase if needed
- Reduce sync frequency or data volume
Token refresh failures
- Verify your redirect URI is correctly configured
- Check for IP restrictions in OAuth settings
- Ensure your app is not blocked by Google's security review
Best Practices
- Use a dedicated Google account for your agency to manage all connections
- Set up proper IAM roles so team members have appropriate access
- Monitor API usage to avoid hitting daily limits
- Regularly review connected properties to ensure they're still active
- Implement error handling to gracefully handle connection failures
Next Steps
After connecting Google services, you can:
- Set up automated GA4 reporting
- Monitor search performance with GSC
- Manage GBP listings and reviews
- Create and optimize Google Ads campaigns
- Sync data to Google Sheets for analysis
FAQ
Q: Can I connect multiple Google accounts?
A: Yes, you can connect multiple accounts, but each client should have their own dedicated connection.
Q: How often does data sync?
A: Sync frequency is configurable from every 15 minutes to daily.
Q: What happens if I disconnect a property?
A: Disconnecting will stop data collection and may affect reports that rely on that data.
Q: Are there limits on API calls?
A: Yes, Google imposes daily quotas. Monitor usage in the Cloud Console.
