Sitecore rules are not working after starting the test

S

Before jumping into troubleshooting specifics, it’s important to level-set what personalization rules are and how they work in Sitecore. At a high level, personalization rules allow you to customize page content and offer by mapping dynamic conditions to associated actions.

For example, you may want to display a 10% off coupon banner specifically for new website visitors arriving from New York based on their geo-location and number of prior sessions. Or recommend top-selling items for return shoppers who have previously purchased within a certain category.

Behind the scenes, Sitecore evaluates registered rules on each page request to check if defined conditions pass for the current user and session. When positive, the platform will execute any actions linked to those passing rules – such as updating a component with a region-specific discount code or retrieving an array of products personalized to purchase history.

This entire mechanism of flexible content tailoring makes up the foundation of impactful omnichannel personalization with Sitecore. And it can scale across all your owned and paid channels – websites, mobile apps, email campaigns, onsite kiosks, and more.

If the error message still occurs, proceed to the next steps to verify the existence and accessibility of the Sitecore.ContentTesting.Requests.Controllers.PersonalizationRule class.

7. Open the Sitecore.ContentTesting.Requests.Controllers.PersonalizationRule.cs file.

  • Navigate to the App_Code folder of your Sitecore website.
  • Right-click on the Sitecore.ContentTesting.Requests.Controllers.PersonalizationRule.cs file and select Open with.
  • Choose your preferred text editor to open the file.

8. Check if the Sitecore.ContentTesting.Requests.Controllers.PersonalizationRule class exists.

  • Press Ctrl+F to open the Find dialog box.
  • Search for the text public class PersonalizationRuleController.
  • If the class exists, you will see its definition in the search results.

9. Check if the Sitecore.ContentTesting.Requests.Controllers.PersonalizationRule class is public.

  • Look at the declaration of the Sitecore.ContentTesting.Requests.Controllers.PersonalizationRule class.
  • Make sure that the public modifier is present before the class keyword.

If the class does not exist or is not public, follow the steps below to create or modify it.

10. Create the Sitecore.ContentTesting.Requests.Controllers.PersonalizationRule class (if it doesn't exist).

  • Right-click on the App_Code folder and select Add New Item.
  • Select Class from the list of templates and click Add.
  • Enter Sitecore.ContentTesting.Requests.Controllers.PersonalizationRule as the class name and click OK.
  • In the code editor, add the following code:
public class PersonalizationRuleController : Controller
{
    // ...
}
  • Save the file.

11. Make the Sitecore.ContentTesting.Requests.Controllers.PersonalizationRule class public (if it's not).

  • In the code editor, find the declaration of the Sitecore.ContentTesting.Requests.Controllers.PersonalizationRule class.
  • Add the public modifier to the class declaration, if it's not already there.
  • Save the file

A Step-By-Step Guide to Debugging Personalization Rules

With an awareness of what can commonly go wrong with personalization rules after starting new tests, you need an efficient and structured gameplan for diagnosing and addressing errors as they arise:

  1. Replicate Issue First, independently reproduce the problem by logging in as your target users and initiating relevant sessions. Experiencing the production fire firsthand is invaluable for pinpointing nuances. Take screenshots of failing personalizations/actions when possible.
  2. Confirm Test Configuration Next, cross check that your active tests are properly configured within the Content Testing UI and aligned with rule parameters. Scan for overlaps across targeted visitor segments that could conflict with rules. Also validate related success/goal events are being captured accurately.
  3. Check Personalization Conditions If tests are verified, shift focus to validating conditional logic across impacted rules. Logically map expected user properties and events to rule conditions, confirming accuracy. Consider temporarily simplifying logic to isolate problems.
  4. Review Targeted Renderings In tandem, analyze any frontend components updated dynamically by impacted rules. Audit their personalization tab configuration and validate rule linkage. Test rendering directly with simplified rules/conditions if needed.
  5. Scan Recent Code Changes Code defects frequently cause personalization failures, so scan commits for potential breaking changes – especially across core rules engine classes within App_Code. Check access modifiers, inheritance chains, namespaces, assembly refs, file paths, etc. Roll back suspect commits to test.
  6. Enable Verbose Logging If tests and rules validate but errors continue, enable full verbose diagnostics logging for the rules engine in web.config. Reproduce issue then comb logs methodically for stack traces pointing to code defects. They’ll tell you exactly where logic is breaking.
  7. Watch Live Debug Output Supplement existing logging by debugging Sitecore directly via Visual Studio. Walk through page events loading personalized content in real time, watching variable states change. Use breakpoints to isolate fails.
  8. Refine Rules Gradually
    With the root cause identified via debugging tactics above, implement fixes or workarounds incrementally. Test simplified rule logic, then gradually refine complexity. Sync changes with test configurations to align targeting.

This combination of strategic analysis with hardcore technical debugging helps expose and fix all types of tricky personalization rule errors that tend to emerge unexpectedly after launching new tests. But problems will certainly resurface again in the future, so learning effective troubleshooting approaches like outlined here reduces risk over time.

The Key Takeaway

As illustrated in that real-world example, having an established troubleshooting protocol for Sitecore personalization rules is invaluable for rapidly resolving regressions when launching new tests or campaigns. I actively apply the tactical 8-step process outlined here to define logical next steps:

  1. Replicate Failures
  2. Audit Tests
  3. Validate Rules
  4. Check Targeted Renderings
  5. Scan Code Changes
  6. Enable Verbose Logging
  7. Live Debug
  8. Refine Rule Logic

So next time your beautifully crafted personalization rules suddenly stop functioning upon starting up a test, avoid stressing! Confidently enable your inner Sitecore detective and systematically debug errors back into compliance using techniques like those detailed here. With practice across projects, you’ll gain visibility into common failure patterns and can accelerate fixes over time.

qedge - contact us

Service Cases:

QEdge’s LinkedIn Page

Index