Documentation

Everything you need to go from zero to revenue-by-source in a few minutes. Stuck? Contact us.

Quick start

  1. Create an account and add your website's domain.
  2. Copy the snippet from your site's settings and paste it inside the <head> of every page.
  3. Open your dashboard. Your first visit shows up within seconds, and the setup screen confirms the install automatically.
<script defer src="https://cleverpilot.io/t.js" data-site="YOUR_SITE_ID"></script>

The script is about 1KB gzipped, loads with defer, and sets no cookies. It tracks pageviews (including single-page-app navigation), button and link clicks, and outbound links automatically.

Goals & automatic tracking

Open your dashboard's Goals tab and ask a question, for example “Which case study do visitors click the most?” or “Which sections do people actually see?”. Cleverpilot turns it into a small tracking plan, shows you exactly what it will track, and switches it on when you click Activate tracking. There's no code to change and nothing to redeploy.

How it works: when a plan is active, the script receives a few rules with each page view (for example “clicks on links containing /case-studies/” or “sections scrolled into view”) and records those interactions with a readable label: the element's data-gs-label, its heading, its id, or its text. To tailor plans to your real pages, the script sends a one-time outline of the page structure (headings, section ids, link paths and button text). It never includes anything visitors type.

Prefer explicit labels? Use data attributes

Add attributes to any element and they're tracked automatically. Every plan also generates a prompt you can paste into Lovable, Bolt, v0 or Cursor to add them for you.

<a href="/work/fintech" data-gs="case_study_click" data-gs-label="Fintech app">…</a>
<section id="pricing" data-gs-view="section_view" data-gs-label="Pricing">…</section>

Install guides

Next.js (App Router)

// app/layout.tsx
import Script from "next/script";

export default function RootLayout({ children }) {
  return (
    <html lang="en">
      <body>
        {children}
        <Script defer src="https://cleverpilot.io/t.js" data-site="YOUR_SITE_ID" strategy="afterInteractive" />
      </body>
    </html>
  );
}

React / Vite / Vue / Svelte

Add the snippet to index.html inside <head>. Client-side route changes are picked up automatically.

WordPress

Use any “insert headers and footers” plugin (or your theme's header.php) and paste the snippet into the header section.

Shopify

Go to Online Store → Themes → Edit code, open theme.liquid and paste the snippet just before </head>.

Webflow / Framer

Open Site settings → Custom code and paste the snippet into the Head code field, then publish.

Google Tag Manager

Create a Custom HTML tag with the snippet, trigger it on All Pages, and publish the container.

Custom events

Track any action with one call. Properties are optional (up to 1KB of JSON).

cleverpilot("signup");
cleverpilot("purchase", { plan: "growth", amount: 99 });

Button and link clicks are captured automatically using the element's text, so you often don't need custom events at all.

Goals & funnels

In Site settings → Goals, turn any custom event or page visit into a goal. The dashboard shows unique conversions and conversion rate for the selected period and filters.

Funnels are ordered steps, one per line, for example:

page:/
page:/pricing
event:signup
event:purchase

Each step counts visitors who completed all previous steps in order, so you can see exactly where people drop off.

Revenue attribution

The script exposes an anonymous visitor ID as window.cleverpilot.vid. Pass it into checkout as cleverpilot_vid metadata, then add the webhook URL shown in your site settings to your payment provider.

Stripe

// Browser: send the visitor id with your checkout request
fetch("/api/checkout", { method: "POST", body: JSON.stringify({ vid: window.cleverpilot?.vid }) });

// Server (Node): add it to the Checkout Session
const session = await stripe.checkout.sessions.create({
  mode: "subscription",
  line_items: [{ price: "price_123", quantity: 1 }],
  success_url: "https://yoursite.com/thanks",
  metadata: { cleverpilot_vid: body.vid },
  subscription_data: { metadata: { cleverpilot_vid: body.vid } }, // renewals too
});

Webhook events: checkout.session.completed and invoice.paid. Copy the signing secret into Cleverpilot.

Paddle

Paddle.Checkout.open({
  items: [{ priceId: "pri_123", quantity: 1 }],
  customData: { cleverpilot_vid: window.cleverpilot?.vid },
});

Webhook event: transaction.completed.

Polar

Add metadata: { cleverpilot_vid } when creating the checkout. Webhook event: order.paid.

Every webhook is verified with your signing secret and de-duplicated, so retries never double-count.

In site settings, click Connect Google and approve read-only Search Console access. We match your domain property automatically (or you can set it). For Bing, paste an API key from Bing Webmaster Tools. Data syncs daily and appears in the Search tab with week-on-week movers.

Sharing

Create a read-only share link in site settings and send it to anyone, with no login needed. You can revoke it anytime. To serve it on your own domain (e.g. stats.yoursite.com), add a CNAME to cleverpilot.io and enter the domain in settings. From the Events tab you can also share the click stats for a single outbound link, which is handy for sponsors.

Ask AI & digests

The Ask AI tab answers questions about your data in plain English and draws charts. It can only read aggregated stats for your own sites, never raw data from anyone else. Digests (daily, weekly on Mondays, or monthly on the 1st) summarize what changed and go to every team member; set the frequency in site settings.

Privacy & data

  • No cookies, localStorage or fingerprinting.
  • Visitors are counted with sha256(daily salt + site + IP + user agent). The salt is deleted every day, so IDs can't be linked across days or reversed.
  • IP addresses are never stored. Location comes from edge headers and is rounded to about 10km.
  • Bots and crawlers are filtered out. Hits from domains other than yours are ignored.
  • Data is kept for 3 years, then deleted automatically. You can delete a site and all its data anytime.

Self-hosting

With a self-hosted license you can run the full product on your own infrastructure with Docker and Postgres, with no quotas or billing:

cp .env.example .env      # set APP_URL, AUTH_SECRET, CRON_SECRET, LICENSE_KEY
docker compose up -d

Contact us for a license.