How do you connect GA4 to ChatGPT?
Short answer: ChatGPT has no built-in Google Analytics button, so you bring the data to it in one of three ways: export a GA4 report as a CSV and upload it, keep your GA4 numbers in a Google Sheet that ChatGPT can read, or add an MCP server as a custom connector so ChatGPT can query GA4 itself. The CSV route is free and takes five minutes; the MCP route is the only live one, but it needs setup and a ChatGPT plan that allows developer mode.

Which way should you pick?
| Method | Cost | Setup | Live data? | Best for |
|---|---|---|---|---|
| 1. CSV export and upload | Free | 5 minutes | No, a snapshot | A monthly look at one report |
| 2. Google Sheet | Free, or a paid add-on to refresh it | 15 to 30 minutes | Only as fresh as the sheet | A report you review every week |
| 3. MCP server as a custom connector | Google’s server is free; hosted ones charge | An hour or more for Google’s server; minutes for a hosted one | Yes | Agencies and analysts who ask new questions often |
Most small businesses only need the first method. Start there, and move up only if you find yourself exporting the same report every week.
Method 1: export a GA4 report and upload it
- Open GA4 and go to Reports. Pick the report you want to discuss. For “where do my visitors come from”, use Acquisition → Traffic acquisition.
- Set the date range at the top right. Compare it to the previous period if you want ChatGPT to talk about change.
- Change the primary dimension to the one you care about, for example Session source / medium, and add a secondary dimension such as Landing page if you need it.
- Click the Share this report icon at the top right, then Download File, then Download CSV.
- In ChatGPT, start a new chat, attach the CSV with the paperclip or plus button, and tell it what the file is: “This is a GA4 Traffic acquisition export for 1 to 31 October.”
Two details save a lot of confusion. GA4 puts a few lines of notes above the table in its CSV export, so tell ChatGPT to skip them if it misreads the header. And a standard report export holds only the rows on screen, so raise Rows per page at the bottom of the report before you download.
For a custom view, build it in Explore and use the export icon at the top right of the exploration. It offers CSV as well as Google Sheets.
Method 2: keep GA4 data in a Google Sheet
If you look at the same numbers every week, a sheet is less work than a new export each time. There are two common ways to fill it:
- Export straight from an exploration. In Explore, the export menu can send the table to Google Sheets. It is still a snapshot, but it lands in Drive without a download.
- A sheet that refreshes itself. Google’s free Google Analytics add-on for Sheets was built for Universal Analytics and does not work with GA4, so a refreshing sheet needs a paid connector (several reporting tools offer one) or a short Apps Script that calls the GA4 Data API.
Then connect Google Drive to ChatGPT from its apps or connectors settings, or download the sheet and upload it. Ask ChatGPT to read a named tab, so it does not guess which table you mean.
Method 3: connect GA4 through an MCP server
MCP (Model Context Protocol) is a standard way for an AI assistant to call tools. An MCP server for GA4 lets ChatGPT run a report itself when you ask a question, instead of reading a file you gave it.
Google’s Analytics MCP server
Google publishes an open-source MCP server for Analytics in the googleanalytics/google-analytics-mcp repository on GitHub. Its tools include get_account_summaries, get_property_details, run_report, run_funnel_report and run_realtime_report. To run it you need to:
- Create or pick a Google Cloud project and enable the Google Analytics Admin API and the Google Analytics Data API.
- Set up credentials for a Google account that can see your GA4 property, with the read-only scope
analytics.readonly. - Install Python’s pipx and start the server with
pipx run analytics-mcp.
The catch for ChatGPT: by default the server runs on your own computer, and ChatGPT’s custom connectors need a server they can reach over HTTPS. The project documents an HTTP mode with sign-in for shared use, but hosting it is a job for someone comfortable with servers. Google’s own setup notes cover Gemini CLI and Claude Code, which can run it locally.
Hosted GA4 connectors
Several reporting companies run a GA4 MCP server for you. You sign in with Google, pick a property, and paste the connector address they give you into ChatGPT. It is quicker, but your GA4 access then runs through that company, and most charge after a trial. Grant read-only access and read their data policy first.
Adding the connector in ChatGPT
Custom MCP connectors live in ChatGPT’s settings under apps or connectors, and need developer mode switched on. OpenAI has changed which plans can use developer mode and where the switch sits more than once, so check your own settings. On Business and Enterprise workspaces, an admin may have to allow it first. Free accounts cannot add custom connectors.
Eight prompts that work with GA4 data
- “Which five sources sent the most sessions, and how did each change against the previous period? Show the numbers.”
- “Which landing pages have the most sessions but the lowest key event rate? List the bottom five with at least 50 sessions.”
- “Group these sources into Search, Social, Email, AI assistants and Other. Treat chatgpt.com, perplexity.ai, gemini.google.com, copilot.microsoft.com and claude.ai as AI assistants.”
- “Which pages do visitors from AI assistants land on? Compare them with the pages Google organic visitors land on.”
- “Write a five-line summary of this month for a client who is not technical. No jargon, and only numbers that are in the file.”
- “What looks unusual in this data? Flag any day or source that is more than double its normal level.”
- “Check your work: show the rows you used for the total and the formula.”
- “What can’t this data tell me? List the questions I would need another report for.”
The last two matter most. They make ChatGPT show its sums and admit the limits of the file, which is where most wrong answers come from.
Use it to find your AI traffic
The most common reason people want GA4 in ChatGPT is to ask “how much traffic do I get from AI?”. ChatGPT can answer that only from the rows you give it, so give it the right ones. Export Traffic acquisition with Session source / medium, or filter the report first with a regular expression that matches AI assistants. Our free AI referral regex generator builds that filter for you, and our guide on finding ChatGPT traffic in GA4 shows where to paste it and how to make a permanent AI channel.
Know the limit before you report the number. Many visits from AI apps arrive with no referrer, so GA4 files them under Direct, and neither GA4 nor ChatGPT can move them back. ChatGPT also adds utm_source=chatgpt.com to many of its links, which helps; our guide to what utm_source=chatgpt.com means explains where it shows up. Treat the AI number you get as a minimum.
How to check ChatGPT’s answers
- Spot-check one number. Before you act on an answer, find one figure it quoted in GA4 itself. If that one is wrong, the rest probably are too.
- Watch the totals row. GA4 exports can include a total that ChatGPT may add in twice.
- Mind “(not set)” and “(other)”. On busy reports GA4 groups rare values together, so small sources can be hidden in those rows.
- Keep the dates fixed. Say the date range in your prompt every time. A live connector may otherwise pick its own default.
- Ask for numbers, not adjectives. “Traffic grew strongly” is not a finding. “Sessions from Google rose from 1,240 to 1,410” is.
Privacy: what you are sharing
Standard GA4 reports are counts and rates, and Google’s terms forbid sending personal data such as names or email addresses to GA4, so a normal export contains no customer details. Still check the file before you upload it: page paths and URL parameters sometimes carry emails or order numbers by mistake. For an agency, client data may also be covered by a contract that limits AI tools, so ask first. For connectors, use read-only access and remove it when you stop using it.
What GA4 in ChatGPT cannot tell you
Whichever method you use, ChatGPT only sees what GA4 recorded. It cannot tell you which phone calls, quote forms or sales came from ChatGPT, because GA4 does not link a visit to the customer who later called. If that is the question you are trying to answer, our guide on how to tell if ChatGPT is sending you customers covers the methods that reach the lead, and our comparison of Which AI Sent and GA4 shows what each one can see.
Connecting GA4 to ChatGPT
Can ChatGPT connect to Google Analytics directly?
Not with a built-in Google Analytics button. You can upload a GA4 export, connect a Google Sheet that holds your GA4 data, or add an MCP server (Google’s open-source Analytics MCP server or a hosted one from a third party) as a custom connector, where your ChatGPT plan allows developer mode.
Is it safe to give ChatGPT my GA4 data?
GA4 reports are aggregated numbers, and Google’s rules forbid sending personal data to GA4, so a normal export holds no names or emails. Still check what you upload, use read-only access for any connector, and follow your company’s or your client’s policy on AI tools.
Is there a free way to connect GA4 to ChatGPT?
Yes. Exporting a report as CSV from GA4 and uploading it to ChatGPT costs nothing. Google’s Analytics MCP server is also free and open source, but it needs a Google Cloud project, some setup and a ChatGPT plan that allows custom connectors.
Can ChatGPT see which visits came from ChatGPT in my GA4 data?
Only if the data you give it includes the source. Export a report with Session source / medium, or filter it with an AI referral regex, and ChatGPT can sum and compare those rows. It cannot see visits that GA4 recorded as Direct because the assistant sent no referrer.
Why do ChatGPT’s numbers not match my GA4 report?
Usually because it read a different date range, mixed up columns, summed rows that overlap, or skipped the totals row. Ask it to show the rows it used and the formula, and check one number against GA4 before you act on anything.
See which AI assistant sent each lead
GA4 counts visits. Which AI Sent shows the visits, form leads and sales that came from ChatGPT, Gemini and Perplexity, with no exports.