A/B Test


I was wondering if this logic would work for an A/B test.  Prior to the Google Analytics code running, I was hoping to make a call to  a database that will simply hold a flag of 1 or 0.  Can I have some logic at the top of my index that calls the database and if a 1 is returned show them version A and if 0 is returned show them version B?

I'm asking if you guys think this logic will work for an A/B test?

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Sure, you didn't really say what you are toggling between; different page views?

Here are a couple of extra thoughts.   Are you playing on changing the value from 1 to 0 and back each time the page is shown?  That way you show page A then page B alternating?    But consider that User A should always see the same page view to keep from getting confused.  So perhaps when the user first goes to the site the view he going to see is determined and set in a session variable or a cookie.   Then from then on, he will see that page view.   The next user goes to the site, gets his view assigned to a cookie or session variable and then from then on sees Page B view, etc...

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
I have a toggle in place that when I have to take the site down for some reason I can switch it in the DB.

<cfif toggle eq 1>
<cfinclude template="live.cfm">
<cfinclude template="dead.cfm">

Open in new window

Obviously that is an over simplified example but I hope it triggers something that might work for you.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ColdFusion Language

From novice to tech pro — start learning today.