Web Analytics Dashboard with R & Shiny

Marco Pasin
18/12/2014

Benefits of Dashboards in Web Analytics

  • Display the current status of key web metrics
  • Allow benchmark & segmentation
  • All data in a single comprehensive view
  • Web Performance can be monitored at a glance
  • Quick insights

Advantages of Using R & Shiny to Create Dashboards

  • Advanced statistical modeling offered by R
  • Beautiful & Interactive charts (e.g. googleVis package)
  • Ability to work with very big datasets
  • Integrate information from different data sources
  • Connect directly to API (e.g. RGoogleAnalytics package)
  • Quick & easy app development with Shiny
  • Share on the web
  • It's open source and free!

Simple Scenario: Segment by Device

  • Radio buttons to spot differences in performance for desktop, mobile y tablets
  • Interactive charts via Google Charts (googleVis package)
  • All charts update depending on device selected
  • Can potentially include sophisticated visualizations not offered by Web Analytics tools
  • Dashboard can integrate with API (e.g Google Analyitics) to refresh data daily

alt text alt text

Setting up the Dashboard

To set up the dashboard, first create each chart object and then merge them in pairs as follows:

D1 <- gvisLineChart(dataDevice, "date", c("sessions","signup"))
D2 <- gvisBubbleChart(channelsDevice, idvar="channel", xvar="sessions", yvar="pages.sessions")
D3 <- gvisLineChart(dataDevice, xvar="date", yvar="bounce.rate",
D4 <- gvisGeoChart(countriesDevice, "country", "new.users")
D12 <- gvisMerge(D1,D2, horizontal=TRUE)
D34 <- gvisMerge(D3,D4, horizontal=TRUE)
D12D34<- gvisMerge(D12,D34, horizontal=FALSE)
plot(D1234)