RUM JavaScript API - 1.345.1
    Preparing search index...

    Function sendEvent

    • Sends an event with the provided fields.

      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 contain the provided fields, and is 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. String properties are limited to 5000 characters, exceeding characters are cut off. All event property key names must match the naming rules defined by VALID_KEY_REGEX.

      • OptionaleventContext: unknown

        An optional context (see dynatrace.addEventModifier) that can be used to manipulate the result event within the modification callback.

      Returns void

      dynatrace.sendEvent({
      "event_properties.prop": "value",
      "duration": 123,
      "event_properties.url": "www.dynatrace.com",
      "event_properties.id": "123456789",
      });

      // Using context:
      document.addEventListener("load", (event) => {
      dynatrace.sendEvent({
      "event_properties.prop": "value",
      "duration": 123,
      "event_properties.url": "www.dynatrace.com",
      "event_properties.id": "123456789",
      }, event); // add the event context here
      });