Custom event
A custom event is an application-defined entry in the rrweb event stream (type 5), added via `record.addCustomEvent(tag, payload)`, that timestamps domain context, such as "checkout-started" or "error-shown", alongside the recorded behavior. It lets teams mark moments in a session with meaning the DOM alone does not carry.
How it works
Calling record.addCustomEvent('add-to-cart', { sku: 'A-113' }) inserts a type 5 event with the tag and arbitrary JSON payload at the current position in the stream. The custom event recipe shows how to record and replay these events. Players can render custom events as timeline markers, and analysis code can slice sessions by them: everything between "experiment-variant-b" and "purchase-complete", for example. They are the standard bridge between session replay and product analytics, because an analytics event and a custom event with the same name join the quantitative and behavioral views of one moment.
Where you encounter it
In error tracking integrations (drop a marker when an exception fires), A/B testing, and funnel work, where custom events define the funnel stages inside recordings; see funnel analysis.