This content applies to Optimizely Content Management System (CMS) versions 11.8.0 and higher.
When personalization is enabled and a requested content item uses visitor group personalization, then the visitor is evaluated against the used visitor groups and visitor groups criteria. The content displayed to the visitor is selected depending on which visitor groups match the request. Depending on the used criteria, this can cause tracking data to be stored in cookies and/or session state.
When personalization is disabled, no matching occurs and the visitor is not considered to be part of any visitor group. Instead, the visitor is displayed the "fallback content", if that is defined on the personalized content. When personalization is disabled, no state is stored in cookies or for the visitors' sessions.
There is an interface that can be implemented to control whether personalization should occur or not. The interface is specified as:
CMS includes an implementation that checks for presence of a [Do Not Track](🔗) header. If the header is present, no personalization is done for the request and no cookies are stored. It can be registered in `
ConfigureServices` in the startup, as in this example:
Another example could be to check for existence of a certain cookie which specifies that the visitor has agreed that visitor group personalization could occur. In that case, the site could have a field where the visitor can enable personalization. When the visitor selects that field, a cookie is added for the visitor. Such an example could look like:
### Check if personalization is enabled
IAggregatedPersonalizationEvaluator` component can be used to check if personalization is enabled for a request or not. The signature is similar to `
IPersonalizationEvaluator` and it returns an aggregated result from all registered `
IPersonalizationEvaluator` instances. If any personalization evaluator states that personalization should be disabled, then the aggregated evaluator states that no personalization should occur.