Out of the box Kentico provides clients an easy way of managing their EMS and web analytics data, however as client demands increase we are regularly being asked to implement custom activity tracking on sites as they strive to make more effective use of their site. There are many ways you can skin a cat but for this example we’re going to at the Kentico reporting module https://docs.kentico.com/display/K9/Creating+reports and how it can be used to display EMS data that is easy to consume from a client perspective.

Conversion rate optimisation is using analytics data to increase the conversion rate of your website.   Our Client Services Director, Claire, wrote a blog on the principle here 

One of the most requested things clients are wanting to track is the engagement on their “Contact Us” form; there are multiple different things you could possibly want to track here such as, but not limited to:

  • Time taken to complete each form element – Allowing you to analyse which fields take your users longest to complete.
  • Validation errors – Which fields users have issues completing without errors.
  • Last field interacted with – Allowing you to see which field the users most commonly abandon your form on.

For our particular example we’re going to look at how we can track engagement of a basic multi-step form. The layout of our form is shown below and we’re going to be tracking the following and then further breaking this down by device type (mobile, tablet and desktop):

  • Total Views (How many people have been shown the form)
  • Step 1 interaction (How many people started filling out step 1)
  • Step 1 completion (How many people completed step 1)
  • Step 2 interaction (How many people started filling out step 1)
  • Step 2 completion (How many people completed step 2

Tracking Interaction

In order to track whether a user has interacted with a particular form step we need to make an AJAX request which logs a custom EMS activity stating this. In our particular example we’re going to use WebAPI (see how to set this up with Kentico here https://docs.kentico.com/display/K9/Using+ASP.NET+Web+API+with+Kentico) however it would work just as well using ASMX web services too.

Our WebAPI Controller

The following code is for our generic WebAPI controller that can be used to log a custom EMS activity from an AJAX request. NOTE: The following code is for demonstration purposes only and should be split to use a service architecture keeping all logic out of the controller itself.

Our JavaScript

The following JavaScript function binds itself to all inputs on our contact form and logs an activity once an input on the current form step is changed; we ensure that this is only logged once per session using a cookie.

Tracking Step Completion

Now that we’re tracking whether users are interacting with our form, we need to track which steps they are completing in order to see which steps they are abandoning the form on. In comparison to tracking the interaction, this part can be done simply by placing a few lines into your form buttons click event, as shown below. As was stated previously you should be structuring your code correctly to avoid repetition and as such should have a service you can call below to log the activity:

Similar code should be added to the load event of your contact form web-part in order to track the number of unique views:

Kentico Reporting

The best resource for a guide on how to setup a new report is the Kentico documentation (https://docs.kentico.com/display/K9/Creating+reports).
You’re going to need to setup a new report with the following parameters:

  • DateFrom
    • Type: DateTime
  • DateTo
    • Type: DateTime
  • Device
    • Type: Text
    • Drop-down list (Desktop, Tablet, Mobile)

Once the parameters are setup you need to add a new report table (a graph/chart could also be used) that contains the following SQL query:

The End Result

Below is a similar report to what you should see when in the report “View” tab. The controls at the top of the report give the client the flexibility to pin down exactly which devices their form performs best on and whether this differs throughout different times of the day/month.

Hopefully this is enough information to help you get started and building your own custom reports in Kentico. Remember, a Kentico report just uses standard T-SQL syntax, meaning what data you can display in these reports is effectively limitless as long as you are able to retrieve it somehow from the database.