---
title: Enabling marketing email tracking
related:
  - https://docs.kentico.com/13/on-line-marketing-features/managing-your-on-line-marketing-features/email-marketing/tracking-marketing-emails.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).

When using [email feeds](https://docs.kentico.com/13/on-line-marketing-features/managing-your-on-line-marketing-features/email-marketing.md), it is important to determine their overall effectiveness and optimize the individual marketing emails according to the results. You can achieve this by tracking the sent emails and monitoring the reactions of recipients. When you have [tracking](https://docs.kentico.com/13/on-line-marketing-features/managing-your-on-line-marketing-features/email-marketing/tracking-marketing-emails.md) enabled for an email feed (opened emails and clicked links), the system collects data by processing hidden image requests and link redirects.

First, you need to enable on-line marketing if you want to use marketing email tracking for contact group [recipients](https://docs.kentico.com/13/on-line-marketing-features/managing-your-on-line-marketing-features/email-marketing/managing-marketing-email-recipients.md):

1. Go to **Settings -> On-line marketing**.
2. Ensure that the **Enable on-line marketing** setting is enabled for your website.
3. Click **Save**.

Individual marketing emails have tracking enabled by default. You can check the configuration of individual email feeds:

1. Open the **Email marketing** application on the **Email feeds** tab.
2. **Edit** () an email campaign or a newsletter.
3. Switch to the **Configuration** tab.
4. Make sure that **Track opened emails** and **Track clicked links** are enabled.
5. Click **Save**.

The system now measures the statistics of marketing emails sent to recipients.

> **Info:** **Note**
>
> - You cannot use tracking retroactively for emails that have already been sent before you enabled the settings.
> - The system does not include draft emails in the tracking statistics.
> - Two same URL paths (in a case-insensitive manner) are always represented by an identical tracking link.

## Enabling email tracking in the live site application

Developers additionally need to enable processing of marketing email tracking requests on the side of the live site application. This allows email tracking to work even when the Xperience administration application is not publicly available.

The base URL of the tracking links uses the site's _Presentation URL_ and all settings related to email marketing that you configure in the administration application apply (both global settings and the configuration of individual email feeds).

Perform the following steps to register email tracking functionality for your application:

<!-- dev-model:mvc start -->

**MVC 5 development model.** Applies only when building with ASP.NET MVC 5. If this page also covers ASP.NET Core, that version is in its own block.

1. Open your MVC project in Visual Studio.
2. Enable the email tracking feature by calling the **UseEmailTracking** method of the _ApplicationBuilder_ instance.

   - Enable the feature at the start of your application's life cycle, for example in the **Application\_Start** method of your project's **Global.asax** file.

     > **Info:** MVC projects created by the [installer](https://docs.kentico.com/13/installation/installing-xperience.md) contain the _ApplicationConfig_ class, whose _RegisterFeatures_ method is called in the _Application\_Start_ method by default. You can use this class to encapsulate all of your _ApplicationBuilder_ code (enabling and configuring of Xperience MVC features).

     > **Note:** **Note**: The feature must be enabled **before** you register routes into the application's _RouteTable_. The _Kentico().MapRoutes()_ method adds required routes based on the set of enabled features.

     ```csharp

     using Kentico.Newsletters.Web.Mvc;
     using Kentico.Web.Mvc;

     ...

     protected void Application_Start()
     {
         ...

         // Gets the ApplicationBuilder instance
         // Allows you to enable and configure selected Xperience MVC integration features
         ApplicationBuilder builder = ApplicationBuilder.Current;

         // Enables the email tracking feature, registers the following routes by default:
         // "CMSModules/Newsletters/CMSPages/Track.ashx" route for opened marketing email tracking
         // "CMSModules/Newsletters/CMSPages/Redirect.ashx" route for clicked link tracking
         builder.UseEmailTracking();

         ...
     }

     ```

<!-- dev-model:mvc end -->

<!-- dev-model:core start -->

**ASP.NET Core development model.** Applies only when building with ASP.NET Core. If this page also covers MVC 5, that version is in its own block.

1. Open your live site project in Visual Studio.
2. Edit your application's startup class (**Startup.cs** by default).
3. [Enable](https://docs.kentico.com/13/developing-websites/developing-xperience-applications-using-asp-net-core/starting-with-asp-net-core-development/enabling-xperience-features-in-asp-net-core-applications.md) the email tracking feature by calling the **UseEmailTracking** method of the _IFeaturesBuilder_ delegate passed to the _IServiceCollection.AddKentico_ method within _ConfigureServices_.

   ```csharp

   using Kentico.Newsletters.Web.Mvc;
   using Kentico.Web.Mvc;

   ...

   public void ConfigureServices(IServiceCollection services)
   {
       ...
       // Enables and configures Xperience features
       services.AddKentico(features =>
       {
           // Enables the email tracking feature, registers the following routes by default:
           // "CMSModules/Newsletters/CMSPages/Track.ashx" route for opened marketing email tracking
           // "CMSModules/Newsletters/CMSPages/Redirect.ashx" route for clicked link tracking
           features.UseEmailTracking();
           ... 
       });

       ...
   }

   ```

<!-- dev-model:core end -->

Enabling the _UseEmailTracking_ feature ensures that the system registers routes that handle opened email and clicked link tracking requests

When a recipient opens an email or clicks a link in the content, the system automatically sends the tracking requests through the live site. The registered routes ensure that the tracking data is processed and logged into the Xperience database.

## Excluding links from tracking

To manually disable tracking for a link in a marketing email:

1. Open the **Email marketing**application on the **Email feeds** tab.
2. **Edit** () an email campaign or a newsletter.
3. On the **Emails** tab, edit an email that has not been sent yet.
4. On the **Content** tab, click **Source** on the editor toolbar to switch to source mode.
5. Insert the **tracking="false"** attribute into the **** tag of the given hyperlink.

For example: _Kentico_

In addition, tracking excludes the following links automatically:

- Unsubscription links generated by the _{% EmailFeed.UnsubscribeFromEmailFeedUrl %}_ expression (marketing emails keep separate unsubscription statistics by default)
- Links to local anchors within the content of the email
