question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

trackEvent API Reference Wrong?

See original GitHub issue

Description/Screenshot When I call: appInsights.trackEvent({ name: 'mike d event name test' }); it produces ‘[object Object]’ for an Event name:

image


But according to Sending Telemetry to the Azure Portal in the readme I should be using: appInsights.trackEvent({name: 'some event'});

Also, the API reference for trackEvent says it takes in an ITelemetryEvent which is defined as:

export interface IEventTelemetry extends IPartC {
    /**
     * @description An event name string
     * @type {string}
     * @memberof IEventTelemetry
     */
    name: string;
}

When I search through the code I see tests that are passing strings not objects:

image

Steps to Reproduce

  • OS/Browser:
  • SDK Version: Microsoft.ApplicationInsights.AspNetCore (2.8.1) via NuGet
  • How you initialized the SDK: I didn’t directly, I just add app insights to my ASP.NET Core project via Visual Studio and it wired up the magic. Looks like it added @inject Microsoft.ApplicationInsights.AspNetCore.JavaScriptSnippet JavaScriptSnippet to my _'Layout.cshtml’ file.

Expected behavior

Additional context

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
TimothyMothracommented, Oct 31, 2019

Hi @spottedmahn. We’re going to be releasing an update to AspNetCore probably next week (2.12-Beta2) with the stable release coming in December.

1reaction
markwolffcommented, Oct 31, 2019

Actually that nuget package may be updated with the latest JS SDK soon. This PR was just merged to move it to the latest https://github.com/microsoft/ApplicationInsights-dotnet/pull/1276#event-2758134114

/cc @timothyMothra can provide a rough ETA

Read more comments on GitHub >

github_iconTop Results From Across the Web

TrackEvent - Web APIs | MDN
Creates and initializes a new TrackEvent object with the event type specified, as well as optional additional properties. Instance properties.
Read more >
Application Insights API for custom events and metrics
Pages, screens, panes, or forms. TrackEvent, User actions and other events. Used to track user behavior or to monitor performance. GetMetric, Zero and ......
Read more >
Not tracking events - Support & Bugs - Matomo forums
I'm testing my site from a localhost frontend. Page visits and search queries shows up in the reports, but my trackEvent calls doesn't...
Read more >
Events API - Zendesk Developer Docs
In addition to this API reference, the following resources are available in the Develop ... source, string, false, true, Application which sent the...
Read more >
post - Sendinblue Tracker
post https://in-automate.sendinblue.com/api/v2/trackEvent. The Track Event endpoint lets you capture events on your website, along with optional extra ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found