Search


Search something to see results

TrackingInstance

interface TrackingInstance {
    append: (key: string, data: TrackingData, immediately?: boolean) => void;
    calculateRelative: (timer: number) => number;
    getBeaconIndex: () => number;
    set: (
        key: string,
        data: TrackingData,
        immediately?: boolean,
        mode?: boolean | SendMode,
    ) => boolean;
    setTiming: (
        key: string,
        data: TrackingData,
        immediately?: boolean,
        mode?: boolean | SendMode,
    ) => boolean;
    trackCustomEvent: (
        action: string,
        label: string,
        value: number,
        immediately?: boolean,
        withTimestamp?: boolean,
    ) => void;
    trackCustomTimer: (
        key: string,
        data: TrackingData,
        immediately?: boolean,
    ) => void;
}

Hierarchy (View Summary)

Index

Properties

Properties

append: (key: string, data: TrackingData, immediately?: boolean) => void

Appends the given data to the given key for tracking. This method can be called multiple times to add multiple data items to the key.

calculateRelative: (timer: number) => number

Calculates a given timer relative to the navigation start.

getBeaconIndex: () => number

Returns the current beacon index or 0 if no beacon has been sent yet.

set: (
    key: string,
    data: TrackingData,
    immediately?: boolean,
    mode?: boolean | SendMode,
) => boolean

Sets the given data to the given key for tracking. Calling this method multiple times will override old value. To track multiple values per key use append

Type Declaration

    • (
          key: string,
          data: TrackingData,
          immediately?: boolean,
          mode?: boolean | SendMode,
      ): boolean
    • Parameters

      • key: string
      • data: TrackingData
      • Optionalimmediately: boolean
      • Optionalmode: boolean | SendMode

      Returns boolean

      true if value is scheduled to be sent with the next beacons, false otherwise.

setTiming: (
    key: string,
    data: TrackingData,
    immediately?: boolean,
    mode?: boolean | SendMode,
) => boolean

Sets the given data to the given key for tracking relatively to the navigationStart when it is numeric. Otherwise it will be tracked normal. Calling this method multiple times will override old value. To track multiple values (without being calculated relatively) per key use append.

Type Declaration

    • (
          key: string,
          data: TrackingData,
          immediately?: boolean,
          mode?: boolean | SendMode,
      ): boolean
    • Parameters

      • key: string
      • data: TrackingData
      • Optionalimmediately: boolean
      • Optionalmode: boolean | SendMode

      Returns boolean

      true if value is scheduled to be sent with the next beacons, false otherwise.

trackCustomEvent: (
    action: string,
    label: string,
    value: number,
    immediately?: boolean,
    withTimestamp?: boolean,
) => void

Send custom event information (action, label and value) using a beacon.

trackCustomTimer: (
    key: string,
    data: TrackingData,
    immediately?: boolean,
) => void

Sends custom timer information (key and data) using a beacon.