Tuesday, 24 November 2026

SitecoreAI Component Personalization, Part 2: Testing, Activation, and Analytics

 


A team I worked with saved their decision table, published the page, and announced the campaign was live. Two days later the analytics were empty. Nobody had clicked Start personalization. Saving, publishing, and starting are three separate actions in SitecoreAI, and skipping any one of them means visitors never see your variants.

In Part 1, we designed the decision model: inputs, ordered rules, and variants. This part takes that configuration through testing, custom values, publishing, activation, analytics, and maintenance, step by step.

Before you begin

Component personalization is part of SitecoreAI's phased rollout, so the UI and availability can vary by environment.

Prerequisites

You need:

  • A component with a saved decision table and configured variants (covered in Part 1).
  • Visitor profiles you can test with, including at least one with incomplete data.
  • An agreed business KPI and an owner for the analytics review.
  • A named person who can start and pause personalization in production.

How it works


Three states are easy to blur together: a saved draft, a published page, and started personalization. Visitors only receive variants once the page is published and personalization is started. When something "isn't working" right after launch, check those two first.

Step 1: Test rules against visitor profiles

A rule that can match isn't enough. Because evaluation stops at the first match, you need to confirm that the intended rule wins when several could apply.

  1. Open the component's decision table.
  2. Select the option to test personalization rules.
  3. Choose a visitor profile.
  4. Run the test.



  5. Review which rule matches and the resulting variant.
  6. Repeat with the other scenario profiles.

Build your test set around these five scenarios:

Scenario

What it catches

Matches the first rule

Basic matching works

Matches a later rule

Earlier rules don't capture it by mistake

Could match more than one rule

Rule-order problems

Matches no rule

The fallback is shown

Incomplete or missing data

Assumptions about data availability

The overlap scenario finds the most bugs. A profile interested in SUV , should view SUV detail, not the broader General rule.

Test the fallback

Always include a no-match profile. When no rule matches, SitecoreAI shows the original component. Check that it suits your whole visitor population and doesn't carry campaign content meant for a narrower group.

Step 2: Create and test custom values

Custom values are JavaScript-based inputs that combine profile data, behavior, and calculated logic. Here's an illustrative pattern based on Sitecore's documented example, returning the last country user visited from in the visitor's latest session:

javascript

(function() {
  const selectedCountries = "[[countries | multienum(IN, US, UK) | { required: true }]]";
  const visitorCountry = profile?.sessions?.[0]?.geolocation?.country ?? "";

  if (!visitorCountry) {
    console.log("Visitor geolocation country is not available in the profile.");
    return false;
  }

  const countriesArray = selectedCountries.split(",");
  const isCountryMatched = countriesArray.includes(visitorCountry);

  console.log(`Visitor geolocation country: ${visitorCountry}, Selected countries: ${countriesArray}, Match found: ${isCountryMatched}`);
  return isCountryMatched;
})();

Confirm the runtime context and data shape in your environment before adapting it. The null and type checks aren't optional. Plenty of profiles have no sessions, and returning an explicit null is safer than assuming complete data.

Create the custom value

  1. In the decision table, add a Custom value input.
  2. Select Create new.
  3. On the Custom Values page, enter a name.
  4. Add the JavaScript, or use Code Assistant to generate a starting point.



  5. Add a description and tags.
  6. Select the return type: String, Number, Boolean, Date, or Array.
  7. Save.

Test it

  1. Open the custom value and select Test.
  2. Load a profile by client ID or profile ID, or generate a test profile where that's available.
  3. Run the test and inspect the response.



    >


     

  4. Repeat with a profile that has no sessions, and confirm you get null, not an error.

Review Code Assistant output carefully

Code Assistant turns a natural-language prompt into JavaScript. Be specific about which fields to inspect, any time window, the conditions, and the expected return type including null. Sitecore warns that generated responses can vary and may not always be accurate. Treat the output as a first draft from a junior developer: read every line and test it against several profiles.

Publish the custom value

  1. Open the custom value.
  2. Select Publish and confirm.
  3. Check that its status is Published.
  4. Return to the decision table and select it as an input.

A saved draft isn't automatically available as a published input. If you can't select a custom value in the table, check its status first.

Step 3: Review and publish the page

Before publishing, check that:

  1. Each variant renders correctly.
  2. Text and imagery fit the intended scenario.
  3. Links and CTAs go to the right place.
  4. Mobile and desktop layouts both work.
  5. The original component is a valid no-match experience.
  6. This component doesn't conflict with other personalized areas on the page.

Then publish the page through your normal Page builder workflow.

Publishing doesn't start personalization. That's the next step.

Step 4: Start personalization

  1. Open the component personalization controls.
  2. Review the saved rules and variants.
  3. Select Start personalization.

     

  4. Confirm if prompted.
  5. Verify the personalization status.



Before you click in production, confirm you're on the right page and component and that the latest intended version is published. For time-sensitive campaigns, agree the start time with the campaign owner.

Step 5: Review analytics

Once visitors start seeing live variants, analytics become available.

  1. Open the personalization analytics for the component.
  2. Review rule execution counts and percentages.


  3. Ask these questions:
    • Which rule matches most often?
    • Are visitors reaching the targeted scenarios?
    • Is one rule capturing far more traffic than expected?
    • Are some variants getting almost no exposure?

Rule execution tells you about matching, not business impact. Compare it against the KPI you agreed before launch, such as CTA engagement. Without a KPI, you can claim activity, not success.

A rule capturing far more traffic than expected is usually a sign that it's too broad or sits too high in the table.

Step 6: Pause and maintain

Campaigns expire and data changes, so schedule reviews.

To stop an active personalization, use the documented pause control. Tell the content and campaign owners first, so everyone knows visitors will see the original component.

For each review, check:

  1. Is the campaign still valid?
  2. Are the profile attributes and conditions still populated?
  3. Do custom values still return the expected type?
  4. Have any rules become overlapping or redundant?
  5. Is the original component still the right fallback?
  6. Does the analytics picture still match the intended audience?

After any change, rerun your profile test scenarios and repeat the publish and start steps as the workflow requires.

Troubleshooting

The expected variant isn't displayed

Check in this order:

  1. Is personalization started?
  2. Is the page published?
  3. Does the profile contain the required data?
  4. Does the visitor satisfy every input in the rule?
  5. Is an earlier rule matching first?
  6. Is the intended variant configured and saved?

A custom value isn't available in the decision table

Check that it's published, has the expected return type, and exists in the environment you're working in.

A custom value returns null

Look at the test profile for missing sessions, missing traits, unexpected data types, or wrong assumptions about array order.

Analytics are empty

Confirm personalization is live and visitors are reaching it, then confirm you're looking at the right site, component, and scope.

Real project tips

Personalization doesn't create missing data. If country or an event-derived value isn't on the profile, no rule can target it reliably. Validate the data foundation before you touch the decision table.

Document every custom value. Record its business meaning, inputs, return type, null behavior, owner, and test cases. Without this, one team changes shared logic that another team's component depends on.

Remember page versions. Component personalization is shared across page versions, so a rule edit can affect the live version. Agree a change process before anyone edits rules on a draft.

Release checklist

Before starting a component personalization in production:



Summary

Component personalization is a small decisioning system attached to a component, and it needs to be operated like one. Test against representative profiles, validate the fallback, review custom JavaScript, publish the page, start personalization, and judge results against a real KPI.

Across both parts, the approach is the same: design the decision model carefully, then run it with testing, activation, measurement, and clear ownership.

Demo

To see these steps in practice, watch my webinar below. It includes a full demo of SitecoreAI personalization.



References

Component personalization

No comments:

Post a Comment