3

I am using Sitecore 9.1 update 1.

I have setup A/B testing on component level. As it has workflow, I followed the article https://doc.sitecore.com/xp/en/developers/82/sitecore-experience-platform/adding-content-testing-to-a-workflow.html and started the test using Approve with test and also published properly after it started using publish related items also.

The test shows active but it always shows default variant. The setting ContentTesting.AlwaysShowTestCandidateNotification is also true.

Can somebody suggest what could be the issue and how to fix this.

2
  • Have you managed to get this issue resolved? We’re having a similar issue with our implementation and wondered if there are some additional changes/checks we need to make
    – Jafar Cake
    Mar 22 at 3:44
  • @JafarCake unfortunately not. We are using Sitecore 9.1.1 and it seems this is known issue with sxa in this version. We are still in touch with Sitecore team with no solution yet. Apr 6 at 15:54

1 Answer 1

2

There are different reasons why Sitecore can always show the default variant. Fundamentally it means that either the Content Delivery server is not configured to run A/B tests or it does not know that there is a test on the page.

You can try the following steps to identify where the issue is:

  1. The first thing to check is that these three settings are enabled in Sitecore config on the Content Delivery server: xDB.Enabled, xDB.Tracking.Enabled and ContentTesting.Enabled.

  2. Check that you have the SC_ANALYTICS_GLOBAL cookie in the browser. Cookie consent modules and custom code can block this cookie if there is no consent given. Another possible reason for missing analytics cookie can be lack of @Html.Sitecore().VisitorIdentification() tag in the website layout file.

  3. Make sure that your page with the test and all relevant data sources are published to the Web database. I can see you have already tried this, but you can double check that these items are definitely updated in the Web DB.

  4. Another important element is the test definition item, it should be located in the folder /sitecore/system/Marketing Control Panel/Test Lab, have the workflow state Deployed and published to the Web database too.

I noticed that the test definition item is not always published, even when I publish the page with related items. It may help if you try locating this item in the folder /sitecore/system/Marketing Control Panel/Test Lab and publishing it manually.

3
  • 1
    Thanks for your very nice answer. I already checked all these settings and everything is in place. I am using glass mapper to get datasource and I doubt that somehow its causing the issue. As a next step, I'll verify this. Dec 16, 2022 at 12:47
  • 1
    @aruntiwari that's a very good point, as far as I remember GlassMapper returns the default data source if you use the method GetDataSourceItem<>(), at least I saw this behaviour in some versions.
    – Anna Gevel
    Dec 16, 2022 at 13:03
  • 1
    @aruntiwari if it is related to GlassMapper, this answer may be helpful sitecore.stackexchange.com/questions/30224/…
    – Anna Gevel
    Dec 16, 2022 at 13:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.