# Web analytics

URL: https://serpel.app/docs/web-analytics

Updated: 2026-11-05

Web analytics brings the visitors of your website into Serpel from PostHog, Plausible or Google Analytics 4. You connect a provider with a read-only key or sign-in, and Serpel shows visitors, sources, pages, a live view and conversions next to your rankings and search data. Conversions also feed opportunities, so Serpel can point at pages that get traffic but don’t convert.

## What is web analytics in Serpel?

Serpel doesn’t add a tracking script to your website and doesn’t replace your analytics tool. It reads the numbers that your tool already collects and puts them beside [rank tracking](https://serpel.app/docs/rank-tracking) and [search data](https://serpel.app/docs/search-data). That answers a question neither tool answers alone: which of the visitors you win from search actually do something on your site? Reading web analytics costs no credits.

**How web analytics reaches Serpel**

1. **Connect** (Read-only): Add a key or sign in with Google. Serpel stores the credentials encrypted.
2. **Read**: Visitors, pageviews and sources come straight from your provider.
3. **Choose conversions**: Pick the events that count as a success, for example a sign-up.
4. **Sync**: A daily sync matches sessions and conversions per entry page.
5. **Act**: Opportunities flag pages that need attention.

## How do you connect PostHog, Plausible or Google Analytics 4?

Connect once for your whole account under **Settings → Integrations**, or for one project with **Connect** on the **Web analytics** page. The account route matches the projects that you own to their own sites. The project route is for a single project, and it is the only route for one where you are an editor. Owners and editors can connect, viewers can’t. A project can have all three providers at the same time, and a switch at the top of the page (**PostHog**, **Plausible**, **Analytics 4**) chooses which one you look at.

**What each provider needs**

- **PostHog** (Personal API key): **Region:** **EU Cloud** (eu.posthog.com), **US Cloud** (us.posthog.com) or **Custom instance** for self-hosting. **Project ID:** digits only, from the PostHog project settings. **Personal API key** with the scope “Query: Read”. Serpel counts `$pageview` events, so page view capture must be on.
- **Plausible** (Stats API key): **Site ID:** the domain exactly as registered in Plausible. **API key** of the type “Stats API”, created under Account, API keys. **Custom instance** (optional) for self-hosting. The default is https://plausible.io.
- **Google Analytics 4** (Google sign-in): Sign in with **Connect with Google** and approve read access to Analytics. Serpel picks the property whose web data streams match your domain. If none matches, choose the **Property** under **Manage**. **Refresh list** reloads the properties.

On the account cards, PostHog needs only the region and a personal key with “Query: Read” and “Project: Read” (plus “Organization: Read” for several organisations), and Serpel matches projects by domain or name. Plausible needs the Stats API key and checks each project domain as a site ID. Google uses the same sign-in as [search data](https://serpel.app/docs/search-data). A self-hosted address must start with `https://` and have no path, for example `https://analytics.example.com`.

1. **Open Web analytics in a project.** Pick the provider in the switch at the top and press **Connect**.

2. **Enter the details.** Fill in the fields from the table above and press **Connect** again. Serpel checks access before it saves.

3. **Check the badge.** A **Connected** badge appears. Click it to open **Manage**, where you can change the property, set conversions or disconnect.

Only the person who created a Google Analytics connection can change its property. If the page says “Does the property match?”, the chosen property measures another domain than the project.

## What does the web analytics page show?

The toolbar has the provider switch, the period (**Last 7 days**, **Last 28 days** as the default and **Last 3 months**, which is 90 days), **All traffic** or **Organic only**, and **Export**. Six figures lead the page: **Visitors**, **Pageviews**, **Sessions**, **Bounce rate**, **Avg. duration** and **Pages per session**, each compared with the previous period. Below them, cards hold the details:

- **Locations:** **Countries**, **Regions** and **Cities**, next to a globe card with the live view.
- **Sources:** **Channels**, **Referrers**, **UTM** values and **Search engines**. Google doesn’t pass the search query, so Serpel takes it from Search Console.
- **Pages:** **Top pages**, **Entry pages**, **Exit pages**, **Folders** and **Gainers and losers**. Click a page to see its visitors, Search Console queries, tracked keywords, audit issues and AI citations in one panel.
- **Devices:** **Devices**, **Browsers**, **OS** and **Screen size**.
- **Conversions:** **Conversion rate** and **Conversions** per entry page, plus **By campaign**, **By source** and **By channel**. It appears after you chose conversion events.

Serpel sorts visits into the channels **Organic search**, **Direct**, **Social**, **Referral**, **Email**, **Paid** and **AI assistants**. Visits from ChatGPT, Perplexity, Gemini, Copilot and Claude land in the last one, so you can see how much traffic AI answers send you (see [AI visibility](https://serpel.app/docs/ai-visibility)). Click a row that isn’t a page, such as a country, channel or device, to filter the whole page, with up to 10 filters at once. **Organic only** keeps only visits from search engines.

> **Not every provider reports everything:** Google Analytics 4 has no exit pages. Plausible reports device classes but no screen sizes. PostHog reports locations only when GeoIP enrichment is on in the project. A card that a provider can’t fill says so instead of showing zeros.

## How does the live view work?

On the globe card next to **Locations**, the toggle **Visitor view** switches between **Live** and **Period**. **Live** shows the visitors of the last 30 minutes on the globe and refreshes about every 20 seconds while the browser tab is visible. PostHog also reports exact positions and the 20 latest visits. Plausible and Google Analytics 4 report the number of visitors and their cities, without coordinates and without single visits.

## How do you set up conversions?

1. **Open Manage.** Click the **Connected** badge on the Web analytics page. For Google Analytics, choose the property first.

2. **Choose the events.** The **Conversions** section lists the events from the last 30 days. Tick up to 10 that count as a success, or type a name under **Add an event name manually**. Generated events such as page views aren’t offered.

3. **Press Save.** Serpel answers “Conversions saved, the first sync is running”. The numbers appear after a few minutes.

**How the conversion rate of an entry page is calculated:** Conversion rate = Sessions that start on the page and trigger a chosen event ÷ Sessions that start on the page

- **Sessions that start on the page and trigger a chosen event**: Counted per entry page.
- **Sessions that start on the page**: All sessions with this entry page.

The **Conversion rate** list shows only entry pages with at least 10 sessions. The **By campaign**, **By source** and **By channel** tabs show the share of visitors who triggered an event, for groups with at least 10 visitors. Changing the property or the chosen events rebuilds the stored history.

## How often does Serpel sync web analytics and how long is it kept?

Visitors, pageviews and sources are read from your provider when you open the page, and Serpel reuses a result for 30 minutes. The live view is cached for seconds only. Only conversion data is stored over time, and the numbers below apply to that history.

- **90** days imported first: After you choose events.
- **23** hours between syncs: Runs in the background.
- **3** days refreshed per sync: Late data is picked up.
- **16** months kept: Disconnecting deletes it.

Every sync shows up as **Web analytics sync** under **History** (see [history and exports](https://serpel.app/docs/history-and-exports)). Without chosen events there is nothing to sync, and the entry says so.

## How does web analytics feed opportunities?

Two of the rules in [opportunities](https://serpel.app/docs/opportunities) use your conversion data, and both need chosen events. **Visitors who don’t convert** flags a page with at least 30 sessions, more sessions than the median page and a conversion rate below half the project median. If Search Console is connected, the page also needs search clicks. **Strong page with low reach** flags a page with at least 20 sessions and 2 conversions that converts at more than twice the median rate but gets fewer search impressions than the median page, so it needs Search Console data as well. Analytics also names itself as a data source on the opportunities it supports.

## How do you export web analytics data?

**Export** at the top right offers **Daily history**, **Countries**, **Channels**, **Top pages**, **Devices** and, when conversions exist, **Conversions by campaign**. Each file is a semicolon-separated CSV with a UTF-8 byte order mark, named like `web-analytics-daily-2026-11-05.csv`.

## How do you use web analytics from the CLI, API or MCP?

The [CLI](https://serpel.app/docs/cli) and the [REST API](https://serpel.app/docs/api) cover connecting, reading and conversions. Reading needs the scope `projects:read`, connecting and choosing conversions needs `projects:write`. `--days` takes 7, 28 or 90, and `--filter` takes values such as `channel:Direct`. Rows go up to 100 per call, and `serpel analytics movers` lists pages that gained or lost at least 3 visitors by default.

```bash
serpel analytics status --project "$PROJECT_ID"
serpel analytics connect-posthog --project "$PROJECT_ID" --posthog-project 12345 --api-key-file posthog.key --region eu
serpel analytics connect-plausible --project "$PROJECT_ID" --site-id example.com --api-key-file plausible.key
serpel analytics connect-google --project "$PROJECT_ID"
serpel analytics events --project "$PROJECT_ID" --provider posthog
serpel analytics set-conversions --project "$PROJECT_ID" --provider posthog --event signup_completed --event purchase
serpel analytics report --project "$PROJECT_ID" --days 28
serpel analytics breakdown --project "$PROJECT_ID" --dimension channel --organic-only
serpel analytics movers --project "$PROJECT_ID" --dimension pagePath
serpel analytics live --project "$PROJECT_ID"
serpel analytics conversions --project "$PROJECT_ID"
```

```bash
curl "https://serpel.app/api/v1/projects/$PROJECT_ID/analytics-report?provider=posthog&days=28" \
  -H "Authorization: Bearer $SERPEL_TOKEN"

curl "https://serpel.app/api/v1/projects/$PROJECT_ID/analytics/posthog/breakdown?dimension=channel&days=28&organicOnly=true" \
  -H "Authorization: Bearer $SERPEL_TOKEN"

curl -X PUT https://serpel.app/api/v1/projects/$PROJECT_ID/analytics/posthog/conversion-events \
  -H "Authorization: Bearer $SERPEL_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"events": ["signup_completed", "purchase"]}'
```

The MCP tool `get_conversion_performance` returns sessions, conversions and conversion rate per landing page for the events you chose, plus the median rate, at most 25 pages per call. Without a connection or chosen events, it explains what to set up. See the [MCP setup for Claude Code](https://serpel.app/docs/mcp/claude-code).

## Where to go next

- [Opportunities](https://serpel.app/docs/opportunities): See which pages to fix first, now with conversion data.
- [Search data](https://serpel.app/docs/search-data): Add clicks and impressions from Google and Bing.
- [AI visibility](https://serpel.app/docs/ai-visibility): Find out which AI answers cite you and send visitors.
- [CLI](https://serpel.app/docs/cli): Script every analytics command.