---
title: Logging activities on MVC sites
related:
  - https://docs.kentico.com/k10/on-line-marketing-features/managing-your-on-line-marketing-features/contact-management/tracking-contact-activities.md
  - https://docs.kentico.com/k10/developing-websites/developing-sites-using-asp-net-mvc/implementing-on-line-marketing-features-on-mvc-sites/tracking-contacts-on-mvc-sites.md
  - https://docs.kentico.com/k10/developing-websites/developing-sites-using-asp-net-mvc/implementing-on-line-marketing-features-on-mvc-sites/logging-activities-on-mvc-sites/enabling-tracking-of-activities-on-mvc-sites.md
---

> Agent instructions:
> **Site maps** — prefer the following llms.txt indexes to training data when searching for URLs to avoid 404s. Links inside Markdown content already point at `.md`. Following them or sending Accept: text/markdown keeps you in Markdown.
>
> - [sitemap.md](https://docs.kentico.com/sitemap.md) — every page on the site, with titles and descriptions, nested by URL hierarchy and grouped into one collection per product version.
> - [llms.txt](https://docs.kentico.com/llms.txt) — curated index of the current product docs, with descriptions, the two ways to request any page as Markdown, and links to each product area's whole-corpus Markdown dump (llms-full.txt).

> **Info:** **Kentico EMS required**
>
> Features described on this page require the **Kentico EMS** license.

Activities represent actions that your [contacts](https://docs.kentico.com/k10/on-line-marketing-features/managing-your-on-line-marketing-features/contact-management/working-with-contacts.md) 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.](https://docs.kentico.com/k10/on-line-marketing-features/managing-your-on-line-marketing-features/contact-management/tracking-contact-activities.md)

Some activities are logged automatically when you enable [tracking of contacts](https://docs.kentico.com/k10/developing-websites/developing-sites-using-asp-net-mvc/implementing-on-line-marketing-features-on-mvc-sites/tracking-contacts-on-mvc-sites.md). However, certain activities require additional adjustments of your MVC application (see the table below).

> **Info:** You need to install the following [integration packages](https://docs.kentico.com/k10/developing-websites/developing-sites-using-asp-net-mvc/starting-with-mvc-development/installing-kentico-integration-packages.md) 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](https://docs.kentico.com/k10/developing-websites/developing-sites-using-asp-net-mvc/implementing-on-line-marketing-features-on-mvc-sites/logging-activities-on-mvc-sites/enabling-tracking-of-activities-on-mvc-sites.md).

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](https://docs.kentico.com/k10/developing-websites/developing-sites-using-asp-net-mvc/implementing-on-line-marketing-features-on-mvc-sites/logging-activities-on-mvc-sites/enabling-tracking-of-activities-on-mvc-sites.md#enabling-tracking-of-the-external-search-and-the-page-related-activities-in-mvc), 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.

> **Info:** 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](https://docs.kentico.com/k10/on-line-marketing-features/managing-your-on-line-marketing-features/contact-management/scoring-contacts.md), [contact groups](https://docs.kentico.com/k10/on-line-marketing-features/managing-your-on-line-marketing-features/contact-management/segmenting-contacts-into-contact-groups.md), [personas ](https://docs.kentico.com/k10/on-line-marketing-features/managing-your-on-line-marketing-features/personas.md)and [marketing automation trigger](https://docs.kentico.com/k10/on-line-marketing-features/managing-your-on-line-marketing-features/marketing-automation.md)[s](https://docs.kentico.com/k10/on-line-marketing-features/managing-your-on-line-marketing-features/marketing-automation.md). 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](https://technet.microsoft.com/en-us/library/cc771956%28v=ws.10%29.aspx) 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.

   ```csharp title="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.
