The FFW team works with more than just Drupal and WordPress. We've built some award-winning Sitecore solutions as well, and in this Sitecore blog series, we'll be sharing our insights on refining Sitecore's search functionality to enhance the user experience.
Sitecore Experience Analytics provides dashboards and reports for marketers and marketing analysts to identify patterns and trends in experience data. Experience Analytics contains a number of reports that analyze how contacts engage with your website. This information can help you analyze the amount of traffic on your website, as well as the quality of that traffic.
All Sitecore Experience Analytics reports are available via the Experience Analytics application.
Sitecore provides the following default reports:
Acquisition tab reports (doc)
Behavior tab reports (doc)
Conversions tab reports (doc)
Detailed technical information for every report is available here.
How do the default Sitecore Experience Analytics Reports work?
In order to learn how to create custom reports, I’ll first check how the default reports have been built in Sitecore. Let’s use the Audience tab reports as an example. Here is how these reports look like in the Experience Analytics application.
We see that in the Audience section there are 5 different pages: Overview, Devices, Languages, Locations and Pattern matches. If we open them, we’ll find different reports built by various kinds of charts.
In the screen capture, I have opened the Overview page and it contains charts for Online interaction by visits and value per visit, Top counties by visits, Top cities by visits, Pattern matches by visits, and Top languages by visits.
Let’s find out how these pages are developed, so we can get a better understanding of how to build our custom reports.
All Experience Analytics reports pages and charts are located in the Sitecore Core database, in this location:
Let's open the Sitecore Desktop application, switch to the Core database and check what we can find there for the Audience tab reports.
Here we see the root item for the Audience section and under it all of the actual items for the pages we saw previously in the Experience Analytics application: Overview, Devices, Languages, Locations, and Pattern matches. The special thing about these pages is that
All of them are based on the Speak-DashboardPage template
All of them use the Speak-Layout layout
All of them have this PageSettings child item. (I’ll cover that later)
But where are the charts and how Sitecore pulls the analytics data displayed on these pages?
Let’s check the presentation details of the Overview page.
Among the Controls, we see many which just build the general layout of the page - header, logo, navigation, columns, etc. Most of these controls are used on all of the report pages in order to provide a unified presentation of the data. So, this group of controls (I would call it "structural“) is something we need to have on the report page but doesn’t create the actual charts.
At the bottom of the Controls list, we see the "*Chart“ controls. These are the controls which render the five charts that we saw in the Experience Analytics application on the Audience Overview page: Online interaction by visits and value per visit, Top counties by visits, Top cities by visits, Pattern matches by visits and, Top languages by visits.
Let’s open the ExperienceAnalyticsLineChart control and see what properties are available there, respectively how the data in the chart is loaded. To our surprise, we’ll find out that the properties are empty and we don’t even have configured data source. The reason for that is because the Experience Analytics is a SPEAK application, and these chart controls can only be edited in Sitecore Rocks. When we check the ExperienceAnalyticsLineChart control in Sitecore Rocks we’ll notice that its data source is the All Visits item under the PageSettings item. It ends up that every chart control has bounded data source item placed under the PageSettings item of the report page. Talking about these data source items, I should mention what is important about them. The most important fields are:
Title (Placed in the Appearance section. Gives the title of the chart)
Metrics (Placed in the Data section)
Segments (Placed in the Data section)
Metrics and Segments are the properties which define what actual data will be displayed on the chart. These are specific Sitecore terms which have relation to other terms like Dimensions, Filters, and Rules. I’ll cover all of these terms and how to use them later in the blog series.
Let’s summarize what we need to create a custom Sitecore Experience Analytics report.
All of the following steps should be performed using the Sitecore Rocks plugin for Visual Studio.
Create a new report page in the Core database, under
based on the Speak-DashboardPage template
Add a chart component to the report page (ExperienceAnalyticsLineChart,
ExperienceAnalyticsBarChart, ExperienceAnalyticsPieChart, etc.)
Create a parameters item under the PageSettings item of the report page. Use a corresponding template depending on the chart component type (ExperienceAnalyticsLineChart Parameters,
ExperienceAnalyticsBarChart Parameters, ExperienceAnalyticsPieChart Parameters, etc.)
Set the Metrics and Segments fields on the parameters item in order to adjust what data will be displayed in the chart component
Set the parameters item as a data source of the chart component
A great example is available in the official Sitecore documentation here.
As you can see, creating new Sitecore Experience Analytics reports is very simple, and straight forward process. My first advice when you create a custom report is to use the default ones as examples. I would say the hardest step in the process, is Step 4 because it needs a good understanding of some Sitecore Experience Analytics terms. I’ll cover these in the next blog posts. For some people, choosing the right chart component in Step 2 could also be challenging, simply because there is no easy way to find out how each chart looks. That’s why I’ve prepared this list of images covering all of the chart components.
Sitecore Analytics Reports Chart Components Cheatsheet
Experience Analytics Bar Chart
Experience Analytics List Control
Experience Analytics KPI Chart
Experience Analytics Bar Chart
Experience Analytics Line Chart
Experience Analytics Area Chart
Experience Analytics Pie Chart