plausible
БесплатноБез исполняемых скриптовНе проверенPlausible is a privacy-first, cookie-free web analytics service that you can self-host (Community Edition) or use as Plausible Cloud. Covers the tracking…
от TerminalSkills★ 221 звезда на GitHubОб этом скилле
Plausible Analytics
Overview
Plausible is an open-source, cookie-free web analytics tool. It collects no personal data, so most sites need no consent banner. It runs as a hosted service (Plausible Cloud, plausible.io) or as the self-hosted Community Edition (CE, backed by ClickHouse and PostgreSQL).
Two things changed since older tutorials. The tracking snippet is now a per-site script pa-XXXXX.js initialised with plausible.init(); the old data-domain scripts with extension filenames such as script.hash.outbound-links.js are legacy. The Stats API is POST /api/v2/query; the GET /api/v1/stats/* endpoints in old guides belong to the previous generation. On Cloud, custom properties, revenue tracking, funnels and the Stats API need the Business plan. The self-hosted CE has custom properties, the Stats API and the Events API, but not marketing funnels, user journeys, ecommerce revenue goals, SSO or the Sites API (Plausible's CE comparison page lists these as unavailable); revenue tracking is therefore Plausible Cloud only.
Instructions
1. Install the snippet
Add the site in Plausible, then copy the snippet from Site settings, General, Tracking, Site installation. The pa- id is unique to your site, so never invent one. On CE the script is served from your own BASE_URL.
<!-- index.html, inside <head> -->
<script async src="https://plausible.io/js/pa-Xq3mB7vLk2.js"></script>
<script>
window.plausible=window.plausible||function(){(plausible.q=plausible.q||[]).push(arguments)},plausible.init=plausible.init||function(i){plausible.o=i||{}};
plausible.init()
</script>
Outbound links, file downloads and form submissions are switched on in the site settings (Default tracking) and need no snippet change. Options that live in the snippet go to plausible.init({...}): hashBasedRouting, customProperties, endpoint, captureOnLocalhost (off by default, so nothing is recorded on localhost), autoCapturePageviews, transformRequest.
For bundled apps use the npm package @plausible-analytics/tracker (the old plausible-tracker is archived). It works only in the browser, so call it from client code:
npm install @plausible-analytics/tracker
// src/analytics.js
import { init, track } from '@plausible-analytics/tracker'
init({ domain: 'bluefinbikes.com' }) // SPA pageviews are captured automatically
track('Signup', { props: { tier: 'startup' } })
2. Custom events and goals
An event shows in the dashboard only after you create a goal with the same name (Site settings, Goals, Add goal, Custom event).
Without JavaScript, add a CSS class to the element; a space in the name is written +:
<button class="plausible-event-name=Newsletter+Signup">Subscribe</button>
From JavaScript, with the snippet installed:
plausible('Purchase', {
props: { plan: 'pro' }, // custom properties
revenue: { amount: 49.0, currency: 'USD' }, // Cloud only: needs a revenue goal, not in CE
})
Never put personal data (emails, names, user ids) into properties; individual values cannot be deleted later.
For server-side events, call the Events API directly. Forward the visitor's User-Agent and IP, because they decide unique-visitor counting:
curl -i -X POST "$PLAUSIBLE_HOST/api/event" \
-H "User-Agent: $VISITOR_USER_AGENT" \
-H "X-Forwarded-For: $VISITOR_IP" \
-H "Content-Type: application/json" \
--data '{"name":"Newsletter Signup","url":"https://bluefinbikes.com/blog","domain":"bluefinbikes.com"}'
A 202 means the event was accepted; it still appears only if a goal with that name exists. If bot filtering dropped the event (for example you forwarded a server or CDN IP instead of the visitor's), the API still answers 202 but adds the response header x-plausible-dropped: 1. The optional revenue field is ignored on CE, which has no revenue goals.
3. Next.js
next-plausible 4.x takes the script URL from the dashboard (earlier versions took domain):
// app/layout.tsx
import PlausibleProvider from 'next-plausible'
export default function RootLayout({ children }: { children: React.ReactNode }) {
return (
<html lang="en">
<body>
<PlausibleProvider src="https://plausible.io/js/pa-Xq3mB7vLk2.js">
{children}
</PlausibleProvider>
</body>
</html>
)
}
// components/pricing-button.tsx
'use client'
import { usePlausible } from 'next-plausible'
type Events = { 'Plan Selected': { plan: string; price: number } }
export function PricingButton({ plan, price }: { plan: string; price: number }) {
const plausible = usePlausible<Events>()
return <button onClick={() => plausible('Plan Selected', { props: { plan, price } })}>Choose {plan}</button>
}
The provider renders the script only in production builds. To proxy through your own domain, wrap the config in next.config.js: `module.exports = withPlaus
Установить plausible в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл plausible?
Plausible is a privacy-first, cookie-free web analytics service that you can self-host (Community Edition) or use as Plausible Cloud. Covers the tracking snippet, custom event goals, the Next.js integration, a first-party proxy, self-hosting with Docker Compose and the Stats API v2. Use when the user wants website analytics without cookie banners, a Google Analytics replacement, or traffic data pulled through an API.
Как установить скилл plausible?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл plausible запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic