Affinity Design
Agency Guide

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

  1. Go to Google Cloud Console
  2. Click Create Project
  3. Enter a project name (e.g., "af-gemini-connect")
  4. Click Create

2. Enable Required APIs

  1. In your Cloud Project, go to APIs & ServicesLibrary
  2. 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

  1. Go to APIs & ServicesCredentials
  2. Click Create CredentialsOAuth 2.0 Client ID
  3. Configure the consent screen:
    • Application type: Web application
    • Name: af-gemini-connect
    • Authorized redirect URIs: Add https://your-domain.com/oauth/google/callback
  4. Click Create
  5. Copy the Client ID and Client Secret

4. Configure Google Connection in af-gemini-connect

  1. In af-gemini-connect, go to AdminIntegrations
  2. Select Google tab
  3. Click Connect Google Account
  4. Paste your Client ID and Client Secret
  5. Click Authenticate
  6. 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

  1. Use a dedicated Google account for your agency to manage all connections
  2. Set up proper IAM roles so team members have appropriate access
  3. Monitor API usage to avoid hitting daily limits
  4. Regularly review connected properties to ensure they're still active
  5. 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.

On this page