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:
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
.
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.
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.
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.