Skip to content

[BUG] Type signature for stopTrackEvent is incorrect #2430

@GravlLift

Description

@GravlLift

Description/Screenshot
The properties parameter is of type {[key: string]: string}

stopTrackEvent(name: string, properties?: {[key: string]: string}, measurements?: {[key: string]: number}): void;

Per the README.md, "objects are okay too".

When using stopTrackPage and stopTrackEvent, you can pass in data categorized by types:
Strings: These should be included under the properties field.
Numbers: Add these under the measurements field.
Remember, the order of the properties and measurements should not be altered. You can achieve this using the following code structure:
```js
appInsights.startTrackEvent("event name");
appInsights.stopTrackEvent("event name", {
stringProp1: 'string',
stringProp2: {nested:"objects are okay too"}
},
{numProp1: 3.15, numProp2: 90000}
)
```

Expected behavior
Testing reveals that nested objects are handled just fine here. Perhaps the signature should be updated to match trackEvent's customProperties parameter of type {[key: string]: any}?

Additional context
All links and testing in version 3.3.3

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions