Rich-text Reply

Test two different components (with their own HTML, CSS and JS)

emweetiq 02-03-16
Accepted Solution

Test two different components (with their own HTML, CSS and JS)

Hello,

 

I have been using Optimizely for a while now, but mainly for rather simple, straight-forward experiments: testing different stylings, show/hide a certain element, different copy, etc. I have tried running more advanced experiments in the past, but got stuck running into Javascript weirdness (well, I suppose I was mostly struggling with the execution order).

 

However, I would really like to start AB testing bigger, more advanced features too, but I am sure what the best approach is to test them. For example, let's say I want to test a completely different image gallery with different features. For this new gallery I need different html markup, different CSS and different Javascript.

 

How I would approach this in the past is to set a global Javascript variable in Optimizely, detect this variable in my Javascript file and depending on the value, show/hide certain elements and initialize the javascript. The disavantages of this approach seem to be (IMO) that I have to load HTML code for both galleries (OK, understandable), show/hide one of them, which in case of a Javascript race issue, would result in a broken page.

 

Now, recently I have been thinking of approaching this differently; to create two seperate the two variants (i.e. the different image galleries I want to test), which seems to be possible by setting up a Redirect Experiment. This allows me to isolate the variations completely and requires no JS code to initialize one component or the other.

 

Any help/pointers would be greatly appreciated!

Level 1

JDahlinANF 02-03-16
 

Re: Test two different components (with their own HTML, CSS and JS)

I agree.  Treat it as a redirect test where half the users are taken to the new page.  This is helpful for pages which are vastly dissimilar or when the page-weight would be significantly impacted by loading two sets of "stuff" on the page or flashing would be significant if you have to replace significant chunks of the existing page with alternate content.

emweetiq 02-11-16
 

Re: Test two different components (with their own HTML, CSS and JS)

Thank you for your response!
Level 1