I am using our own Sitecore Error Manager in a Sitecore 8.2 project. If an item is not found or an error occurs, our error page is called within the current client request. This error handler calls a configured Error content page within Sitecore.

Since the introduction of the xDB, a call to this page takes > 10 seconds before the internal request finishes. This happens, because we forward all client cookies to this call, including the Analytics cookie.

This happens because the user currently has an open request. The nested request runs into the session lock which eventually get released.

Question: Is it possible to disable the Tracker for this nested request by request parameter or a cookie or something? It is not neccessary at all. Not forwarding the analytics cookie is my least favorited solution since the request would be tracked with a new visitor session, which fills the contacts with garbage data.

I tried to stop the tracking in the Analytics settings of the nested page itself but had no luck with this. The problem still appears.

In your custom processor, you'll need to set Tracker.Enabled to false based on some condition. For example, you can do it if a certain cookie is present or if a custom query string parameter takes a specific value.

Hi Dmytro. Method 1 is probably the way to go, but i have to think about where to place something like this in a MVC solution. But probably this will not work because the lock is burried deeper in the whole thing. Method 2 is what i already tried and method 3 is no solution because it is really just for specific requests and not for whole sites (which would fix the issue).
– Pascal MathysOct 17 '16 at 12:44

The approach in Method 4 is the way to go! I will integrate such a processor into the Error Manager module so that only the Error Manager requests are able to force disable the tracker. Thanks for your help!
– Pascal MathysOct 17 '16 at 13:20

The problem with this approach is that the xDB pipelines will be executed before your code. For example, tracker initialization and contact locking logic will still be used, which is what the OP is trying to prevent.
– Dmytro Shevchenko♦Oct 17 '16 at 12:37

I found that I needed to do both this and the accepted answer to get my pages not to show up in analytics. Simply setting Tracker.Enabled to false still allowed the whole interaction to be saved to mongodb.
– Dan SinclairMay 11 '17 at 18:50