Web tracking is enabled in Sitecore XP by default. You can configure a website to require explicit consent from contacts before web tracking is run
starting from Sitecore XP 10.0. To not track contacts in earlier product versions, refer to the Solution section
.To disable web tracking, consider one of the following options compatible with the affected product version:
- To disable Sitecore Analytics for all users, and, hence, to stop creating and using cookies, proceed as follows:
- For Sitecore XP 8.1.0 - 8.2.7:
- Disable xDB in the Sitecore.Xdb.config file as specified here.
- Disable xDB Tracking in the same Sitecore.Xdb.config file according to the following instructions.
- Set enableTracking attribute to false in all sites, defined in the section of your configuration.
Note: There is no need to disable data storing in the Sitecore Analytics cookie, because this cookie will not record any data, when xDB is disabled.
- For Sitecore XP 9.0.0 - 9.3.0, use the following instructions.
- To disable web tracking for a specific user, you can customize the behavior to prevent starting Sitecore Analytics if a user does not allow the use of cookies.
Create an extra custom processor in the startAnalytics pipeline that will check a custom condition and abort the pipeline. The following example of the code is given only as a starting point:
public class CheckConsent
{
public override string Process(PipelineArgs args)
{
var consentIsGiven = false;
//you code for checking the consent goes here
consentIsGiven = ...
if (!consentIsGiven)
{
args.AbortPipeline();
}
}
}