Skip to content

trackkit / index / AnalyticsInstance

Interface: AnalyticsInstance

Defined in: types.ts:342

Analytics instance methods

Properties

name

name: string

Defined in: types.ts:343

Methods

track()

track(name, props?, category?): void

Defined in: types.ts:350

Track a custom event

Parameters

name

string

Event name (e.g., 'button_click')

props?

Props

Optional event properties

category?

ConsentCategory

Optional event category for grouping (defaults to 'analytics')

Returns

void


pageview()

pageview(): void

Defined in: types.ts:355

Track a page view

Returns

void


identify()

identify(userId): void

Defined in: types.ts:361

Identify the current user

Parameters

userId

User identifier or null to clear

null | string

Returns

void


destroy()

destroy(): void

Defined in: types.ts:366

Clean up and destroy the instance

Returns

void