SLAY SCHOOL · AI SEO ANALYTICS · GA4 · SEARCH CONSOLE

AI SEO analytics for a language school.

We put Google Analytics 4 and Search Console inside the admin panel of myslayschool.com, the website of Slay School in Odesa, and added an AI that reads them. One click on “Suggest improvements” turns the site’s whole search history into a plan: which topics to grow, which pages to create, which titles to fix, for about $0.006 a run.

Client
Slay School, Odesa
Our role
Tracking, dashboard, AI advice
Data
GA4, Search Console, OpenRouter
How one AI SEO advice gets written
“Suggest improvements”
queued as a job; the admin can close the tab
Search Console + site map
all weeks, queries, pages and every existing post
A cheap model · strict JSON
Claude Haiku 5.5 by default, price capped on the server
A plan for the week
topics, new pages, fixes, quick wins; saved per week
0.6¢
per AI advice on Haiku 5.5
180
search queries per prompt
12
AI assistants tracked in GA4
$1
cap per 1M output tokens
1
day, weekly report to AI advice
0
chart or Google SDK libraries

The problem

Two Google dashboards, and no analyst to read them.

The site has three languages, a growing set of free learning pages and a blog that adds posts every day. Search Console lists the queries that find it, GA4 lists what visitors do next, and neither says what to write or fix next week. The school is run by teachers. Generic SEO tools give generic checklists; what the school needed was advice that knows its own pages, its own queries and what it sells.

The rule we set

Code picks the data. AI reads it. A person decides.

The numbers come straight from Google’s APIs, never from the model. The AI gets a fixed slice of them and has to name the real queries, impressions and positions behind every recommendation, or say the data is too thin. Its answer is a schema-checked JSON object shown in the admin panel; nothing on the site changes until someone acts on it.

GA4 and Search Console in the admin panel.

Four tools on the same data, all inside the panel the school already uses for leads, events and payments. Nobody has to open Google Analytics.

Analytics dashboard

  • 7, 28 or 90 days against the days before
  • Visitors, Google clicks and impressions by day
  • Channels, countries, leads and payments

AI assistant traffic

  • ChatGPT, Perplexity, Gemini, Claude and more
  • Share of all sessions, day by day
  • Which pages each assistant sends people to

Weekly report

  • Every Monday, to the school’s admins
  • GA4 and Search Console against last week
  • Queries almost in the top, positions 4–15

AI SEO advice

  • Search Console week by week
  • New pages, fixes and quick wins
  • Kept per week, regenerated in one click

The dashboard shows the last 7, 28 or 90 days against the same number of days before: headline tiles with the change, line charts of visitors, Google clicks and Google impressions by day (this period against the last, with a table under each), channels and countries as bars, and tables of events, landing pages, search queries and the queries just below the top. Charts are plain SVG drawn in the browser; the data is cached for an hour, and “Refresh” reads Google again.

The Worker talks to Google with a service account and a JWT it signs itself with the Web Crypto API, so there is no Google SDK in the bundle. The account is read-only: a Viewer in GA4, a restricted user in Search Console.

Revenue is in GA4 too. Once the bank confirms a payment, the server sends a purchase event through the Measurement Protocol, tied to the visitor who paid, so income shows up by channel and campaign. The school’s own test payments are left out.

Every Monday the admins get the same picture by email: visitors, channels, AI assistants, leads, payments and level tests from GA4; clicks, impressions, queries, pages and “almost in the top” from Search Console, each against the week before.

AI SEO advice from real search data.

The search page of the panel shows one week of Search Console (clicks, impressions, CTR and position against the week before) with a week switcher. Under it, “Suggest improvements” sends the model everything below, rebuilt from Google on every run.

Weeks
Since day one

Clicks, impressions and average position for every week since the site was added to Search Console.

Queries
Top 180

Ranked by impressions, each with clicks, CTR and average position.

Pages
Top 90

The same metrics per URL, so the model sees which pages carry the site.

Query → page
Top 160 pairs

Which page Google shows for which query: the only way to spot two pages competing for one search.

Countries, devices
12 countries

Where the clicks come from and on what, for a school that teaches in Odesa and online worldwide.

The site itself
Every page and post

The sitemap and all blog posts with their titles, so the model never proposes a page that already exists.

The system prompt describes the school: what it sells (courses, a tutor format, exam preparation, paid self-study mini-courses), that the site’s main goal is a lead for a free trial lesson, and that every page exists in Ukrainian, Russian and English. Then the rules: every point must come from the data; never propose a page that already exists, improve it instead; watch for two pages competing for one query.

