Analytics Support

When you are creating an application for a broad audience, integrating some kind of analytics framework is crucial, because you will need to analyze the usage data of the application and its features and most probably you will need to know about any application crashes or other errors that occurred during the execution. Using analytics you will be able to trace certain features of the controls and get statistics about their usage.

This article will discuss the following topics:

With the discontinuation of the Telerik Platform as of R2 2018 SP1 we've also removed the two dependent assemblies from our suite - EQATEC.Analytics.Monitor.dll and Telerik.Windows.Analytics.dll. The respective NuGet packages have been removed as well. Instead, the ITraceMonitor interface should be used as explained below.

ITraceMonitor Interface

As of R2 2017 SP1, the Telerik UI for Silverlight suite exposes the ITraceMonitor interface which represents a monitor which receives trace events from the controls.

You need to implement the following methods in order to receive trace events from the controls used in your application:

  • TrackAtomicFeature: This method is called when an atomic feature is executed.
  • TrackFeatureStart: This method is called when a feature is initiated.
  • TrackFeatureEnd: This method is called when a feature finishes execution.
  • TrackFeatureCancel: This method is called when a feature is canceled.
  • TrackError: Traces an error in a specified feature.
  • TrackValue: This method is called when a value connected with a specific feature is tracked.

Once you've created your implementation of the interface in accordance to your provider of choice you need to set the static TraceMonitor.AnalyticsMonitor property as shown in Example 1.

Example 1: Set TraceMonitor.AnalyticsMonitor

TraceMonitor.AnalyticsMonitor = new MyMonitor(); 
TraceMonitor.AnalyticsMonitor = New MyMonitor() 

How Analytics Works

Let's first define a couple of controls.

Example 2: Add controls

<StackPanel Orientation="Horizontal">  
    <telerik:RadComboBox Width="200">  
        <telerik:RadComboBoxItem Content="Silverlight" />  
        <telerik:RadComboBoxItem Content="WPF" />  
        <telerik:RadComboBoxItem Content="ASP.NET AJAX" />  
        <telerik:RadComboBoxItem Content="WinForms" />  
    </telerik:RadComboBox>  
    <telerik:RadButton Content="Select" Click="Select_Click" />  
</StackPanel>  
All that is needed to enable analytics for these controls is to set the telerik:Analytics.Name attached property. This has been demonstrated in Example 3. Note that the set values will be used in the dashboard.

Example 3: Set Analytics.Name property

<StackPanel Orientation="Horizontal">  
    <telerik:RadComboBox Width="200" telerik:Analytics.Name="ComboBoxSelection">  
        <telerik:RadComboBoxItem Content="Silverlight" />  
        <telerik:RadComboBoxItem Content="WPF" />  
        <telerik:RadComboBoxItem Content="ASP.NET AJAX" />  
        <telerik:RadComboBoxItem Content="WinForms" />  
    </telerik:RadComboBox>  
    <telerik:RadButton telerik:Analytics.Name="SelectButton" Content="Select" Click="Select_Click" />  
</StackPanel> 
You can then go to the dashboard of your analytics provider, where you will find information and statistics for the registered features for different periods of time.

Traceable Features

Currently only a few controls support analytics out of the box. Note that only user interactions will be tracked - initial values and values from bindings are not supported.

Table 1: Supported controls and features

Feature Feature Name
RadBusyIndicator
Show ShowIndicator
RadCalendar
SelectionChanged SelectionChanged
RadCarousel
SelectionChanged SelectionChanged
RadColorEditor
SelectionChanged SelectionChanged
RadColorPicker
SelectionChanged SelectionChanged
RadComboBox
SelectionChanged SelectionChanged
DropDownOpened DropDownOpened
DropDownClosed DropDownClosed
RadContextMenu
Open Opened
Close Closed
Click Click
RadDropDownButton
DropDownOpened DropDownOpened
DropDownClosed DropDownClosed
RadExpander
Expanded Expanded
Collapsed Collapsed
RadGridView
Sort Sorted
Group Grouped
Filter Filtered
SelectionChanged SelectionChanged
RadListBox
SelectionChanged SelectionChanged
RadMenu
Click Click
RadRadioButton
Checked Checked
UnChecked UnChecked
RadRibbonView
SelectionChanged SelectionChanged
RadRichTextBox
Open Document Open Document
Save Document Save Document
Print Print
RadSpreadsheet
Open Document Open Document
Save Document Save Document
Load Image LoadImage
Save Image SaveImage
RadTabControl
SelectionChanged SelectionChanged
RadTileView
SelectionChanged SelectionChanged
RadToggleButton
Checked Checked
UnChecked UnChecked
RadTreeListView
Sort Sorted
Group Grouped
Filter Filtered
SelectionChanged SelectionChanged
RadTreeView
SelectionChanged SelectionChanged
RadVirtualGrid
SelectionChanged SelectionChanged
In this article