Documentation
¶
Overview ¶
Package defined implements retroactive, zero-code events — the Heap wedge. A person with autocapture flowing has raw $click / $pageview / $form_submit rows; a defined event names a slice of them ("checkout = $click where text contains Buy") and makes it a first-class event across EVERY report, retroactive to install, with no tracking code and no coding agent. It is the non-agent instrumentation path.
A Store decorator injects a synthetic event for every autocaptured row that matches a definition, so funnels, trends, retention, and the ask bar see the defined name like any tracked event. Reports already recompute from history, so the backfill is free.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Condition ¶
type Condition struct {
Field string `json:"field"` // text | id | classes | href | path | tag | name
Op string `json:"op"` // equals | contains | prefix
Value string `json:"value"`
}
Condition matches one autocapture property. Fields are the flat props the SDK stamps.
type Definition ¶
type Definition struct {
Name string `json:"name"`
Description string `json:"description,omitempty"`
Event string `json:"event"` // base autocapture event
Where []Condition `json:"where"`
Created time.Time `json:"created"`
}
Definition is one retroactive event: a name over a base autocapture event + AND-ed conditions.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store persists the definitions (a small JSON file, like the tracking plan / cohorts).
func (*Store) Save ¶
func (s *Store) Save(d Definition) (Definition, error)
Save adds or replaces a definition by name and validates it.