Logging activities on MVC sites

Kentico EMS required

Features described on this page require the Kentico EMS license.

Activities represent actions that your contacts perform. For example, the system logs activities when visitors register as a member of a site or when visitors sign in to a site. The data gathered in the activity log allows you to evaluate the behavior of your website’s users and visitors. To learn more about activities, see Tracking contact activities.

Some activities are logged automatically when you enable tracking of contacts. However, certain activities require additional adjustments of your MVC application (see the table below).

You need to install the following integration packages into your MVC project to track all supported types of activities:

  • Kentico.Activities
  • Kentico.Activities.Web.Mvc

Overview of activities supported in MVC

E-commerce

Product added to shopping cart

The activity is logged automatically.

Product added to wishlist

The activity is logged automatically.

Product removed from shopping cart

The activity is logged automatically.

Purchase

The activity is logged automatically.

Purchased product

The activity is logged automatically.

Shopping cart abandoned

The activity is logged automatically.

On-line marketing

Clicked link in marketing email

The activity is logged automatically.

Opened marketing email

The activity is logged automatically.

Subscription to a newsletter

The activity is logged automatically.

Unsubscription from a single email feed

The activity is logged automatically.

Opted out from all marketing emails

The activity is logged automatically.

Membership

User login

The activity is logged after adjusting your MVC application.

User registration

The activity is logged after adjusting your MVC application.

Other

Form submission

The activity is logged automatically.

Page

Landing page

The activity is logged after adjusting your MVC application.

Page visit

The activity is logged after adjusting your MVC application.

Search

External search

The activity is logged after adjusting your MVC application.

Internal search

The activity is logged automatically.

For details on logging of activities that require additional adjustments of your MVC application, see Enabling tracking of activities on MVC sites.

Please note that the process for setting up logging of the External search and the Page related activities is different from setting up logging of the Membership related activities. To log theExternal searchand thePagerelated activities, you need to adjust your MVC application only once by registering routes that receive logging requests. However, to log the Membership related activities, you need to adjust your MVC application for each of them separately by calling the logging service in your own controllers.

The Landing page activity logging is affected by the CMSLandingPageLoaded cookie key, which expires after 20 minutes. The expiration period of the key is renewed every time the website is accessed again.

Configuring activity and contact updates processing

When logging activities from MVC applications, the API does not ensure recalculation of contact scores, contact groups, personasand marketing automation triggers. For performance reasons, these recalculations are performed by the Kentico application. Because the Kentico application itself does not usually receive traffic from site visitors, you need to keep the application alive. For example, you can set the Idle Time-out (minutes) setting of your IIS application pool to 0.

By default, the system batch processes activities and contact detail updates every 10 seconds. You can configure the processing interval separately for the Kentico and MVC application. Adding the below key to the MVC application affects at what interval the logged activities and contact detail updates are saved from the memory into the database. Adding the below key to the Kentico application affects how often Kentico recalculates the data that could be affected by activities and contact updates.

If your system processes a large number of activities and contact updates, you may need to increase the default interval.

  1. Open your project’s web.config file.

  2. Add the following key into the appSettings section of the file. Increase the value to reflect how often you want the activities and contact updates to be processed.

    Processing activities and contact updates every 30 seconds
    
    
    
     <add key="CMSProcessContactActionsInterval" value="30" />
    
    
     
  3. Save the file.

The system now processes activities and contact detail updates in accordance with the configured intervals.