RUM JavaScript API - 1.345.1
    Preparing search index...

    Function sendEvent

    • Safe wrapper for dynatrace.sendEvent which reverts to a noop if RUM JavaScript is not available.

      Parameters

      • fields: ApiCreatedEventPropertiesEvent

        Must be a valid JSON object and cannot contain functions, undefined, Infinity and NaN as values, otherwise they will be replaced with null. The fields need to be serializable using JSON.stringify. The resulting event will be populated with fields parameter, and modified with additional properties, thus also empty objects are valid. Only properties prefixed with event_properties., the duration property and the start_time property are allowed.

      • OptionaleventContext: unknown

        An optional context that can be used to manipulate the result event within the modification callback.

      Returns void

      import { sendEvent } from '@dynatrace/rum-javascript-sdk/api';

      sendEvent({
      'event_properties.page_name': 'checkout',
      'event_properties.step': 'payment',
      'event_properties.amount': 99.99,
      'duration': 1500,
      'start_time': Date.now()
      });