Skip to content

Latest commit

 

History

History
182 lines (137 loc) · 8.35 KB

eqatec-analytics-application-integration.md

File metadata and controls

182 lines (137 loc) · 8.35 KB
title page_title description slug tags navigation_visible published position
Telerik Analytics Integration
Telerik Analytics Integration
Using Analytics enables you to trace certain features of the controls and get statistics about their usage.
eqatec-analytics-application-integration
telerik,analytics,integration
false
false
14

Telerik Analytics Integration

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 occurred during the execution. With Q3 2013 release Telerik UI for {{ site.framework_name }} provides integrated support for Telerik Analytics. Using Analytics you will be able to trace certain features of the controls and get statistics about their usage.

In order to use the service you should contact sales@telerik.com and they will help you get your product key. For more information, please check out the Introduction to Telerik Analytics topic.

{% if site.site_name == 'Silverlight' %} Then you can create a new Telerik Silverlight Application with enabled Analytics support or you can enable it in an existing project.

Both options are explained in details below.

How to Create a New Project Supporting Analytics

Using the [Telerik Visual Extensions]({%slug radcontrols-for-silverlight-vs-extensions-project-configuration%}) you can quickly create an application configured to use Telerik UI for Silverlight.

After including the needed Telerik assemblies and setting a theme in the New Project Wizard, you will reach the following configuration screen: eqatec install 3

Enable the option for Analytics support and Finish the setup.

Please make sure that you have specified the correct key you got after registering your application on https://platform.telerik.com/.

The wizard references two additional Telerik assemblies ( EQATEC.Analytics.Monitor.dll and Telerik.Windows.Analytics.dll ) and initializes the Telerik.Windows.Analytics.TraceMonitor used to track the controls features usage in the App.xaml.cs file. The generated code will look like illustrated in Example 1.

[C#] Example 1: TraceMonitor initialization

{{region eqatec-analytics-application-integration_0}} public App() {
//The following code enables Telerik Analytics for your project var analyticsMonitor = Telerik.Windows.Analytics.TraceMonitor.Initialize(this, [product_key]); //Next Step: Enable analytics tracking for the Telerik controls that make sense to your business case. For example here is XAML code to enable tracking when a RadButton that downloads a file is clicked: //xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" //<telerik:RadButton Content="Click me" Height="50" telerik:Analytics.Name="DownloadButton" /> //For more information go to: http://www.telerik.com/help/wpf/eqatec-analytics-application-integration.html } {{endregion}}

where [product_key] will be replaced with the entered in the New Project Wizard value.

tipThe code related to Telerik Analytics is commented when a new project is created without enabling the Analytics option. {% endif %}

How to Add Support to Existing Applications

First, you will need to reference the EQATEC.Analytics.Monitor.dll and Telerik.Windows.Analytics.dll in your application. Note that these dlls are distributed together with the other assemblies in the Telerik UI for {{ site.framework_name }} suite.

Then, in order to configure the project to support Analytics, please add the code from Example 2 in the constructor of the App class.

[C#] Example 2: Configuring a project to support Analytics

{{region eqatec-analytics-application-integration_1}} public App() {
var analyticsMonitor = Telerik.Windows.Analytics.TraceMonitor.Initialize(this, [product_key]); } {{endregion}}

where [product_key] should be replaced with the product key you got after registering your application on https://platform.telerik.com/

How Analytics Works

This section demonstrates how Analytics works with Telerik controls. Let’s, for example, create a test application registered as AnalyticsTestApp in the Telerik Platform. Add a few controls that support Analytics to it.

[XAML] Example 3: Add controls

{{region eqatec-analytics-application-integration_1}} <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" /> {{endregion}}

All that is needed is to set the telerik:Analytics.Name attached property to the used in Example 3 RadComboBox and RadButton. Note that the set values will be used in the dashboard.

Example 4 shows how the updated code looks like.

[XAML] Example 4: Set Analytics.Name property

{{region eqatec-analytics-application-integration_2}} <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" /> {{endregion}}

To trace the features, please follow the next steps:

  • Run the project with the provided code

  • Select an item from the ComboBox and click the Button

  • Close the application.

  • Go to the Analytics Project Dashboard

  • Select the Live link:

eqatec dashboard 1

The next screen will list the live usage sessions: eqatec dashboard 2

Clicking on the Session link will show additional details about the session including the exact features used: eqatec dashboard 3

eqatec dashboard 3 1

If you go to the Feature Use link in the Dashboard panel, you will find information and statistics for the registered features for different periods of time: eqatec dashboard 4

Traceable Features in Telerik UI for {{ site.framework_name }}

Currently only 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.

You can find below a list of the controls and their features that support tracing:

Feature Feature Name
RadBusyIndicator
Show ShowIndicator
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
RadMenu
Click Click
RadRadioButton
Checked Checked
UnChecked UnChecked
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
RadToggleButton
Checked Checked
UnChecked UnChecked
RadTreeListView
Sort Sorted
Group Grouped
Filter Filtered