New: Free plan is live 7 August 2026 · View changelog →
Antlytics logoAntlytics

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 of WaitlistSignup and waitlist-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

  • Events — ranked event names and session counts for the selected period (sidebar → Events).
  • 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.

Marketing CTAs without custom code

On sites that load the Antlytics script, you can fire events from HTML with data-ant-event (and optional data-ant-prop-* attributes). Antlytics’s own marketing pages use this pattern; see the tracker docs or ask support if you want the same delegated click helper.

Something missing? Get in touch and we will update these docs.