latelierco / vue-application-insights

MIT License
26 stars 9 forks source link

Tracking Event/Error Example #1

Closed tmacintosh closed 6 years ago

tmacintosh commented 6 years ago

Can you please provide an example of calling Applnsights.TrackEvent() from inside a component? I managed to get application insights tracking page views by following your documentation but can't figure out how to track the other metrics. I imagined all I needed to do was call Vue.appInsights.trackEvent(...) but I get an error: "Property 'appInsights' does not exist on type 'typeof Vue'".

GregYankovoy commented 6 years ago

@tmacintosh it looks like the "Vue.appInsights" property is exposed through getter "Vue.$appInsights" (code is on line 38 of src/index.js).

Follows the practices of things like Vue-Resource/axios in terms of how it's exposed. Give that a try and let me know how it goes.

grreeenn commented 4 years ago

it works, but the name value is not being sent correctly