Sitecore has really cool features to implement. One of them
is creating custom reports in the Experience Analytics Dashboard. Sometimes,
customers need to know essential information in order to improve their website.
In order to improve the website content and words used in
its pages (SEO), the customer needs to know what are the most used words in the
site search. Therefore, I am going to walk you through the steps to track the
words used in the site search and creating a report that displays those words
and how many times are they being searched for.
By default, the internal search keywords are not being
tracked in Sitecore. Therefore, in order to track them, appropriate search
event should be registered when the search occurs.
Following code should be added when the user searches for a
word in the site, and hits submit:
The above code means
that the search keyword is being tracked and saved in Interactions table in the
analytics mongoDB:
The data then gets aggregated to the “Fact_SiteSearches”
table in the Analytics database in SQL.
We’re almost there! All what we have to do now is to create
a custom report in the Experience Analytics Dashboard to show the words and
their count.
To create a report page, you should do the
following:
- You should have Sitecore rocks installed and a connection created to your website.
- Navigate to the core database in the website content tree using the following path: core/sitecore/client/Applications/ExperienceAnalytics/Dashboard
- Right click on any report category (for example Aquisition), and click on Add – New Item.
- Select the “ExperienceAnalyticsReportPage” template, and enter a term (recommended to start with “experienceanalytics”).
- Click Ok.
- There will be PageSettings created by default under the report item you just created.
Now, we have to choose a chart component to the report
created. In order to do so, follow the below steps:
- In Sitecore Rocks, right click on the report page item you created, and click on Tasks – Design Layout.
- In the Design Layout, click on Add Rendering.
- In the dialog box, select a chart control to use for your report (Example: select an “ExperienceAnalyticsBarChart” if you want to display a bar chart).
- Click Ok after choosing the rendering you want.
After that, you need to add a parameters item to configure
the report metrics (which will be “Count” in our example):
- Right click on the PageSettings item that is under the report item that you created and click Add- New Item.
- We will have to choose the “ExperienceAnalyticsBarChart Parameters” since that we chose the “ExperienceAnalyticsBarChart” rendering.
- Enter a proper name for it and hit Ok.
- Double click on the new parameter that you added in order to configure the metrics there.
- Choose the “Count” option from the “metrics” field and hit save.
Last step we should do is to bind the bar chart we created
with the parameters item that we added. This is done by doing the following:
- Right click on the report item and choose Task - Design Layout.
- Double click the chart item “ExperienceAnalyticsBarChart control”. In the Edit Rendering Properties box – Behaviour – Datasource, browse the location of the parameter you created.
- Click Ok.
We are done now! You can go the Experience Analytics
dashboard to check the report you created:
Note: The data is being displayed from the view that is
in the Analytics database (dbo.SiteSearches)
Happy Sitecore Coding!
No comments:
Post a Comment