Skip to content

adaptivui/tapestry-genetify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

60 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tapestry Genetify

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.

Example

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>

How to genetify

The module provides a way to add the genetify stack (js and css) and to evolve the webpage design.

Genetify annotation
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).

Vary attribute
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.

How to record a Goal

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)

Goal annotation
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

RecordGoal Mixins

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.

Installation

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>

License

This project is distributed under Apache 2 License. See LICENSE.txt for more information.

Demo

See the tapestry-genetify-demo project and its live demo

About

A tapestry integration for Genetify (A/B testing and web pages optimization)

Resources

License

Stars

Watchers

Forks

Packages

No packages published