Search code examples
javascriptphpwordpressab-testing

How to A/B split test a Wordpress header content?


On this site, I have in my header.php file, the code below.
Embedded so that it shows up right under my menu on all my pages.
(Note. It is set to display: none; on the homepage.)

<div id="widget-container-1450"></div>
<script type="text/javascript">
 (function() {
 var script = document.createElement('script');
 script.type = 'text/javascript';
 script.async = 'true';
 script.src = "https://admin.bookdirect.net/hs4/widgets/1450.js?widget_element=widget-container-1450";
 document.body.appendChild(script);
 })();
</script>   

I would like to split test this and another variation of this.

There are plugins that might do the job, NEILO A/B TESTING, AB Press Optimizer etc, but they are pretty expensive and I'm not 100% sure they will work.

I know some code and can figure stuff out. so any suggestions or ideas would be helpful and appreciated.

Thanks

Sparkie the DOG


Solution

  • Thanks, guys.

    I did end up using Google optimize. https://optimize.google.com/ It worked pretty well, although it took a little bit to get the hang of it.

    Thanks again.