Include Azure Application Insights in Shiny Apps

Imports Azure Application Insights for web pages into Shiny apps via Microsoft's JavaScript snippet. Allows app developers to submit page tracking and submit events.


Azure Application Insights for web pages

Add Azure Application Insights tracking to a Shiny App. Requires an active Azure subscription and Application Insights instrumentation key! Based on https://docs.microsoft.com/en-us/azure/azure-monitor/app/javascript and https://github.com/microsoft/ApplicationInsights-JS.

Supports so far only pageViews (automatically sent), autoTrackPageVisitTime (when configured), and customEvents.

customMetrics will still not go through.

Notes:

New Azure regions do not support instrumentation keys. Instead, a connection string must be supplied (which includes the instrumentation key).

Usage:

  1. Include includeAzureAppInsights() in your ui-function. Anywhere will do.
  2. Include startAzureAppInsights(session, config(connectionString = <>, appId = <>)) in your server-function.

To submit a custom event from the server-side use trackEvent. You can also use to submit directly from the browser.

tags$button("Click me!",
      onClick=HTML("appInsights.trackEvent( {name: 'garble', properties: {moobs: 15, bacon: true}});" )
    )

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("AzureAppInsights")

0.3.1 by Stefan McKinnon Edwards, 3 years ago


Report a bug at https://github.com/stefanedwards/AzureAppInsights/issues


Browse source code at https://github.com/cran/AzureAppInsights


Authors: Stefan McKinnon Edwards [aut, cre] , Kamstrup A/S [cph]


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports shiny, rlang, assertthat, jsonlite, lubridate

Suggests testthat, here


See at CRAN