Install browser analytics, conversions, performance monitoring, and crawler discovery without analytics cookies or personal profiles.
Create the website in Know first. Every website has an isolated site ID, an allowed domain, its own privacy controls, conversion goals, retention period, and integrations. No DNS verification is required.
Do not reuse a site ID on another domain. The collector validates the registered hostname and rejects events sent from unrelated websites.
Place the script once in the global site-wide head, immediately before </head>. The script is deferred, so it does not block the page from rendering.
<script defer data-site="YOUR_SITE_ID" data-api="https://collect.know.am/e" src="https://www.know.am/t.js"></script>Add one next/script component to the root app/layout.tsx. Do not place the tracker inside an individual route, dashboard component, or client navigation handler.
import Script from "next/script";
export default function RootLayout({ children }) {
return (
<html lang="en">
<body>{children}</body>
<Script
data-site="YOUR_SITE_ID"
data-api="https://collect.know.am/e"
src="https://www.know.am/t.js"
strategy="afterInteractive"
/>
</html>
);
}Know records the first pageview after the script loads and observes pushState, replaceState, and browser history changes for client-side navigation.
Send a custom event only after the business action succeeds. Know discovers new event names automatically in Advanced website settings → Conversion goals, where you can promote them to goals.
// Run only after the action succeeds.
window.know?.("signup_completed", { plan: "pro" });signup_completedtrial_startedpurchase_completedProperties may describe a plan, product, feature, or campaign, but never a person, credential, payment card, or sensitive action payload.
For a signup, fire after account creation returns success. For a purchase, prefer the trusted Stripe or RevenueCat webhook for revenue and use a browser event only for the confirmed product conversion.
The standard snippet samples Core Web Vitals automatically on 20% of page loads. Know stores the metric name, numeric value, and pathname without query strings.
The tracker loads a small performance module only for sampled visits. LCP, INP, CLS, FCP, and TTFB appear in the Core Web Vitals card.
Disable Web performance in Advanced settings, set data-web-vitals="false", or choose a sample rate from 0 to 1.
<script defer data-site="YOUR_SITE_ID" data-api="https://collect.know.am/e" data-web-vitals-sample="0.5" src="https://www.know.am/t.js"></script>AI assistants and search crawlers usually fetch raw HTML without running browser JavaScript. A small server-side middleware sends classified crawler requests to Know without delaying the response.
No second account is needed. Browser traffic uses /e; known crawler requests use /bot.
Send only the site ID, hostname, pathname, User-Agent, GET/HEAD method, and source. Know classifies but does not store the raw User-Agent.
// middleware.ts (Next.js 15) — merge with existing middleware logic
import { NextResponse, type NextFetchEvent, type NextRequest } from "next/server";
const crawlerHint = /bot|crawler|spider|chatgpt|gptbot|claude|perplexity|bing|google|applebot|bytespider|ccbot|duckassist|copilot|mistral|qwen|kimi|grok/i;
export function middleware(request: NextRequest, event: NextFetchEvent) {
const userAgent = request.headers.get("user-agent") || "";
if (["GET", "HEAD"].includes(request.method) && crawlerHint.test(userAgent)) {
event.waitUntil(fetch("https://collect.know.am/bot", {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({
site: "YOUR_SITE_ID",
domain: request.nextUrl.hostname,
path: request.nextUrl.pathname,
userAgent,
method: request.method,
source: "server_middleware",
}),
}).then(() => undefined).catch(() => undefined));
}
return NextResponse.next();
}
export const config = {
matcher: ["/((?!api|_next/static|_next/image|favicon.ico).*)"],
};Use event.waitUntil() in Next.js or Cloudflare Workers, after() when appropriate in supported Next.js runtimes, or a background task in your server framework. A fully static host cannot observe crawler requests; add a Worker, edge function, proxy, or backend.
Sign in and choose a website to replace all placeholders automatically.
Integrate Know privacy-first analytics into https://YOUR_WEBSITE_DOMAIN.
Configuration:
- Website domain: YOUR_WEBSITE_DOMAIN
- Know URL: https://www.know.am
- Site ID: YOUR_SITE_ID
- Tracking snippet: <script defer data-site="YOUR_SITE_ID" data-api="https://collect.know.am/e" src="https://www.know.am/t.js"></script>
- Event collector: https://collect.know.am/e
- Bot collector: https://collect.know.am/bot
- Configured conversion events: REPLACE_WITH_GOAL_EVENT_NAMES
Requirements:
1. Inspect the project before editing and identify its framework, global layout, existing analytics, middleware, authentication lifecycle, robots file, sitemap, tests, and deployment runtime.
2. Install the tracking snippet exactly once on every production page. For Next.js App Router, use next/script with strategy="afterInteractive" in the root layout. For a static site, place the snippet before </head>.
3. Preserve existing design and behavior. Do not install another analytics package or duplicate the Know script.
4. Fire configured conversion events with window.know?.("event_name", { nonSensitiveContext: "value" }) only after the underlying action succeeds.
5. If the product has authenticated accounts, call window.know?.("identify", { userId: stableInternalAccountId }) after login and whenever a full page load restores a session. Use an internal opaque ID, never an e-mail address or name.
6. Add or merge server middleware that filters known crawler User-Agents and sends a non-blocking POST to https://collect.know.am/bot. Include only site ID, registered hostname, pathname without query parameters, User-Agent, GET/HEAD method, and source=server_middleware.
7. Never forward cookies, IP addresses, query parameters, request bodies, authorization headers, or personal data. Know classifies the User-Agent and does not store the raw value.
8. Keep /robots.txt, /llms.txt, /llms-full.txt, sitemap XML, and public Markdown routes visible to crawlers. Exclude APIs, framework internals, images, fonts, CSS, and JavaScript assets.
9. If the site is completely static, install browser analytics and clearly report that bot tracking requires a Worker, edge function, middleware, proxy, or backend.
10. Run tests and a production build. Verify t.js loads once, POST https://collect.know.am/e returns 202 from YOUR_WEBSITE_DOMAIN, and a known crawler request produces a 202 from https://collect.know.am/bot.
Make the code changes now and summarize the result.Open the selected website's settings and choose Connect Google. Use a Google account that can read a verified Search Console property matching the registered domain.
Organic clicks, impressions, click-through rate, average position, and top queries for the active dashboard date range.
Know requests only webmasters.readonly. Disconnecting removes the stored connection; you can also revoke access from Google.
YOUR_WEBSITE_DOMAIN in Google Search Console.Choose Filters above the dashboard metrics to narrow KPIs, charts, breakdowns, Web Vitals, journeys, retention, and revenue together.
Filter by source, country, device, browser, campaign, page, or completed goal. Save a useful combination as a site-specific segment; the active state remains shareable in the URL.
Create a funnel from 2–6 ordered page or goal steps and choose how long a visitor has to complete it. The report follows the current date range, segment, and filters.
A later step counts only when the same anonymous visitor completed earlier steps in order within the selected window.
A navigation path appears only after at least three visitors follow it. Know never exposes individual visitor timelines.
Use precise paths such as /pricing and configured goal names such as signup_completed. Avoid query strings and one-off campaign URLs as funnel steps.
For products with authenticated accounts, identify the current internal account after login and whenever a full page load restores its session. This connects return activity to a privacy-safe server hash.
// Run after login and whenever a full page load restores the session.
window.know?.("identify", { userId: currentAccount.id });Day, week, or month zero is the account's first identified activity. Later columns show the percentage and count that returned in each completed period.
The stable ID is hashed before storage, cohorts under three users are hidden, and Strict mode disables identified retention completely.
Know creates a seven-day summary for every active website and warns when traffic, revenue, or goal conversions move beyond the selected threshold.
Open the dashboard bell, switch to notification settings, choose which alerts are active, and set the percentage threshold. Reports stay in the inbox and expire after 180 days.
YOUR_WEBSITE_DOMAIN.t.js loads exactly once.POST https://collect.know.am/e returns 202.POST https://collect.know.am/bot returns 202.403429