RUM JavaScript API - 1.345.1
    Preparing search index...

    Interface UserActionTrackerExperimental

    An object to work with user actions.

    interface UserActionTracker {
        get completeAutomatically(): boolean;
        set completeAutomatically(completeAutomatically: boolean): void;
        get customName(): string;
        set customName(value: string): void;
        get event_properties(): Record<
            `event_properties.${string}`,
            string
            | number
            | boolean,
        >;
        set event_properties(
            properties: Record<
                `event_properties.${string}`,
                string
                | number
                | boolean,
            >,
        ): void;
        get startTime(): number;
        set startTime(value: number): void;
        get state(): "complete" | "active";
        complete(): void;
        registerCustomTracker(
            name: string,
            create: UserActionActivityTrackerCreator,
        ): void;
        subscribe(subscriber: (event: UserActionEndEvent) => void): () => void;
    }
    Index

    Accessors

    • get completeAutomatically(): boolean
      Experimental

      Returns boolean

      True if this user action completes automatically. If false, the user action has to be completed with a call to complete.

    • set completeAutomatically(completeAutomatically: boolean): void
      Experimental

      Allows to configure this user action to complete automatically.

      Parameters

      • completeAutomatically: boolean

        If set to false, the user action has to be completed with a call to complete.

      Returns void

    • get customName(): string
      Experimental

      Retrieves the custom name of the user action.

      Returns string

      The custom name of the user action.

    • set customName(value: string): void
      Experimental

      Sets the custom name of the user action.

      Parameters

      • value: string

        The custom name to set for the user action.

      Returns void

    • get event_properties(): Record<
          `event_properties.${string}`,
          string
          | number
          | boolean,
      >
      Experimental

      Retrieves the event properties for the user action.

      Returns Record<`event_properties.${string}`, string | number | boolean>

      The event properties for the user action.

    • set event_properties(
          properties: Record<
              `event_properties.${string}`,
              string
              | number
              | boolean,
          >,
      ): void
      Experimental

      Sets the event properties for the user action.

      Parameters

      • properties: Record<`event_properties.${string}`, string | number | boolean>

        The properties to set for the event.

      Returns void

    • get startTime(): number
      Experimental

      Retrieves the start time of the user action.

      Returns number

      The start time of the user action.

    • set startTime(value: number): void
      Experimental

      Sets the start time of the user action.

      Parameters

      • value: number

        The start time to set for the user action. Must not be in the future.

      Returns void

    • get state(): "complete" | "active"
      Experimental

      Retrieves the current state of the user action, which can be either "active" or "complete".

      Returns "complete" | "active"

      The current state of the user action.

    Methods

    • Experimental

      Completes this user action and sends a user action event for it.

      Returns void

    • Experimental

      Registers a custom activity tracker on this user action. The agent calls create with an activity context. notifyActivity() extends the quiet window without blocking completion; block() keeps the tracker blocked until release() is called. block() and release() are idempotent per tracker.

      create may return a stop function for the simple case, or a richer handle { stop, getEventProperties? } when the tracker contributes event_properties.* to the final user action event.

      Reentrant: may be called any time while the user action is still active. Calling on an already-completed action is a no-op (logged to the console). Multiple trackers may be registered; the action stays open while any one of them — internal or custom — is blocked. The agent owns the tracker lifecycle: it calls stop() on each registered tracker when the action completes (naturally, by timeout, page hide, or interruption).

      Parameters

      • name: string

        Human-readable tracker name surfaced in diagnostics. Must be a non-empty string.

      • create: UserActionActivityTrackerCreator

        Builds the tracker for this user action. Invoked synchronously with the agent's activity context.

      Returns void

    • Experimental

      Subscribes to this user action to be notified when it would automatically complete.

      Parameters

      Returns () => void