Oneupweb : Using Cookies for Site Optimization

When developers use cookies, they’re generally storing things such as user preferences, previous logins, and the like between browser sessions to enhance the user experience. While this is a very valuable use for cookies, there are other – less widely seen – uses for cookies that would can greatly improve your site. Specifically, cookies can be a great tool for A/B testing aspects of your website.

At its core, a cookie is simply a text file stored locally on the visitor’s computer containing some small fragment of information. This information can be called by the site and used to return specific elements relative to the information contained within. Using .NET, or PHP, the like – a server can read the data stored within the cookie and deliver elements on the page based on the cookie itself.

For an example, I’ve recently begun testing various positions for a Facebook “Like” button on a site that’s currently live. I would like to determine what placement will drive the most “likes” to a Facebook profile. Fortunately, with the recent addition of the ability to track the “source” of a Like click by appending “fb_source=foo” to the parameters of the iFrame URL, this is fairly easy. I simply set a cookie to expire in a month with a value of either “sidebar”, “header”, “body”, or “footer”. Depending on the value of the cookie for each user, I place the Like button on the page making sure to attribute the source to the position it is currently located in. After a month, I view my statistics via Facebook to see which position had the most success. Based on that information, I can then permanently place the Like button in the area I know to have the highest click rate.

This is just one small example of how you can use cookies for site optimization. From testing contact form layout to optimize for sucessful CRM entries to entire CSS swaps to see how design affects your site’s “stickyness”, there are nearly endless possibilities available to you once you adopt this method of testing on your site.