0

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.

2

The 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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.