Query GA4, Search Console, and Merchant Center with AI
As a business owner, I used to check performance data across Google Analytics 4, Google Search Console, and Google Merchant Center by logging into three separate portals, navigating complex submenus, and exporting raw CSVs. To solve this, I built an automated workflow that connects my AI coding assistant, Google Antigravity, directly to all three Google platforms through a Google Cloud Service Account. Instead of manually clicking through dashboards, I can ask natural-language questions in plain English, such as "Did yesterday's email send generate traffic or phone bookings?" or "Are any products disapproved in Google Merchant Center?" I then receive instant, cross-platform analysis in seconds. Step-by-step: 1. I created a Google Cloud Service Account by going to Google Cloud Console (console.cloud.google.com) > IAM & Admin > Service Accounts > Create Service Account. I named it `ai-marketing-assistant`, copied the generated service account email address, such as `ai-marketing-assistant@<project-id>.iam.gserviceaccount.com`, and downloaded the JSON private key file to my local project folder. 2. In Google Cloud Console > APIs & Services > Library, I enabled the three required APIs: - Google Analytics Data API - Google Search Console API - Content API for Shopping (Google Merchant Center) 3. In Google Analytics > Admin > Property Access Management, I added the Service Account email address with "Viewer" permissions and copied my numerical GA4 Property ID. 4. In Google Search Console > Settings > Users and permissions > Add User, I added the Service Account email address with "Full" or "Restricted" access. 5. In Google Merchant Center > Settings & Tools > Account Access > Add User, I added the Service Account email address with "Standard" or "Admin" access and ensured that "Content API access" was enabled. 6. In my local AI environment, such as Google Antigravity or a custom Python environment, I authenticated using standard Google client libraries (`google-oauth2`, `googleapiclient`, `google-analytics-data`) connected to the downloaded JSON key file. 7. Anytime I launch a marketing campaign, want an SEO audit, or need to check product feed health, I ask my AI assistant a plain-English question. 8. The AI executes live API queries against GA4, Search Console, and Merchant Center, cross-references website traffic with bookings, and delivers an instant report.
0 comments