Ask Nova, get SQL + charts
Meet Nova Database REST APIOne key per partner. No credentials shared.
Build an API AutomationScheduled sync to 6+ platforms
Explore API to SQLQuery APIs with SQL, no code
Explore AI Database MCPClaude, Cursor, ChatGPT & Grok talk to your data
Connect AIQuery Streams transforms your Google Analytics 4 data into SQL-queryable tables, letting you import live traffic, engagement, and e-commerce metrics directly into Google Sheets. No API coding, no manual exports—just write SQL queries and get GA4 analytics in your spreadsheet. Sign up free at QueryStreams.com and start querying your GA4 data in minutes.
Traffic, engagement, e-commerce, pages, events, and geographic data
No OAuth browser flow — just paste a JSON key for serverless authentication
Your GA4 service account key stored securely on your network, never in the cloud
Write custom attribution, funnel, and cohort queries beyond the GA4 UI
What Google Analytics 4 Data Can You Access?
Query Streams syncs your GA4 data to an AES-256 encrypted local cache, transforming it into SQL-queryable tables. Note that GA4 data is typically 24–48 hours delayed by Google’s processing pipeline.
Traffic
traffic_overviewDaily sessions, users, page views, engagementtraffic_sourcesSource/medium/campaign breakdown with conversionsgeographic_dataUsers by country, region, and city
Engagement
page_viewsPage-level metrics with paths and titlesuser_engagementDevice, browser, and OS breakdowneventsEvent counts including conversion events
E-commerce
ecommerce_overviewRevenue and transaction metricstransactionsTransaction and item-level details
Data Note
- GA4 data has a 24–48 hour processing delay from Google
- All tables sync daily — more frequent sync won’t yield new data
- Each table includes a
raw_dataJSON column with the full API response
Prerequisites
Sign up free — no credit card required
Windows service installed on your network. Install guide
With the Google Analytics Data API and Analytics Admin API enabled
JSON key file with Viewer access granted in your GA4 property
With the Query Streams add-on installed from Google Workspace Marketplace
Setup Guide
Step 1: Install the Query Streams Network Agent
- Log in to my.querystreams.com
- Navigate to Network Agents in the left sidebar
- Click Download Agent and run the Windows installer
- The agent installs as a Windows service and connects automatically
- Your agent appears as “Online” in the portal within 30 seconds
Step 2: Create a Google Cloud Service Account
- Go to the Google Cloud Console and create or select a project
- Navigate to APIs & Services → Library → enable Google Analytics Data API and Google Analytics Admin API
- Go to IAM & Admin → Service Accounts → Create Service Account
- Name it (e.g., “query-streams-ga4”) and click Create and Continue
- Skip the optional role assignment → click Done
- Click on the service account → Keys tab → Add Key → Create new key → JSON
- The JSON key file downloads automatically — save it securely
Grant Access in GA4
- Go to Google Analytics and select your GA4 property
- Click Admin → Property Access Management
- Click + → Add users
- Paste the
client_emailfrom your JSON key - Select the Viewer role → click Add
Step 3: Add the Google Analytics 4 Connector
- Open the Network Agent interface at
http://localhost:1823 - Click Add Connection and select Google Analytics 4
- Paste the contents of your Service Account JSON key (or upload the file)
- Select your GA4 Property from the dropdown
- Click Next to configure sync schedules and install pre-built queries
Step 4: Configure Your Sync Schedule
Syncing GA4 more frequently than daily won’t produce new data — Google’s processing pipeline typically has a 24–48 hour delay. Set your sync to run once daily at a low-traffic time for efficiency.
Step 5: Install the Google Sheets Add-on
- Open Google Sheets in your browser
- Go to Extensions → Add-ons → Get add-ons
- Search for “Query Streams”
- Click Install and grant the required permissions
- Access it via Extensions → Query Streams → Open
- Sign in with your Query Streams account credentials
- Or install directly: Install Query Streams for Google Sheets
You’re connected! Open Query Streams in Google Sheets, click Saved Queries, and find your Google Analytics folder with pre-built queries for traffic trends, channel attribution, conversion tracking, and more. Select any query and click Run to pull GA4 data into your spreadsheet.
Example Google Analytics 4 SQL Queries
SELECT
DATE_TRUNC('week', date) AS week,
SUM(sessions) AS sessions,
SUM(total_users) AS users,
SUM(new_users) AS new_users,
ROUND(AVG(bounce_rate) * 100, 1) AS avg_bounce_rate_pct
FROM ga4.traffic_overview
WHERE date >= CURRENT_DATE - INTERVAL '90 days'
GROUP BY DATE_TRUNC('week', date)
ORDER BY week DESC;
SELECT
session_default_channel_group AS channel,
SUM(sessions) AS sessions,
SUM(total_users) AS users,
SUM(conversions) AS conversions,
ROUND(AVG(engagement_rate) * 100, 1) AS engagement_rate_pct
FROM ga4.traffic_sources
WHERE date >= CURRENT_DATE - INTERVAL '30 days'
GROUP BY channel
ORDER BY sessions DESC
LIMIT 10;
SELECT
event_name,
SUM(event_count) AS total_events,
SUM(total_users) AS unique_users,
ROUND(AVG(event_count_per_user), 2) AS events_per_user
FROM ga4.events
WHERE is_conversion = true
AND date >= CURRENT_DATE - INTERVAL '30 days'
GROUP BY event_name
ORDER BY total_events DESC;
Share GA4 Reports Without Sharing Credentials
Open any GA4 query in the Query Builder → click the Sharing tab → enter email addresses → click Share. Recipients get analytics data in their Google Sheets add-on — without access to your Google Cloud service account, GA4 property admin, or SQL code.
Frequently Asked Questions
Related Guides
Category: API Connectors
Tags: Google Analytics, GA4, Google Sheets, API, Web Analytics, SQL, Traffic, Conversions
Meta Description: Connect Google Analytics 4 to Google Sheets with SQL. Query traffic, engagement, and e-commerce data — no API coding required. Step-by-step setup guide.

