Agents and MCP

GA4 answers, without the GA4 maze.

Connect your Google Analytics 4 properties to LopeBase, and your agent can read traffic, channels, landing pages, devices, and goal conversions for each one. Ask which channel converts, which landing page leaks, and what changed this week, in plain words.

Connect with Google in one click, read-only. Every property you run, from one sign-in.

Ask about outcomes, not reports

Your agent reads the same numbers the GA4 Data API returns, already shaped into small tables it can reason about.

agent · GA4, acme.com

Which channels actually bring signups? Use sign_up as the goal.

read_sourcega4-acmetraffic_sourcesgoal: sign_up

sourcevisitorssessionsconverted
Organic Search9,42012,871212
Direct4,1085,96088
Referral1,3771,70261
Organic Social2,9153,24017

Organic search brings the most signups. Referral is small but converts at about 4.4%, twice the site average. Social brings visitors who rarely sign up. Want the referring sites next?

Conversions by channel, page, and device

Pass any event as the goal and traffic_sources, landing_pages, and devices count who converted, not just who visited.

Find your goal events first

goal_events lists the events that could count as a conversion, with people in the last 28 days, the 28 before, and the last 7.

Every property in one place

Each GA4 property is its own connection, so an agent can compare products without switching accounts.

What your agent can read

Seven datasets per property. Breakdowns cover the last 28 days; the trend covers up to 90.

  • web_analyticsPageviews for 7 and 28 days, plus weekly and monthly active users.pageviews_7d · pageviews_28d · wau · mau
  • daily_pageviewsPageviews and visitors per day.day · pageviews · visitors
  • top_pathsThe most viewed pages over the last 7 days.url · views · visitors
  • goal_eventsEvents that may count as a conversion, with people now and before.event · people_28d · people_prev_28d · people_7d
  • traffic_sourcesVisitors and sessions per default channel group. Add { goal } to count conversions.source · visitors · sessions · converters
  • landing_pagesVisitors per landing page with bounce rate. Add { goal } for conversions.path · visitors · converters · bounce_rate
  • devicesVisitors per device category. Add { goal } for conversions.device · visitors · converters

Workflows worth stealing

Questions that take a dozen clicks in GA4 take one sentence here.

Find the leaky landing page

Which landing pages get over 500 visitors but bounce above 70%? Suggest one fix for each.

Your agent can open the page in your repo and look for the cause.

landing_pages

Judge a channel by signups

Rank channels by conversion rate to sign_up, not by visitors.

The goal filter turns a traffic report into an outcome report.

traffic_sourcesgoal_events

Check mobile before a launch

Do mobile visitors convert worse than desktop? By how much?

A gap here usually means a form or layout problem on small screens.

devices

Write the weekly traffic note

Summarize this week's traffic for every product in five lines.

query_metric and get_digest give the headline numbers; read_source adds the why.

web_analyticsget_digest

Notice a goal that stopped firing

Did any goal event drop by more than half compared with the 28 days before?

A sudden drop is often a broken tag, not a bad week.

goal_events

Pair search with sessions

For our top Search Console pages, how do those visitors behave once they land?

With Search Console connected too, your agent can join the two by page.

top_pageslanding_pages

Set it up in a few minutes

  1. 01

    Connect GA4. Start free, press Connect with Google, and pick the GA4 property for each product.

  2. 02

    In a terminal agent, run npx lopebase in a project folder. It signs you in and adds LopeBase to Claude Code, Codex, Gemini CLI, opencode, or Cursor Agent.

  3. 03

    In a chat app or editor, add the remote MCP server https://app.lopebase.com/api/mcp and sign in when it asks. Any client that supports remote MCP servers with sign-in works.

Using PostHog or Plausible as well? Connect both; each shows up as its own connection.

Good to know

  • Fixed windowsBreakdowns cover the last 28 days, and top pages the last 7. Custom date ranges are not offered yet.
  • Goals use your event namesPass the event exactly as GA4 records it, like sign_up or purchase. goal_events lists what is there.
  • Read onlyLopeBase never changes GA4 settings, audiences, or tags.
  • No visitor level dataAgents get counts and rates, never individual visitors or their details.

Google Analytics MCP questions

Something else? Email us.

Do I need a Google Cloud project to use the GA4 Data API?

No. Connect with Google handles access. You pick the properties; LopeBase calls the Data API for you when your agent asks.

Can I use Universal Analytics?

No. Google shut down Universal Analytics; LopeBase reads GA4 properties.

Will the numbers match the GA4 interface?

They come from the same Data API. Small differences can come from GA4's own thresholds and sampling, the same as in Explorations.

Can my agent compare several products?

Yes. Every GA4 property you connect is a separate connection. Ask about all of them at once.

Does it work with Claude in the browser?

Yes, if your plan lets you add custom connectors. Add https://app.lopebase.com/api/mcp and sign in.

Let your agent read GA4 for you.

Free for one product. No card. Agent access is on every plan.