Cancel tracking on a specific page

Abstract

How to prevent tracking on a specific page.

If you are using the Tracker API to collect information on your website but, for a specific page, you want to cancel tracking, you can mark the page as cancelled so that any changes to the interaction connected to the page are reverted.

To cancel page tracking:

  1. In the Sitecore.Analytics.ITracker.CurrentPage property or the Sitecore.Analytics.Tracking.CurrentInteraction.CurrentPage property, access the Sitecore.Analytics.Tracking.ICurrentPageContext method.

  2. Add the Cancel () method to the current page, for example:

    Sitecore.Analytics.Tracker.Current.CurrentPage.Cancel();
    
    Sitecore.Analytics.Tracker.Current.Session.Interaction.CurrentPage.Cancel();

.