May 6th, 2009

Testing dynamic content with Google Website Optimizer

I bought a lousy book on Google Website Optimizer (Sybex’s Always Be Testing) which seems to tell me very little about how to use GWO how I want.

I wanted to implement a dynamic element to a site I have started to test – namely an order summary on a shipping page of an e-commerce store.

Of course, because GWO is javascript powered, any dynamic code (I’m using PHP’s Smarty but the same goes for any serverside language) will not be rendered because JS is interpreted clientside.  You can only use HTML/CSS and JS as a variation.

After some thinking (admittedly I should have come up with a solution a lot quicker than I did), I realised I could add in my dynamic order summary code in to my Smarty template file as normal, then in my GWO variation just add some CSS to hide it:

<style tyle=”text/css”>

#mydiv {display:none}

</style>

Tags: , ,

Comments are closed.