1.8K members online now
1.8K members online now
Everything you need to know about setting up Optimize including creating your account and container, linking to Google Analytics and how to tag your site.
Guide Me

Show different variants for the same user

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hello everyone.

I'm trying to setup A/B experiment with a few variants, but I would like that when user refreshes the page - another variant is shown for him.


As I know in a very high level the Google Optimize works in the next way:

1. When new user opens experiment page, google with some algorithm chooses one variant and sets the cookies with that variant.

2. When next time user opens that page, google checks _gaexp cookie and loads the variant which corresponds to the cookie value


I have a few thoughts about the implementation, but I'm not sure if this is the correct way:

I can try to remove that cookie(_gaexp) when user visits experiment page. So theoretically, next time he opens it - Google will check that cookie doesn't exist, will show another variant and set cookie for the variant.


Maybe someone has already faced with such issue? 

The help would be appreciated, Thank you..

1 Expert replyverified_user

Show different variants for the same user

Google Employee
# 2
Google Employee



You may also need to remove the ga cookie as well, but have in mind that this will be obviously measured as a new session.


If its OK to ask, I am also a bit curious for the reasoning behind what you want to do.

I think that from a statistical perspective, your experiment data will be "corrupted" in the sense that user behavior may depend on any of the variants that he is exposed to.


Are you trying to do some kind of personalization where you want your site to always look fresh?


If you can implement the variants by yourself with javascript, an option maybe to define a single Optimize variant (with increased weight) and then choose the real variant to apply using Math.random();