RUM JavaScript API - 1.333.0
    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 keys must contain only alphabetic characters, numbers, underscores or dots. Each dot must be followed by an alphabetic character. Each underscore must be followed by an alphabetic character or number.

      • 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
      });