Sends user interaction analytics events to Mappedin's analytics backend. Captures map loads, search queries, directions, and custom user events so usage of an indoor map can be measured and tuned.

Properties

Properties

capture: {
    <T extends keyof CaptureEventsPayloadMap>(
        eventName: T,
        query: CaptureEventsPayloadMap[T],
    ): Promise<void> | Promise<Response>;
    <T extends string & {} | (keyof CaptureEventsPayloadMap)>(
        target: T,
        query: T extends keyof CaptureEventsPayloadMap
            ? CaptureEventsPayloadMap[T<T>]
            : Record<string, any>,
    ): Promise<void> | Promise<Response>;
}

Captures an analytic event with a custom target and query payload.

The event name or target can be one of: $select-location, $select-category, $query-suggest, $query-search

The payload associated with the event.

A promise that resolves to the server response or void.

updateState: (update: TAnalyticsUpdateState) => void

Updates the analytics state with the provided parameters.

Type declaration