Two rules of thumb are written in, so the model does not invent its own: a page with impressions but no clicks at positions 1–10 needs a better title and description; at 11–30 it needs content and internal links. Pages that lead to a trial lesson, a course or a mini-course come first.

The answer is checked in code. Fewer than three new pages or two topics goes back to the model once with the problem named. The latest advice of each week is kept, so the admin can come back to it; “Regenerate” replaces it.

The advice, as a schema
  • summary: 2–4 sentences, honest about thin data
  • topics: 3–7 to grow, each with real queries
  • newPages: 4–10, title, address, language, type, target queries, path to a lead, priority
  • improve: 3–8 existing pages, issue, action, new title
  • quickWins: 3–6 things for this week
  • language: Ukrainian; page titles in the page’s own

Cheap models only, enforced on the server.

The model is a list in the panel, loaded by the browser straight from OpenRouter’s catalogue: only models that answer in JSON, cost at most $0.50 per million input tokens and $1 per million output tokens, and are not free, because free models hit their limits on this much data. Next to each is what one advice would cost, for about 15,000 tokens in and 8,000 out. With Claude Haiku 5.5 ($0.10 / $0.50) that is about $0.006. Claude Sonnet 5.5, at $2 / $10, was tried and taken off the list.

The server checks the price again, against OpenRouter’s providers for that model, before a job is queued and before it runs, so a dearer model cannot get in another way.

Thinking models spend part of their token limit on reasoning: Sonnet’s first answer was cut off at 12,000 tokens. The advice may now use up to 32,000, or the smallest limit among the model’s providers if that is lower, and an answer cut off by the limit is caught instead of saved half-written.

AI that works while the tab is closed.

An advice usually takes one to three minutes, too long to keep a browser request open. So the button only queues a job in D1, and a Cloudflare cron that runs every minute picks it up and writes the advice, with up to 15 minutes per call.

While it works, every page of the admin panel shows a bar under the menu: queued, then writing, then “ready, open” or what went wrong with a retry button. The week’s page shows the advice by itself once it is written.

A job whose Worker was cut off (12 minutes without finishing) is taken again once, then marked as failed with the reason. Clicking twice for the same week returns the job already running instead of paying for a second one.

Tracking ChatGPT and Perplexity traffic in GA4.

People now find a school by asking an assistant. The dashboard counts those visits by GA4’s session source: the site the visitor came from (perplexity.ai, gemini.google.com, claude.ai) or the utm_source=chatgpt.com that ChatGPT adds to its links. Twelve assistants are matched by one list in the code: ChatGPT, Perplexity, Gemini, Copilot, Claude, DeepSeek, Grok, Mistral and Meta AI by name, You.com, Phind and Poe as “other AI”. A new assistant is one more line.

The tab shows the total against the period before, its share of all sessions and how many were engaged, a chart by day, a bar per assistant and the landing pages each one sends people to. The weekly email carries the same numbers.

What it cannot see is written on the page, not hidden. Apps that open a link without saying where it came from land in Direct, so the real count is a little higher. A mention without a click is not in GA4 at all: Google counts AI Overviews and AI Mode inside Search Console, Copilot reports in Bing Webmaster Tools, and which AI crawlers read the site is in Cloudflare.

The same honesty runs through the level-test funnel added on November 2: from starting a free level test to a mini-course day and a payment, each step counting only the people who did the steps before it.

Numbers people read right.

An AI is only as good as the data it is given, and a dashboard only as good as how it is read.

Clean data

Automated browsers and the school’s own staff are left out of GA4, so the numbers describe visitors, not teachers checking pages.

Dated data

GA4 runs to yesterday, Search Console 2–3 days behind. Every chart and table says which day its numbers cover.

Places, not %

A rank from 35.1 to 16.1 used to read “−54 %”, like a drop. It now says “19 places higher”.

Scoped keys

Google and OpenRouter keys live in Worker secrets. The Google account can read reports and nothing else.

Weekly report to AI advice in one day.

