Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Type signature for stopTrackEvent is incorrect #2430

Open
GravlLift opened this issue Oct 11, 2024 · 0 comments
Open

[BUG] Type signature for stopTrackEvent is incorrect #2430

GravlLift opened this issue Oct 11, 2024 · 0 comments
Labels
investigation required Further investigation or discussions required keep Do not Mark as Stale and close

Comments

@GravlLift
Copy link

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

@MSNev MSNev added investigation required Further investigation or discussions required keep Do not Mark as Stale and close labels Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
investigation required Further investigation or discussions required keep Do not Mark as Stale and close
Projects
None yet
Development

No branches or pull requests

2 participants