文件
瀏覽文件

Custom events and properties

Track signups, purchases and other custom events with privatus.track(), HTML attributes or your server, plus naming rules, limits and how events count as usage.

以 Markdown 檢視

A custom event is something that happens on a page: a signup, a purchase, a video play. Events have a name and optional properties.

js
privatus.track('Signup', { plan: 'pro', seats: 3 })

Events appear in the Conversions panel on the Overview and in the Events explorer, and can become goals and funnel steps.

Three ways to send them:

  1. JavaScript: privatus.track() (API).
  2. HTML attributes, no code: data-privatus-event="Signup" (HTML attributes).
  3. From your server: the server-side ingest API.

The auto module tracks outbound links, downloads, forms and 404s for you.

Naming#

  • Up to 120 characters, any language and script. Longer names are cut.
  • Leading and trailing spaces are trimmed and Unicode is normalised (NFC), so Café typed two different ways is one event.
  • Case is kept for display. Pick one style and stick to it: Signup and signup are stored as written. You can merge names later in Site settings → Events & properties.
  • Name the action, not the element: Signup, Checkout started, Invoice downloaded, rather than Blue button click.
  • Don't put variable data in names (Viewed product 123). Use a property.

Limits#

Limit Value
Event name 120 characters
Properties per event 30 (extra ones are dropped)
Property key 64 characters, a-z, 0-9, _
String value 500 characters
Array value up to 30 strings
Property keys per site 10 on Free, unlimited on paid plans
Request body 32 KB

Usage#

Every custom event counts as one event toward your monthly allowance, like a pageview. Engagement pings, Web Vitals, click-map hits and bots don't count. See What counts as an event.

Managing events#

In Site settings → Events & properties you can rename events (history is rewritten at query time), merge several names into one, hide events, and delete an event including its history. See Events explorer.