The report, the dashboard and the first AI advice all went live on October 28; the rest followed within a week, each part as soon as it worked. Dates from the commit history, 2026.

  1. Oct 11
    Site added to Search Console

    The first day of the history the AI reads.

  2. Oct 12
    GA4 starts collecting

    The dashboard’s charts start on this day.

  3. Oct 28
    Weekly report and GA4 revenue

    Monday email; payments sent to GA4 from the server.

  4. Oct 28
    Analytics tab in the admin panel

    GA4 and Search Console for 7, 28 or 90 days, drawn in plain SVG.

  5. Oct 28
    AI SEO advice

    A week of Search Console, then “Suggest improvements”.

  6. Oct 28
    Background jobs, cheap models only

    The AI writes while the admin closes the tab.

  7. Oct 30
    Visits from AI assistants

    In the dashboard and the weekly email.

  8. Nov 2
    Level-test funnel

    From a free level test to a paid mini-course, step by step.

  9. Nov 3
    Ranks in places, “as of” dates

    Every chart and table says which day its numbers cover.

The analytics stack,
by layer.

Data
  • GA4 Data API
  • Search Console API
  • Measurement Protocol
  • Service-account JWT
  • Hourly cache in D1
AI
  • OpenRouter API
  • Claude Haiku 5.5
  • Any cheap model
  • zod → strict JSON
  • Price check on server
Platform
  • Cloudflare Workers
  • Cloudflare D1
  • Cron every minute
  • Monday report cron
  • Astro 7
Admin UI
  • Plain SVG charts
  • 7 / 28 / 90 days
  • Week switcher
  • AI status bar
  • Tables on phones
Reports
  • Weekly email
  • AI assistant sessions
  • Level-test funnel
  • Almost in the top
  • “As of” dates

AI SEO analytics, answered.

The same site’s AI blog, event writer and student coach are in the Slay School AI integration case study. The rules behind this build (a schema on every answer, a cost ceiling on every call, jobs that retry) are how we deliver AI workflow automation for any team.

Can AI give SEO recommendations from Google Search Console data?

Yes, if it gets the data in a form it can reason about and is told to use nothing else. Here the site sends the model its whole Search Console history (weekly totals, the top 180 queries, the top 90 pages, which page ranks for which query, countries and devices) plus a list of every page and post on the site. The model must name the real queries, impressions and positions behind each point, and say so when the data is thin.

How much does one AI SEO analysis cost to run?

About $0.006 with Claude Haiku 5.5 through OpenRouter, for roughly 15,000 tokens in and 8,000 out. The admin can pick another model, but only from those priced at most $0.50 per million input tokens and $1 per million output tokens; the server checks the price again before the job is queued and before it runs.

How do you track traffic from ChatGPT, Perplexity and Gemini in GA4?

By the session source. A visit counts as an AI assistant visit when its source matches one of 12 assistants (chatgpt.com through the utm_source ChatGPT adds to its links, perplexity.ai, gemini.google.com, claude.ai and others). The dashboard shows the total against the period before, its share of all sessions, a chart by day and the pages each assistant sends people to. Apps that open links without a referrer land in Direct, so the real number is a little higher, and the page says so.

Does the AI change the website by itself?

No. The advice is text in the admin panel: topics to grow, new pages with a title, address and target queries, existing pages to fix with a better title, and quick wins for the week. A person decides what to do with it. Google access is read-only: the service account is a Viewer in GA4 and a restricted user in Search Console.

Why build analytics into the admin panel instead of using Looker Studio?

Because the numbers the school acts on live next to its own data. Payments are sent to GA4 from the server once the bank confirms them, the level-test funnel joins GA4 events with the site’s own records, and the AI advice needs the site’s page list to avoid proposing what already exists. A dashboard inside the panel also opens in one click for people who never log in to Google Analytics.

Which AI model writes the advice, and can it be changed?

The default is Claude Haiku 5.5 through OpenRouter, the same model the site uses for its blog. The model list in the panel comes from OpenRouter’s catalogue, filtered to models that answer in JSON, are not free (free models fail on this much data) and stay under the price cap, with what one advice would cost next to each.

How long did it take to build?

The weekly report, the analytics tab and the first AI advice shipped on the same day, October 28, 2026. Visits from AI assistants followed two days later and the level-test funnel on November 2. Each part went live on its own as soon as it worked.

Can you add AI analytics like this to our website?

Yes. It needs GA4, Search Console and a server that can call their APIs, not a particular stack. We start with the Diagnose step: which numbers your team acts on, which decisions the AI should help with, and what each call may cost. Then we build only the parts that pay off, at a fixed price.

Want AI that reads your analytics and says what to fix?

Fixed price · Fixed scope · Senior only

2 client slots open