0

I am trying to implement A/B test framework where it should allow to change(test against users) any content on any page dynamically(without need to code specifically).

Plus this should allow to change(test) static content(header, footer links) and dynamic db driven element(entity description, product images) as well. (I know its silly to A/B test dynamic db driven elements, as they are always changeable by CMS tool)

I could figure out 2 probable solutions

1) Change the content of the dom element after page load via JS, But it could lead to minor flickering of the elements as it changes the content after page load(or even during the page load).

2) Change the final html of the response using the after_filter or middleware(not sure of this). I am planning to use nokogiri to parse and alter the html

I wanted to know/confirm if there exists a better way to implement this or any possible flaws in the 2nd approach.

Abhishek Patel
  • 138
  • 1
  • 6
  • 1
    Have a look at `split` gem https://github.com/andrew/split – cristian Jan 19 '15 at 08:58
  • split looks promising. One of the objective of this project to allow to change content on any page GENERICALLY. So that dev need not to go and add lines of code every time at every place. – Abhishek Patel Jan 19 '15 at 10:23

0 Answers0