I have a WordPress page where I have a button in the sidebar on every single post. I would like to do some A/B Testing of this button with multiple different colors and copy-texts of it.
All tools I can find only allow me to create multiple pages or multiple URL’s to AB test on. But since this button is on all my pages and not only on 1 specific landing page, it’s not what I’m looking for.
So I guess what I would prefer is if there is some tool that allow me to go into the Theme Files and just add something like:
<script>
<button style="background: #ff0000;">My Copy #1</button>
</script>
<script>
<button style="background: #00ff00;">My Copy #2</button>
</script>
<script>
<button style="background: #0000ff;">My Copy #3</button>
</script>
<script>
<button style="background: #000000;">My Copy #4</button>
</script>
Please note that above code is just an example of what I would love to see as a solution. I just want to be able to write it into my Theme and then track it from there, without having to create alternative URL’s or pages.
Anyone can give me an idea or suggestion of Tool or Method to use?
You can use a AB Press Optimizer WordPress Plugin for doing your A/B Testing. If gives you two options to implement your experiments you can use a Shortcode or PHP function.
Here is a simple A/B testing wordpress plugin 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.
For your button test, you would have 1 button in your HTML with a distinct id, like
<button id=âtest_buttonâ>
and then you could use jQuery to change your button css and text.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;
VERSION #1
VERSION #2
VERSION #n: See above
You must set the
analytics=true
flag in your code to trigger google analytics.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.
Iâm the creator of the plugin, so let me know if you have questions.
You may use MockingFish.com AB Testing tool for this purpose. It allows you to track the click on the element and you may also set the Javascript to send the data to the AB Test tool. You will be able to get support for this implementation.
Disclaimer: I am amongst the promoters of MockingFish.com