Personalization Effect Tracking in Sitecore and the Unknown Limits That Can Break Pages

A team member came to me this week with an exception I haven't seen before, which was “Too many variables in the testset”. Searching online was fruitless, so I wanted to share the reason and workaround for this bug.


Personalization Effect Tracking Limits

Our Authors, like most of out there don't know about the limitations of personalization effect tracking, because it isn't documented. There can be no more than 16 personalization rules with personalization tracking enabled on any page at a given time. If you're authoring a page and exceed this limit, you'll see an error like this:

ERROR [Content Testing]: General error when evaluating test exposure.
Exception: System.InvalidOperationException
Message: Too many variables in the testset
Source: Sitecore.ContentTesting
   at Sitecore.ContentTesting.Models.TestSet.Builder.AddVariable(Guid id, String name, Guid type, Nullable`1 originalValueId)
   at Sitecore.ContentTesting.Pipelines.AddPersonalizationVariables.AddRules.Process(AddPersonalizationVariablesPipelineArgs args)
   at (Object , Object )
   at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args)
   at Sitecore.ContentTesting.Pipelines.AddPersonalizationVariables.AddPersonalizationVariationsPipeline.Run(AddPersonalizationVariablesPipelineArgs args)
   at Sitecore.ContentTesting.TestManager.GetTestSet(IEnumerable`1 definitions, Item item, ID deviceId)
   at Sitecore.ContentTesting.Data.SitecoreTestExposureManager.ExposeTest(ITestConfiguration testConfiguration, Item item)

And we always like to see the pretty yellow screen so here's a capture of that:



How to Work With This Limitation?

Fear not, inspired authors, there's a way to work around this issue! Simply go into components on the page and uncheck, “Track effect of personalization on this component” until you are below the limit. 

You might see the above error when trying to disable this option. The workaround is to remove components from the page until you're back to only 16, and then start disabling tracking.




What's Next for This Issue?

The issue has been identified with Sitecore as a bug (ref 444276), and will be fixed in future releases. Hope this helps!