We do not want certain request to be tracked for analytics data say for example API
calls.
How we can achieve this using Sitecore config
change?
We are using Sitecore 8.2 update 3.
Sitecore Stack Exchange is a question and answer site for developers and end users of the Sitecore CMS and multichannel marketing software. It only takes a minute to sign up.
Sign up to join this communityThe Sitecore.config
file has a node called tracking/untrackedPages
. Sitecore does not track files that are listed in this node. By default, these files are not tracked.
We can add entry to avoid tracing for API
-calls setting path attribute /api/*
.
See below config setting:
<tracking>
<untrackedPages>
<add path="/api/*" />
<add path="/sitecore/default.aspx" />
<add path="/sitecore/service/error.aspx" />
<add path="/sitecore/service/Heartbeat.aspx" />
<add path="/sitecore/service/keepalive.aspx" />
<add path="/sitecore/service/nolicense.aspx" />
</untrackedPages>
</tracking>
Files are referenced by their relative URLs. There is also a tracking/untrackedPages
node in the App_Config\Include\ Sitecore.Analytics.Tracking.config
file. Sitecore merges the nodes when it read the config files.
The recommended way to add files is using patch files instead of editing the config files directly. This file describes the include file patch process.
You can access the list of pages that are untracked in code by using the UntrackedPages
property of the Sitecore.Analytics.Configuration.AnalyticsSettings
class.
Sitecore.Analytics.Pipelines.StartAnalytics.CheckPreconditions
processor does not include this functionality.
Jun 7, 2019 at 15:17