Plugin/Integration request: Microsoft AppInsights (Application Insights)
See original GitHub issueHello,
Would it be possible to add AppInsights to the list of supported integrations? I think it’d be a “provider plugin”? The JS SDK is on github: https://github.com/Microsoft/ApplicationInsights-JS
The list of tracking methods (e.g. trackEvent
, trackPageView
, etc):
https://github.com/Microsoft/ApplicationInsights-JS#sending-telemetry-to-the-azure-portal
API reference: https://github.com/Microsoft/ApplicationInsights-JS/blob/master/API-reference.md
If I try to give you a headstart, assuming I understood your interface, some pseudo-code would be:
import { ApplicationInsights } from '@microsoft/applicationinsights-web'
export default function applicationInsightsPlugin(userConfig) {
let appInsights;
return {
name: 'application-insights-plugin',
config: {
/* See https://github.com/Microsoft/ApplicationInsights-JS#configuration */
},
initialize: ({ config }) => {
const appInsights = new ApplicationInsights({
config: {
instrumentationKey: 'INSTRUMENTATION_KEY_GOES_HERE'
/* ...Other Configuration Options... */
}
});
appInsights.loadAppInsights();
},
page: ({ payload }) => {
appInsights.trackPageView();
},
track: ({ payload }) => {
appInsights.trackEvent({ name: 'some event' }, data);
},
identify: ({ payload }) => {
appInsights.setAuthenticatedUserContext(authenticatedUserId, accountId, storeInCookie)
},
loaded: () => {
// return boolean so analytics knows when it can send data to third party
return !!appInsights
}
}
}
It is possible to load AppInsights as a script on the page like most trackers, but that’s not how we’ve used it. Hence my pseudo-code uses the npm module.
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Application Insights overview - Azure Monitor - Microsoft Learn
Learn how Application Insights in Azure Monitor provides performance management and usage tracking of your live web application.
Read more >Overview of integration with Application Insights - Power ...
Application Insights provides different views. The Overview panel shows a summary of the key diagnostic metrics of your app and is a gateway ......
Read more >Plug-in telemetry with Application Insights integration
Enable customers with model-driven apps to monitor, diagnose, and troubleshoot errors and performance issues for Unified Interface form-loads, ...
Read more >Azure Application Insights for JavaScript web apps
Get page view and session counts, web client data, and single-page applications and track usage patterns. Detect exceptions and performance ...
Read more >React plug-in for Application Insights JavaScript SDK
Learn how to install and use the React plug-in for the Application Insights JavaScript SDK.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hey @seriema
Happy to add this in and publish to something like
@analytics/microsoft-app-insights
Can you open up a PR this and finish the client-side calls? I don’t use this tool myself and am unfamiliar with it.
Here are some pointers on getting this up in its own folder:
analytics-plugin-microsoft-app-insights
google-tag-manager
in the package.jsonglobalName
in package.json hereLet me know if you have any questions.
Alternatively, you can use the code you have written inline in your apps.
Example:
A consolidated issue has been created at https://github.com/DavidWells/analytics/issues/153 for plugin requests.
Feel free to comment/reopen this thread if you have begun active development on this plugin.