Cancel tracking on a specific page
Version: 10.4
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:
-
In the
Sitecore.Analytics.ITracker.CurrentPageproperty or theSitecore.Analytics.Tracking.CurrentInteraction.CurrentPageproperty, access theSitecore.Analytics.Tracking.ICurrentPageContextmethod. -
Add the
Cancel ()method to the current page, for example:RequestResponseSitecore.Analytics.Tracker.Current.CurrentPage.Cancel(); Sitecore.Analytics.Tracker.Current.Session.Interaction.CurrentPage.Cancel();
.