jQuery Plugin For Simple A/B Testing On Page - SimpleAB
File Size: | 6.22KB |
---|---|
Views Total: | 1629 |
Last Update: | |
Publish Date: | |
Official Website: | Go to website |
License: | MIT |
SimpleAB is a jQuery plugin used implement a basic A/B testing on your page that allows you to determine which situation will perform best for your website or app.
Basic Usage:
1. Load the latest version of jQuery javascript library and jQuery simpleAB plugin on your page.
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <script src="simpleab.js"></script>
2. Create 2 DIVs on your web page, only one will be showing. .
<div class="simpleab-1"> This is DIV #1. </div> <div class="simpleab-2"> This is DIV #2. </div>
3. Enable the A/B testing. SimpleAB will pick one DIV at random.
<script> $(document).ready(function(){ $.simpleAB({ classCount: 2 }); }); </script>
4. Parameters for simpleAB.
<script> $(document).ready(function(){ $.simpleAB({ classCount: 2, // The number of SimpleAB "pages" you're using. Should be one-based; class indicices in the page should be as well. Required. persist: false, // Whether or not to persist the stored page in a cookie. className: "simpleab" // The name of the class that names SimpleAB pages. }); }); </script>
This awesome jQuery plugin is developed by parsonsj. For more Advanced Usages, please check the demo page or visit the official website.