Monitor your Angular application using Azure Application Insights

Written by ppolyzos

Software engineer based in beautiful Luxembourg


  1. Ketan Shah

    Great article, helps a lot to understand.
    My question is lets say if we implement this Interceptor above which captures all events within that SPA Angular application, apart from including it in the App module in the PROVIERS, do we still have to make a trackEvent() method call in every event we want to track or since its been defined as interceptor it will intercept every request and track it? Also if we are using the trackEvent method, can we also use the TrackPageView() method or that’s not needed since trackEvent will cover it? Any help on this question.

    1. ppolyzos

      You can use any of the SDK API methods based on your needs. Also, you can have multiple interceptors for different type of events, views, pages etc.
      The difference between each API method is on how the data are going to be visualized in Application Insights dashboard. This page will also help you.
      Usually, `TrackEvent()` is used to track events like an `AccountIsCreated` or `AccountLoggedIn`, while TrackPageView() is mostly about page views.
      If I recall correctly, TrackEvent() does not record the page that the event was fired from unless you provide it.

Leave a Comment

Your email address will not be published. Required fields are marked *