Features

Custom Events

Record anything a user does in your app — a filter applied, a tab opened, an export run — by its own name. One line, and it's ready for flags, funnels and comparisons.

Quickstart

Call capture()where the thing happens. The first argument is the event's name, the second is anything worth knowing about it.

filters.ts
1fg.capture('filter_applied', { filter: 'price', value: 'under-50' });

It never throws and never blocks the page, so it's safe in click handlers and loops — call it as often as the interaction happens. This assumes you've called FlowGrid.init(); see the SDK Quickstart.

Where to call it

1import { FlowGrid } from 'flowgrid-sdk'; 2 3function ExportButton() { 4 return ( 5 <button onClick={() => FlowGrid.instance()?.capture('export_clicked', { format: 'csv' })}> 6 Export 7 </button> 8 ); 9}

On a server, pass visitorIdso the event joins the user's browser session, or userId for a signed-in user. The server version returns { ok } and never rejects.

Naming events

The name is stored exactly as you write it, so Plan Compared and plan_compared are two different events. Pick one style and keep to it — past tense, object_action, reads best in the dashboard. Up to 100 characters.

A few names are Flowgrid's

Names Flowgrid sends itself — page_load, click_event, signup_completed and the like — are refused, because capturing one would be counted as ours. The event is dropped with one console warning; pick your own name instead.

Properties

Any JSON-safe object, up to 10KB per event. Device, page and session details are added for you, so send only what's specific to the moment: which filter, which plan, how many rows.

Never send secrets

Keys that look like passwords, tokens, secrets or API keys log a warning in the console. Don't put personal data in an event you wouldn't want in your analytics.

Where events show up

Captured events appear by name everywhere you pick an event — usually within a minute of arriving.

WhereWhat you can do
Feature flagsTarget "Users who did something", ever or in the last 1–90 days.
Flag impactPick it as the success event a flag's variants are compared on.
FunnelsUse it as a step: "filter_applied → checkout_started".
Research LabsCompare two events by how many people did each.

Create one before your code

Want a flag to target an event your code doesn't send yet? In any event picker, type the name and choose Create event. It shows as waiting for first event, with the capture() line to add, until the first one arrives.

capture() or track()?

Use capture() for your own events. track() is for Flowgrid's named events, like track('signup_completed', { userId, method }), which fill specific reports. Events you already send with track() under your own name keep working everywhere — new ones are best sent with capture().