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.
But for teams just launching new A/B or multivariate tests focused on specific segments, pesky errors blocking rules from firing properly can grind progress to a halt.
Common Personalization Rule Issues After Starting Sitecore Tests
Now you know a little bit about what personalization rules do within Sitecore and why they’re so integral for advanced omnichannel personalization. So what are some frequent problems that tend to surface specifically after initiating a new experience optimization test?
Through extensive troubleshooting practice and community knowledge sharing, I’ve aggregated key patterns:
- Missing Assembly Reference – Most commonly, the PersonalizationRuleController class fails to load properly on page requests due to incorrect assembly registration. This is one of the first issues I check when personalization rules suddenly stop working across tests.
- Non-Public Class Declaration – Along the same lines, the access modifier on the core PersonalizationRuleController class may have been changed to internal or private during development. Since external systems need to instantiate this controller, restricting access understandably breaks things.
- Incorrect Rule Condition Definitions – With complex segmentation logic, it’s not uncommon for newly created rule conditions to reference invalid goal IDs or refer to events that haven’t fired yet. Rechecking conditional logic prevents false positives.
- Experience Optimization Conflicts – If working with both personalization rules and the built-in testing toolkit, conflicting test definitions, segmentation overlaps, or misconfigured settings/dimensions can also block rule execution. As a best practice, keep testing and rules separate.
- Targeting Misconfigurations – For components targeted dynamically via rules, it’s important to audit those renderings and ensure the personalization tab lists your rule name. Without proper linkage, content won’t update even for passing conditions.
Now that we’ve covered the most frequent culprits behind personalization rules failing, let’s walk through tactical troubleshooting and remediation steps.
Sitecore rules are not working after starting the test: What to do?
1. Open the web.config file.
- Navigate to the root folder of your Sitecore website.
- Right-click on the web.config file and select Open with.
- Choose your preferred text editor (e.g., Notepad++ or Visual Studio Code) to open the file.
2. Find the <assemblies>
section.
- Press Ctrl+F to open the Find dialog box.
- Search for the text
<assemblies>
. - The
<assemblies>
section should be located within the<configuration>
element.
3. Add a reference to the Sitecore.ContentTesting.Requests.Controllers.PersonalizationRule assembly.
- Place your cursor inside the
<assemblies>
section. - Click on the Enter key to create a new line.
- Copy and paste the following code into the new line:
<add assembly="Sitecore.ContentTesting.Requests.Controllers.PersonalizationRule, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
- Make sure to replace the placeholder text with the actual version number of the Sitecore.ContentTesting.Requests.Controllers.PersonalizationRule assembly. You can find this information in the assembly's properties.
4. Save the web.config file.
- Click on the File menu and select Save.
- Alternatively, press Ctrl+S to save the changes.
5. Restart the Sitecore website.
- Open the IIS Manager on your server.
- Expand the Sites node and select your Sitecore website.
- In the Actions pane on the right, click on Stop.
- After the website has stopped, click on Start to restart it.
6. Check the Sitecore logs to see if the error message still occurs.
- Open the Sitecore logs folder. The default location is:
C:\inetpub\wwwroot\Website\Data\logs
- Look for the most recent log file (e.g., Sitecore.Services.Log.txt).
- Open the log file with a text editor.
- Search for the error message that you mentioned earlier (e.g., Failed to load Sitecore.ContentTesting.Requests.Controllers.PersonalizationRule.PersonalizationRuleController).
![Sitecore rules are not working after starting the test](https://www.qedge.co/blog/wp-content/uploads/2023/11/Sitecore-rules-are-not-working-after-starting-the-test.jpg)
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 theclass
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:
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
Now let’s explore a common example walking through these key steps...
Troubleshooting Personalization Rules in Action
To solidify concepts, I wanted to walk through a real-life Sitecore troubleshooting scenario demonstrating my step-by-step methodology:
I implemented a series of personalization rules to customize homepage banner content for new vs repeat website visitors across key metro regions. The dynamic banners would promote region-specific store events for engaged locals or highlight popular product lines with discounts for first timers.
Excited to launch this geo-targeted campaign, I configured aligned A/B tests in Content Testing to measure banner performance between cities. But immediately upon kicking off the tests, my conditional banner content failed to change. Personalization wasn’t working somehow. Ugh!
Yet rather than scrambling, I calmly initiated my rules debugging protocol:
- Replicated as an LA visitor to confirm no geo banners shown, took screenshots.
- Validated tests were active and user profile/traffic data was logging accurately.
- Checked rule conditions looked for correct Analytics events firing on new visits.
- Reviewed renderings with no visible personalization changes to expected values.
- Scanned recent Foundation commits for nothing related to rules or testing changes.
- Turned on verbose diagnostics logging within App_Config and saw stack trace errors failing to load core PersonalizationRuleController. Interesting...
- Debugged VS locally, watched new instances of that controller fail, revealing missing assembly reference.
- Added missing DLL reference to web.config and reloaded to confirm resolution!
By patiently following my proven troubleshooting methodology rather than panicking, I was able to quickly track down the root cause (a missing DLL issue) and implement a fix to restore functionality in less than 30 mins.
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:
- Replicate Failures
- Audit Tests
- Validate Rules
- Check Targeted Renderings
- Scan Code Changes
- Enable Verbose Logging
- Live Debug
- 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](https://www.qedge.co/blog/wp-content/uploads/2023/11/qedge-contact-us.png)
Service Cases:
![lionsgate qedge](https://www.qedge.co/blog/wp-content/uploads/2023/08/lionsgate.png)
![qedge](https://www.qedge.co/blog/wp-content/uploads/2023/08/Ausgrid.png)
![qedge](https://www.qedge.co/blog/wp-content/uploads/2023/08/Cortex.png)
![a brief view of cochlear](https://www.qedge.co/blog/wp-content/uploads/2023/06/a-brief-view-of-cochlear.jpg)
![Lincoln Electric Official Website IT Services](https://www.qedge.co/blog/wp-content/uploads/2023/08/Lincoln-Electric-Official-Website-IT-Services.jpg)
![united imaging](https://www.qedge.co/blog/wp-content/uploads/2023/08/united-imaging.jpg)