Socket
Socket
Sign inDemoInstall

@microsoft/applicationinsights-analytics-js

Package Overview
Dependencies
Maintainers
2
Versions
570
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@microsoft/applicationinsights-analytics-js

Microsoft Application Insights JavaScript SDK - Web Analytics


Version published
Weekly downloads
512K
increased by7.99%
Maintainers
2
Weekly downloads
 
Created

What is @microsoft/applicationinsights-analytics-js?

@microsoft/applicationinsights-analytics-js is a JavaScript library that allows you to collect and analyze telemetry data from your web applications. It provides functionalities for tracking page views, custom events, exceptions, and dependencies, among other things. This helps in monitoring the performance and usage of your application.

What are @microsoft/applicationinsights-analytics-js's main functionalities?

Track Page Views

This feature allows you to track page views in your application. The code sample demonstrates how to track a page view for a page named 'HomePage'.

const appInsights = require('@microsoft/applicationinsights-analytics-js');
appInsights.trackPageView({ name: 'HomePage' });

Track Custom Events

This feature allows you to track custom events. The code sample shows how to track an event named 'ButtonClicked' with a property 'buttonName' set to 'Submit'.

const appInsights = require('@microsoft/applicationinsights-analytics-js');
appInsights.trackEvent({ name: 'ButtonClicked', properties: { buttonName: 'Submit' } });

Track Exceptions

This feature allows you to track exceptions in your application. The code sample demonstrates how to catch an exception and track it using Application Insights.

const appInsights = require('@microsoft/applicationinsights-analytics-js');
try {
  // some code that may throw an error
} catch (e) {
  appInsights.trackException({ exception: e });
}

Track Dependencies

This feature allows you to track dependencies such as API calls. The code sample shows how to track a dependency with various details like ID, name, duration, success status, and result code.

const appInsights = require('@microsoft/applicationinsights-analytics-js');
appInsights.trackDependencyData({
  id: '12345',
  name: 'GET /api/data',
  duration: 300,
  success: true,
  resultCode: 200
});

Other packages similar to @microsoft/applicationinsights-analytics-js

FAQs

Package last updated on 03 Sep 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc