Custom events
Custom events record actions that are not pageviews — button clicks, signups, downloads, video plays. They power funnels and add depth to AI Page Insights.
Script tag
If you installed the script snippet, Antlytics.track() is available globally after the tracker loads:
<button onclick="Antlytics.track('waitlist_signup', { plan: 'pro' })">
Join the waitlist
</button>
Next.js / npm SDK
The <Analytics /> component exposes window.antlytics.track():
"use client"
export function WaitlistButton() {
return (
<button onClick={() => window.antlytics?.track("waitlist_signup", { plan: "pro" })}>
Join the waitlist
</button>
)
}
Or use the standalone client from @antlytics/analytics:
import { createAnalyticsClient } from "@antlytics/analytics"
const analytics = createAnalyticsClient({ siteId: "your-tracking-id" })
analytics.track("waitlist_signup", { plan: "pro" })
Rules
- Event names may contain letters, numbers, spaces and
. : / _ -, up to 120 characters. Use consistent names —waitlist_signup, not a mix ofWaitlistSignupandwaitlist-signup. - Props are optional and limited to flat JSON scalars (strings, numbers, booleans, null). Nested objects are rejected. At most 20 keys and 1 KB serialised.
- Events inherit the same privacy model as pageviews: no cookies, no persistent identifiers, session scoped to the browser tab.
- Events pass through the same bot filtering, rate limits, and shield rules as pageviews.
Where events show up
- Funnels — use an event as a funnel step (see Funnels).
- AI Page Insights — engagement and conversion signals feed page summaries.
For "visitor reached a page" conversions, goals remain the simplest tool — no code changes needed.
Something missing? Get in touch and we will update these docs.