Skip to content

Reporting and Engagement

Reports is a component in Kitsune which enables reporting and proactive engagement emails to be sent to your customers. You can configure what and when emails should be sent through this component. You also have complete control over the email template. Edit it the same way you edit HTML pages in Kitsune and you are good to go. Data-points of the reports are provided to you by a system defined language which you can refer to in the language editor section of the IDE.

Enabling Reports

Step 1:

Open your Kitsune project. Under 'components' menu, click on 'reports'. Click 'enable' in the confirmation dialog. This will add the required files to your project automatically and will also enable the reporting service. A new folder '__components' will be added with a subfolder 'reports' under which your files will be located.

Step 2:

Design an email template which you want to send as a report. Follow the system defined language to know what is being exposed and how you can access it. Update that email template file name in kitsune-settings.json under reports section.

Note: A predefined ready-to-use performance report will be added to your project under the '__components/reports/templates' folder. It makes use of the language properties to the full extent to send a good looking report to your customers.

Step 3:

Once you are done with your customizations (logo etc.), you can build the project and check the preview by right click > preview page on that file in the left panel.

Report settings reference

Root object

Property nameDate typeApplicable valuesDescription
notificationsarrayArray of NotificationItemAn array of notifications you want to send to your customers. For details on each notification see notification item reference
settingsobjectSee Settings referenceSettings to be used by the reports component like custom email SMTP details etc.

NotificationItem object

Property nameDate typeApplicable valuesDescription
typestringPERIODIC_PERFORMANCE_REPORTPeriodic Performance Report sends information like visits, visitors, top traffic sources and most visited pages periodically to your customers
periodnumberNo. of daysSpecifies the period of periodic reports in no of days
emailobjectSee NotificationItem.Email referenceSpecifies email notification details

NotificationItem.Email object

Property nameDate typeApplicable valuesDescription
bodystringValid HTML file pathThe path of HTML template file to be used as email body - relative to the root directory

Settings object

Property nameDate typeApplicable valuesDescription
emailobjectSee Settings.Email referenceCustom email SMTP details to be used for sending emails

Settings.Email object

Property nameDate typeApplicable valuesDescription
hoststringValid SMTP hostThe host provided by your email service provider
portnumberValid SMTP portThe port provided by your email service provider
usernamestringNon-empty stringThe username provided by your email service provider
passwordstringNon-empty stringThe password provided by your email service provider
ssl_enabledbooleantrue/falseEnable or disable SSL

Sample reports section in kitsune-settings.json for enabling periodic performance reports to be sent to your customers every 7 days.

  "reports": {
        "notifications": [
                "type": "PERIODIC_PERFORMANCE_REPORT",
                "period": 7,
                "email": {
                    "body": "periodic_performance_report.html"
        "settings": {
            //Fill the details below to use your own email service provider or remove this section to use Kitsune's default email service provider
            "email": {
                "host": "",
                "port": 0,
                "username": "",
                "password": "",
                "ssl_enabled": true

Report language reference

Reports component gets its data from reports language. Data like visits, visitors etc is provided to you by reports language so that you can use them out of the box and focus only on the design of the email.

All the properties of reports language can be accessed using report.<property_name>

The following are available properties provided by reports language :

Report object

Property nameDate typeDescription
website_domainstringDomain of the customer
website_performancePeriodicPerformanceStatisticsWebsite performance statistics in current and previous window

PeriodicPerformanceStatistics object

Property nameDate typeDescription
periodnumberPerformance report period in days given in kitsune-settings.json and it defines the window size
current_windowPerformanceStatisticsPerformance statistics in the current window
previous_windowPerformanceStatisticsPerformance statistics in the previous window

PerformanceStatistics object

Property nameDate typeDescription
date_rangeDateRangeThe start date and end date of the window
visits_countnumberNumber of visits in the window
visitors_countnumberNumber of visitors in the window
top_referrersarray of TopReferrersItemList of top referrers from which your website got the traffic in the window
total_visits_from_top_referrersnumberTotal visits received from the top referrers in the window
most_visited_pagesarray of MostVisitedPagesItemList of the most visited pages in the window
total_visits_from_most_visited_pagesnumberTotal visits received from the most visited pages in the window

TopReferrersItem object

Property nameDate typeDescription
source_websitestringThe source website of the visits
visits_countnumberNo of visits received from the source website

MostVisitedPagesItem object

Property nameDate typeDescription
pagestringPage path
visits_countnumberNo of visits to this page

DateRange object

Property nameDate typeDescription
start_datestringStart date
end_datestringEnd date