Related services: AnalyticsService:
lynkow.analytics.destroy(),lynkow.analytics.disable(),lynkow.analytics.enable(),lynkow.analytics.getTracker(),lynkow.analytics.init(),lynkow.analytics.isEnabled(),lynkow.analytics.isInitialized(),lynkow.analytics.trackEvent(),lynkow.analytics.trackPageview()
AnalyticsEventType
TypeAlias
Event types Lynkow analytics records. The API silently drops an event with
any other type. There is no free-form business event: record one as the
event that carries it ('form_submit', 'outbound_link', 'click') plus
descriptive fields.
type AnalyticsEventType = "pageview" | "scroll" | "time_on_page" | "cwv" | "exit" | "heartbeat" | "click" | "outbound_link" | "file_download" | "email_click" | "phone_click" | "rage_click" | "dead_click" | "copy" | "form_start" | "form_submit" | "form_abandon" | "form_field" | "form_error" | "heatmap_click"EventData
Interface
Event passed to AnalyticsService.trackEvent. Other keys are sent
as is and must use the API's snake_case field names (click_element,
file_name, form_id, utm_source). The API drops any key it does not know.
Property | Type | Optional | Description |
|---|---|---|---|
|
| No | Event type, sent as |
EventEmitter
TypeAlias
Type of the event emitter object returned by createEventEmitter.
type EventEmitter = ReturnType<unknown>EventListener
TypeAlias
Callback function type for event listeners.
type EventListener = (data: T) => voidEventName
TypeAlias
type EventName = keyof LynkowEventsLynkowEvents
Interface
Events of lynkow.on(), each mapped to its payload type.
Property | Type | Optional | Description |
|---|---|---|---|
|
| No | The visitor changed their cookie consent. The payload maps each category<br>to its choice, such as |
|
| No | Browser only: the client's startup failed, for example when the site<br>config request failed. The payload is the error. |
|
| No |
|
|
| No | Browser only: the client loaded the site config and started its browser<br>services. Emitted once, never when that startup fails. |
PageviewData
Interface
Pageview passed to AnalyticsService.trackPageview. Each omitted field is read from the browser at call time.
Property | Type | Optional | Description |
|---|---|---|---|
|
| Yes | Page path starting with |
|
| Yes | Referring URL. Defaults to |
|
| Yes | Page title, max 500 characters: a longer one makes the API drop the pageview. Defaults to |
|
| Yes | Absolute page URL. Defaults to |