Sunday, 25 August 2013

How to write a Google Content Experiment that disables a stylesheet?

How to write a Google Content Experiment that disables a stylesheet?

I am currently trying to setup a Client Side Experiment without Redirects
as opposed to the default Content Experiment A/B testing. All I want to do
is for half my visitors disable one of two existing stylesheets on a page.
To me it doesn't make sense to do this the the default A/B way because
then I would have to setup a second page with the stylesheet disabled for
every page on my site.
There is also Running a Server-side Experiment but to me that is too heavy
handed for something I think should be somewhat simple.
I have the js all setup, I just need to be able to tell the page that when
there is a given variation disable the stylesheet of don't render the
stylesheet before the DOM loads.
One thing I considered is, given a certain variation, redirect to the same
page but append a url query parameter like &stylesheet_disabled=true but
when I briefly looked at that I ran into a redirect loop but perhaps
someone has a better way to write the js.
Any help greatly appreciated.

No comments:

Post a Comment