Enable application features

Some features provided by the system need to be explicitly enabled in the ASP.NET Core application’s startup class.

Features are enabled within the IServiceCollection.AddKentico call when building the application using WebApplicationBuilder. Each feature is enabled with a corresponding Use*FeatureName* extension method:

C#
Program.cs


WebApplicationBuilder builder = WebApplication.CreateBuilder(args);

builder.Services.AddKentico(features =>
{
    features.Use*FeatureName*();
});

The following table provides an overview of all features that can be enabled: 

Feature

Extension method

Description and additional notes

Contact activity tracking

UseActivityTracking
(Kentico.Activities.Web.Mvc)

Required for page-related activities that need to be logged manually in your code. See Set up activities for more information.

Content tree-based routing

UseWebPageRouting
(Kentico.Content.Web.Mvc.Routing)

Enables Content tree-based routing and registers the resulting routes.

Cross-site tracking

UseCrossSiteTracking
(Kentico.OnlineMarketing.Web.Mvc)

Registers endpoints that process contact and activity tracking requests from external sites.

Email statistic logging

UseEmailStatisticsLogging
(Kentico.Web.Mvc)

Enables tracking of statistics for emails sent from Xperience, including the number of sent emails, email opens and clicked links. Only applies to emails created in the Xperience administration within an email channel application.

When a recipient opens an email or clicks a link in its content, a hidden request is sent to the Xperience application. Enabling the UseEmailStatisticsLogging feature registers endpoints that process the tracking requests and log the appropriate email statistics.

Page builder

UsePageBuilder
(Kentico.PageBuilder.Web.Mvc)

See Page builder development for more details and additional configuration options.