When using Google Analytics – or any service – to implement A/B testing on your website, they ask you to paste a few code snippets on an individual page – and on that page only. Not only that, but they want the code in a specific place – right before the closing body tag, in the head tag – depends on the snippet. There are often a few different ones, too.
This is a pain in the butt on WordPress. Luckily for you, I’ve done most of the work for you! This is actually a useful bit of code for any site running WordPress – this isn’t Headway specific. We’re hooking into the standard WordPress filter hooks for wp_head and wp_footer here.
Use this code – modified to include the necessary tracking code for your split test & the correct page IDs – when you have to add code to the header of a specific WordPress page:
{code type=PHP}
SCRIPT GOES HERE!
{/code}
Use this code – again, modified – when you have to add code to the footer of a specific page.
{code type=PHP}
SCRIPT GOES HERE!
{/code}
Thankyou Caitlin!
I am planning to split test my new Headway website and this will help 🙂