Skip to content
September 25, 2016 / kiranpatils

Sitecore Content Testing not working?

Challenge:

We use Content Testing, A/B Testing a lot for all our clients. And you need to do that. Correct? Because that’s why they invested heavily in Sitecore license.

We were trying to enable it for one of our client as per this article : https://doc.sitecore.net/sitecore_experience_platform/analyzing__reporting/experience_optimization__content_testing/setting_up_tests/adding_content_testing_to_a_workflow

But it was not working. I got involved in this project later on. So, had no idea what’s going on. Spent sometime figuring out to make it work. And I think it will be good for you as well to know this. In case, you also face similar issues.

Solution:

We started looking at Solution and found one thing.  In past due to Performance issues in experience editor Sitecore folks asked us to disable Sitecore.ContentTesting.Requests.ExperienceEditor.SuggestedTestsCountRequest class to prevent excessive calls to database  [Sitecore.ContentTesting.Requests.ExperienceEditor.SuggestedTestsCountRequest class to return 0]. As we were on Sitecore 8.0 Update-2 we had to write our custom code. But it has been fixed in Sitecore 8.0 Update-3 (“The Experience Editor slowed down when there was a large number of Suggested Tests. This has been fixed. (434105)”) after analyzing a bit and having a Sitecore support discussion we thought this seems not be main reason for A/B Testing. But that was theory. Wanted to prove it.

So, Installed plain Sitecore on my local machine and configured Automated Test which was working! Then gradually started adding all configurations and custom code related to A/B testing in plain Sitecore and finally, Have been able to find out root cause. Eager to know? What it is? Let me share

Basically, When we did upgrade we were not using ContentTesting. So, we disabled it using our custom patch file:

<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
  <sitecore>
    <settings>
      <setting name="ContentTesting.AutomaticContentTesting.Enabled">
        <patch:attribute name="value">false</patch:attribute>
      </setting>
      <setting name="ContentTesting.GenerateScreenshots">
        <patch:attribute name="value">none</patch:attribute>
      </setting>
      <setting name="ContentTesting.PhantomJS.EnableJavaScript">
        <patch:attribute name="value">false</patch:attribute>
      </setting>
    </settings>
  </sitecore>
</configuration>

After reverting those attributes to Original it started working. Then we did some reading on those attributes and here’s what we learnt:

  1. ContentTesting.AutomaticContentTesting.Enabled : Determines whether automatic content testing features should be enabled.Default value: true
  2. ContentTesting.GenerateScreenshots : Determines when screenshots should be generated.Must be one of ( all | limited | none ) Default value: all. Basically, It takes screenshot of all possible variations
  3. ContentTesting.PhantomJS.EnableJavaScript : Determines whether the PhantomJS tool should allow JavaScript on pages. Default value: true

Here is the working config:

<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
  <sitecore>
    <settings>
      <setting name="ContentTesting.AutomaticContentTesting.Enabled">
        <patch:attribute name="value">true</patch:attribute>
      </setting>
      <setting name="ContentTesting.GenerateScreenshots">
        <patch:attribute name="value">all</patch:attribute>
      </setting>
      <setting name="ContentTesting.PhantomJS.EnableJavaScript">
        <patch:attribute name="value">true</patch:attribute>
      </setting>
    </settings>
  </sitecore>
</configuration>

P.S. Thanks to Eric. Who worked on this issue along with me and Thanks to Sitecore support team as well!

Happy Content Testing! 🙂

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: