4 sites sent visitors for the first time
524 sessions came from four referrers that sent nothing in the previous 90 days. Most arrived from a single Hacker News thread about the late payments study.
Every Friday, the referring sites that sent sessions this week but none in the 90 days before, with the page they linked to and how engaged the visitors were.
Reads
You get
The card on the right is a sample. Yours shows your own numbers and updates in place every run.
What lands on your board
524 sessions came from four referrers that sent nothing in the previous 90 days. Most arrived from a single Hacker News thread about the late payments study.
A new referrer is some of the best news a site gets, and GA4 buries it. A forum thread, a newsletter mention or a chatbot answer citing your page shows up as one more row in Traffic acquisition, below sources that have been there for years.
The agent keeps a 90-day memory of who refers you and reports only the newcomers, with the referring URL when the browser passed one. SEO leads get link prospects; marketers find out which piece got shared, while the conversation is still going.
Call runReport for the last 7 days with the dimensions sessionSource and landingPagePlusQueryString, the metrics sessions and engagedSessions, and a dimensionFilter with an inListFilter on sessionMedium for referral and (not set). The second value catches tagged links from AI assistants, which often arrive without a medium.
Run one more report on sessionSource alone for the 90 days before this week, with the same filter. A source is new when it has sessions this week and none in that window.
Drop your own domains and subdomains, payment and login hosts (checkout.stripe.com, accounts.google.com), webmail and sources under 5 sessions. Payment hosts belong in the data stream's List unwanted referrals setting, so suggest adding them.
For each new source, run a report on pageReferrer with a beginsWith filter on that domain. Many sites send only their origin, so the full URL is a bonus, not a given.
One row per new source, biggest first: sessions, engaged sessions, the landing page and the referring URL when there is one. AI assistants such as chatgpt.com and perplexity.ai get their own line.
With BRIEFKIN_TOKEN set, the agent sends the result as one card that updates in place every run. Without it, you get the report in the chat.
Pick your agent, where the data comes from and how to schedule it; the commands below follow.
One command. It puts the SKILL.md in ~/.claude/skills and in ~/.agents/skills, which Codex, Cursor, Gemini CLI, Copilot CLI and OpenCode read too.
shellcurl -fsSL https://briefkin.dev/skills/google-analytics-new-referral-sources/install | shAsk Claude Code:
promptRun the google-analytics-new-referral-sources skillOr paste the prompt instead of installing:
promptIn my GA4 property (Analytics Data API), find referral sources that are new: sessionSource values with sessionMedium = referral (or (not set), where AI assistant links often land) that had sessions in the last 7 days and none in the 90 days before. Ignore my own domains, payment and login hosts (like checkout.stripe.com), webmail and anything under 5 sessions. For each new source list sessions, engaged sessions, the landing page (landingPagePlusQueryString) and the referring URL from pageReferrer if one was recorded. Call out AI assistants such as chatgpt.com or perplexity.ai separately, and suggest what to do about the biggest one.Fridays at 9:00, from cron on any machine where Claude Code is signed in:
crontab0 9 * * 5 claude -p "Run the google-analytics-new-referral-sources skill"Add it with crontab -e. A laptop asleep at that time runs it when it wakes if you use launchd or Task Scheduler instead; GitHub Actions works for the API route.
Connect Briefkin once with curl -fsSL https://briefkin.dev/install | sh and every run lands on your board as a report card. How setup works
SKILL.md---
name: google-analytics-new-referral-sources
description: "Every Friday, the referring sites that sent sessions this week but none in the 90 days before, with the page they linked to and how engaged the visitors were. Use when the user asks for this, or when it runs on a schedule."
---
# GA4 new referral sources
Every Friday, the referring sites that sent sessions this week but none in the 90 days before, with the page they linked to and how engaged the visitors were.
A new referrer is some of the best news a site gets, and GA4 buries it. A forum thread, a newsletter mention or a chatbot answer citing your page shows up as one more row in Traffic acquisition, below sources that have been there for years.
The agent keeps a 90-day memory of who refers you and reports only the newcomers, with the referring URL when the browser passed one. SEO leads get link prospects; marketers find out which piece got shared, while the conversation is still going.
## Two ways to get the data
Use the API or MCP route when you have an MCP server, a CLI or an API token for the app. Otherwise, if you can drive a browser the user is signed in to (Claude in Chrome, a Playwright or Chrome DevTools MCP server), use the browser route. Say which one you used.
## Route A: API or MCP server
### What you need
- Viewer access to the GA4 property you want watched.
- Analytics Data API access for the agent: an Analytics MCP server, a connector, or a Google Cloud service account added under Property access management.
If something is missing, say what and stop; do not invent numbers.
### Steps
1. **Pull this week's referrers** (Google Analytics): Call `runReport` for the last 7 days with the dimensions `sessionSource` and `landingPagePlusQueryString`, the metrics `sessions` and `engagedSessions`, and a `dimensionFilter` with an `inListFilter` on `sessionMedium` for `referral` and `(not set)`. The second value catches tagged links from AI assistants, which often arrive without a medium.
2. **Check who referred before** (Google Analytics): Run one more report on `sessionSource` alone for the 90 days before this week, with the same filter. A source is new when it has sessions this week and none in that window.
3. **Filter out the noise**: Drop your own domains and subdomains, payment and login hosts (`checkout.stripe.com`, `accounts.google.com`), webmail and sources under 5 sessions. Payment hosts belong in the data stream's List unwanted referrals setting, so suggest adding them.
4. **Find the referring page** (Google Analytics): For each new source, run a report on `pageReferrer` with a `beginsWith` filter on that domain. Many sites send only their origin, so the full URL is a bonus, not a given.
5. **Report the newcomers**: One row per new source, biggest first: sessions, engaged sessions, the landing page and the referring URL when there is one. AI assistants such as `chatgpt.com` and `perplexity.ai` get their own line.
## Route B: the browser
### What you need
- Signed in to Google with the Viewer role on the GA4 property; Viewers can create explorations but not change the unwanted referrals list.
If something is missing, say what and stop; do not invent numbers.
### Steps
Start at https://analytics.google.com/analytics/web/. The user is signed in already; never type passwords or codes, and ask if a sign-in page appears.
1. **List this week's referrers**: Pick the property, go to Reports > Acquisition > Traffic acquisition and change the primary dimension to `Session source / medium`. Set the date range to `Last 7 days`, type `referral` in the table search box and add `Landing page + query string` as the secondary dimension. Also search for `(not set)`, where tagged links from AI assistants often land.
2. **Export the last 90 days for comparison**: Change the date range to a custom range from 97 days ago to 8 days ago, keep the search, set Rows per page to the maximum and use Share this report > Download file. Any source in this week's list that is missing from this file is new.
3. **Filter out the noise**: Drop your own domains, payment and login hosts (`checkout.stripe.com`, `accounts.google.com`), webmail and sources under 5 sessions. Payment hosts belong under Admin > Data streams > your stream > Configure tag settings > Show more > List unwanted referrals.
4. **Look for the referring page**: Open Explore > Blank, add the dimension `Page referrer` and the metric `Sessions` for the last 7 days, and filter `Page referrer` contains each new domain. Many sites pass only their origin, so a full URL is a bonus.
5. **Report the newcomers**: One row per new source, biggest first: sessions, engaged sessions (add the column in the exploration), landing page and referring URL when there is one. `chatgpt.com`, `perplexity.ai` and `gemini.google.com` get their own line.
Note: The 90-day comparison is a visual diff of two tables, so it is the slow part; a download of the 90-day table keeps it manageable. Browsers usually send only the referring origin, so the referring URL is often just the domain in the UI too.
## The report
- **New referring sites** this week, ordered by sessions.
- For each: sessions, engaged sessions, the landing page and the referring URL where it was passed.
- **AI assistants** (chatgpt.com, perplexity.ai, gemini.google.com) called out when they appear.
- A suggestion for the biggest one, for example "Answer the questions in the Hacker News thread while it is still active".
## Post it to Briefkin
When `BRIEFKIN_TOKEN` is set, or `~/.config/briefkin/env` exists (the installer from https://briefkin.dev/docs writes it), also send the result to the user's Briefkin board as one card. Keep the `item_key` the same on every run so the card updates in place, use a new `event_id` per run, and put today's real numbers in place of the example ones. If the request fails, say so once and carry on.
```bash
[ -n "${BRIEFKIN_TOKEN:-}" ] || . ~/.config/briefkin/env
curl -sS -X POST "${BRIEFKIN_URL:-https://briefkin.dev}/v1/events" \
-H "authorization: Bearer $BRIEFKIN_TOKEN" \
-H "content-type: application/json" \
-d @- <<'JSON'
{
"v": 1,
"event_id": "google-analytics-new-referral-sources/<date of this run, e.g. 2026-10-16>",
"item_key": "google-analytics-new-referral-sources",
"project": "example.com",
"source": "GA4 new referral sources skill",
"kind": "update",
"title": "4 sites sent visitors for the first time",
"summary": "524 sessions came from four referrers that sent nothing in the previous 90 days. Most arrived from a single Hacker News thread about the late payments study.",
"widget": [
{
"type": "Table",
"props": {
"columns": [
"Source",
"Sessions",
"Engaged",
"Landed on"
],
"align": [
"left",
"right",
"right",
"left"
],
"rows": [
[
"news.ycombinator.com",
412,
236,
"/blog/late-payments-study"
],
[
"chatgpt.com",
58,
41,
"/templates/invoice-pdf"
],
[
"g2.com",
31,
22,
"/pricing"
],
[
"perplexity.ai",
23,
17,
"/blog/net-30-payment-terms"
]
]
}
},
{
"type": "Badges",
"props": {
"items": [
{
"label": "AI assistants: 2",
"tone": "info"
},
{
"label": "Filtered out: 3 hosts",
"tone": "neutral"
}
]
}
}
]
}
JSON
```
Widgets come from the Briefkin catalog (https://briefkin.dev/v1/catalog). Without a token, just give the user the report.
## Run it on a schedule
Suggested: Fridays at 9:00 (`0 9 * * 5`). From cron, with the agent signed in on that machine:
```bash
0 9 * * 5 claude -p "Run the google-analytics-new-referral-sources skill"
# Codex: codex exec, Gemini CLI: gemini -p, Copilot CLI: copilot -p, OpenCode: opencode run
```
Or use the agent's own scheduler (Claude Code routines, Codex automations, Claude or ChatGPT scheduled tasks): https://briefkin.dev/skills/google-analytics-new-referral-sources#schedule
Source: https://briefkin.dev/skills/google-analytics-new-referral-sources
Viewer access to the GA4 property you want watched.
Analytics Data API access for the agent: an Analytics MCP server, a connector, or a Google Cloud service account added under Property access management.
analytics-mcp on PyPI, source). It runs locally with pipx run analytics-mcp, offers run_report, run_realtime_report and get_account_summaries, and Google labels it experimental.GOOGLE_APPLICATION_CREDENTIALS at its JSON key. The skill also reads GA4_PROPERTY_ID.gcloud auth application-default login --scopes https://www.googleapis.com/auth/analytics.readonly,https://www.googleapis.com/auth/cloud-platform --client-id-file=client.json gives the MCP server or a script your user's access without a key file.Request only analytics.readonly and keep the service account at Viewer: none of these reports needs Editor.
By default browsers send only the referring site's origin to other sites (strict-origin-when-cross-origin), so GA4 records https://news.ycombinator.com/ rather than the thread. When the full URL is missing, the agent can search that site for your landing page to find the mention.
Often, as chatgpt.com / referral. ChatGPT also adds utm_source=chatgpt.com to many links, which can arrive as chatgpt.com / (not set), so the skill includes those rows. Clicks from the mobile apps sometimes come with no referrer and fall into Direct, so treat the count as a floor.
No. The skill runs with your own agent and gives you the report in the chat. With a Briefkin token set, each run also posts it to your board as a report card, so you can glance at it instead of asking again.
Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot CLI, OpenCode, Windsurf and Amp all read SKILL.md files. The install command puts it in ~/.claude/skills and ~/.agents/skills, where they look. ChatGPT, the Claude app and Grok take the prompt instead. Pick your agent under "Install and run it" and the commands change to match.
Yes. Switch the data source to "Your browser" and the steps change to the Google Analytics pages themselves: the agent opens analytics.google.com/analytics/web in a browser you are signed in to and reads the numbers off the page. Claude Code, Codex, Cursor, Claude app and ChatGPT can drive a browser out of the box; Gemini CLI, Copilot CLI and OpenCode need a Playwright or Chrome DevTools MCP server first. It is slower than the API and needs you signed in, so it suits a report you run by hand or from a scheduler on your own computer.
Skills are free to use with any agent. Briefkin is where their results land: one board for every report, number and question your agents send, with a ping when something needs you.
Free during the open beta. No card.