Marketing & analytics · Cursor & VS Code
Connect Google Analytics 4 to Cursor & VS Code
Ask your AI about traffic, conversions and revenue in every GA4 property. Plugsight links GA4 to Cursor & VS Code in a few minutes, with no code and no exports.
What you can ask Cursor & VS Code about GA4
How to connect GA4 to Cursor & VS Code
- Create a free Plugsight account.
- Choose Google Analytics 4 and sign in with Google. Every GA4 property you can access is included.
Then add Plugsight to Cursor & VS Code
- In Plugsight, open MCP servers, create one and copy its URL. For VS Code and Gemini CLI, also create an API key on the server's page.
- Cursor: add this to ~/.cursor/mcp.json (or .cursor/mcp.json in a project), save, then sign in to Plugsight and click Allow access when the browser opens:
{"mcpServers": {"plugsight": {"url": "https://app.plugsight.app/mcp/YOUR_SERVER_ID"}}} - If no browser window opens in Cursor, add an API key instead: put it in an environment variable called PLUGSIGHT_API_KEY and add "headers": {"Authorization": "Bearer ${env:PLUGSIGHT_API_KEY}"} next to the url.
- VS Code (Copilot agent mode): add this to .vscode/mcp.json. VS Code asks for the key once and stores it securely:
{"inputs": [{"type": "promptString", "id": "plugsight-key", "description": "Plugsight API key", "password": true}], "servers": {"plugsight": {"type": "http", "url": "https://app.plugsight.app/mcp/YOUR_SERVER_ID", "headers": {"Authorization": "Bearer ${input:plugsight-key}"}}}} - Gemini CLI: add this to ~/.gemini/settings.json
{"mcpServers": {"plugsight": {"httpUrl": "https://app.plugsight.app/mcp/YOUR_SERVER_ID", "headers": {"Authorization": "Bearer YOUR_API_KEY"}}}} - Reload the tool and ask its agent to use the Plugsight tools.
Cursor signs in to Plugsight in your browser. VS Code, Gemini CLI and other clients connect with your MCP server's URL and an API key. Works with any client that supports remote MCP servers over HTTP.
Full steps and troubleshooting in the docs: Cursor, VS Code, Other MCP apps.
GA4 data available
- Sessions, users, engagement, key events (conversions) and revenue
- Channel, source / medium, campaign and landing page
- Ecommerce: purchases, items, add-to-carts and checkouts
- Google Ads keyword and search query for linked accounts
- Any GA4 dimension or metric, including your custom definitions
- Funnels: where people drop off between any steps or pages
- Your key events, with counts for any period
- Realtime: who is on the site right now
Ready-made analyses
- Account overview: Every platform and account, this period against the last.
- Period comparison: Any metrics against the previous period or last year.
Why use GA4 in Cursor & VS Code
- Use business data inside your editor
- Build dashboards and scripts on real numbers
- One server for many tools
Questions about GA4 and Cursor & VS Code
How do I connect Google Analytics 4 to Cursor & VS Code?
Create a free Plugsight account and connect GA4: Choose Google Analytics 4 and sign in with Google. Every GA4 property you can access is included. Then add Plugsight to Cursor & VS Code: In Plugsight, open MCP servers, create one and copy its URL. For VS Code and Gemini CLI, also create an API key on the server's page. Cursor: add this to ~/.cursor/mcp.json (or .cursor/mcp.json in a project), save, then sign in to Plugsight and click Allow access when the browser opens: {"mcpServers": {"plugsight": {"url": "https://app.plugsight.app/mcp/YOUR_SERVER_ID"}}} If no browser window opens in Cursor, add an API key instead: put it in an environment variable called PLUGSIGHT_API_KEY and add "headers": {"Authorization": "Bearer ${env:PLUGSIGHT_API_KEY}"} next to the url. VS Code (Copilot agent mode): add this to .vscode/mcp.json. VS Code asks for the key once and stores it securely: {"inputs": [{"type": "promptString", "id": "plugsight-key", "description": "Plugsight API key", "password": true}], "servers": {"plugsight": {"type": "http", "url": "https://app.plugsight.app/mcp/YOUR_SERVER_ID", "headers": {"Authorization": "Bearer ${input:plugsight-key}"}}}} Gemini CLI: add this to ~/.gemini/settings.json {"mcpServers": {"plugsight": {"httpUrl": "https://app.plugsight.app/mcp/YOUR_SERVER_ID", "headers": {"Authorization": "Bearer YOUR_API_KEY"}}}} Reload the tool and ask its agent to use the Plugsight tools.
Can Cursor & VS Code read my GA4 data?
Yes, once connected. Cursor & VS Code can see: Sessions, users, engagement, key events (conversions) and revenue; Channel, source / medium, campaign and landing page; Ecommerce: purchases, items, add-to-carts and checkouts; Google Ads keyword and search query for linked accounts. For example, ask: "Which channels drove the most revenue this month vs last month?"
Which Cursor, VS Code & other MCP clients plans work?
Works with any client that supports remote MCP servers over HTTP.
How does Cursor & VS Code sign in to Plugsight?
Cursor signs in to Plugsight in your browser. VS Code, Gemini CLI and other clients connect with your MCP server's URL and an API key.
Can Cursor & VS Code change anything in GA4?
No. Plugsight only reads Google Analytics 4; it never creates, changes or deletes anything there.
Is the GA4 connector free?
Google Analytics 4 is on the Pro plan ($29 a month, or $290 a year), which also adds more connections and the other marketing sources. The Free plan covers email, helpdesk, calendar, contacts, files, stores and email marketing.
Good to know
- When Google applies data thresholds or sampling, Plugsight says so in the answer.
Related guides
Connect Google Analytics 4 to Cursor & VS Code
Free plan, no credit card. Set up in about five minutes.
Updated