Tapestry-genetify is intented to be a tapestry integration for Genetify (A/B testing and webpages optimization).
Genetify is a powerful opensource website testing and optimization tool created by Greg Dingle. It makes your website adapt and evolve toward an optimum in an autonomous way using some kind of multi-armed bandit algorithm and can be compared to Google Analytics Content Experiments.
Assuming you provide genetified resources for your website.
For instance, a simple genetified css that set a color to an element identified by "navbar" (note the suffix '_vX')
#navbar { color: red; }
#navbar_vA { color: green; }
#navbar_vB { color: blue; }
and/or a simple genetified markup (note the class attribute's value with the 'v' separator)
<div class="sentence">One way of saying something</div>
<div class="sentence v anotherway">Another way of saying something</div>
The module provides a way to add the genetify stack (js and css) and to evolve the webpage design.
package com.example.testapp.pages;
...
@Genetify
public class Index {
}
The @Genetify annotation includes the genetify stack and evolves the webpage design for all genetified resources (css, js and markup).
package com.example.testapp.pages;
...
@Genetify(vary=GeneType.CSSRULES)
public class Index {
@SetupRender
@Genetify(vary=GeneType.JAVASCRIPT)
void init(){
}
@AfterRender
@Genetify(vary=GeneType.ELEMENTS)
void doEnd(){
}
}
The vary attribute evolves a given resource type (css, js or markup) during a given render phase.
The module provides also a way to record a goal on a page view or on an event (used to make the pages evolve toward an optimum)
package com.example.testapp.pages;
...
@Goal(label="SubscribeView", score=1)
public class Subscribe {
...
}
In this sample, the @Goal annotation records a goal on a page view with label "SubscribeView" and a score of 1
To record a goal on an event with a label and a score, use the genetify/recordGoal mixins :
in SomePage.tml
<html t:type="layout" title="Some Page"
xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd">
...
<t:actionlink t:id="addToBasket"
t:mixins="genetify/RecordGoal"
t:label="addedToBasket"
t:score="3">
Add to basket
</t:actionlink>
...
</html>
Here, the "addedToBasket" goal will be recorded with a score of 3 on the click event.
Available from the maven central repository. Just add the following dependency for Tapestry 5.3 :
<dependency>
<groupId>com.adaptivui</groupId>
<artifactId>tapestry-genetify</artifactId>
<version>1.0.0</version>
</dependency>
This project is distributed under Apache 2 License. See LICENSE.txt for more information.
See the tapestry-genetify-demo project and its live demo