Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Here is a <a href="https://github.com/etan-nitram/split-testing" rel="nofollow">simple A/B testing wordpress plugin</a> that uses javascript to rotate test versions on a single page. There is no server side scripting and it does not redirect to another URL. The plugin uses google analytics to store the test data and jQuery is required.</p> <p>For your button test, you would have 1 button in your HTML with a distinct id, like <code>&lt;button id=”test_button”&gt;</code> and then you could use jQuery to change your button css and text.</p> <p>In the wp-admin, you would create a test that would have 4 versions. And your javascript code for each version would look like this;</p> <p><strong>VERSION #1</strong></p> <pre><code>(function() { var test_button = $('#test_button'); if ( test_button.length &gt; 0 ) { test_button.css('background', '#ff0000'); test_button.text('My Copy #1'); analytics = true; } })(); </code></pre> <p><strong>VERSION #2</strong></p> <pre><code>(function() { var test_button = $('#test_button'); if ( test_button.length &gt; 0 ) { test_button.css('background', '#00ff00'); test_button.text('My Copy #2'); analytics = true; } })(); </code></pre> <p><strong>VERSION #n: See above</strong></p> <p>You must set the <code>analytics=true</code> flag in your code to trigger google analytics.</p> <p>If you have 4 versions, your traffic would be evenly split by 25%. The test ID and version IDs are stored in cookies, so if the visitor returns to your site, they will see the same button. Once again, the test data is sent to your google analytics account, but it’s up to you to set your test goals.</p> <p>I’m the creator of the plugin, so let me know if you have questions.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload