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: unknownAn optional context (see dynatrace.addEventModifier) that can be used to manipulate the result event within the modification callback.
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
});
Sends an event with the provided fields.