Rich-text Reply

Will Optimizely remove a bucketed user if they match an exclusion criteria later on?

mkstvnsn 03-09-17

Will Optimizely remove a bucketed user if they match an exclusion criteria later on?

[ Edited ]

I have a test that targets all users except for those that have "thisCookie" with any value. The only way they get this cookie is if they visit a certain page.

 

Basically, I want users who land on this page originally to get the cookie so they are never bucketed into the experiment. However, if someone visits this page later and gets the cookie, I want to KEEP them in the experiment. I do not want them to be removed. I'm just unsure of how Optimizely would handle this event.

 

Thanks!

Level 2

tomfuertes 03-09-17
 

Re: Will Optimizely remove a bucketed user if they match an exclusion criteria later on?

We use custom audience javascript code for this use case:

 

var cookieName = 'anyCookie';
var experimentCookie = 'proxyCookie';
var bucket;

// if they have been in the experiment keep them here
if (getCookie(experimentCookie)) {
  bucket = true;

// else if that haven't been in the experiment then check for the exclusion cookie
} else if (getCookie(cookieName)) {
  bucket = false;

// else they don't have the cookie yet so bucket them and set the cookie for later
} else {
  bucket = true;
  setCookie(experimentCookie, 'true', 365);
}

// return value to activate audience
return !!bucket;

function setCookie (name, value, optDays) {
  'use strict';
  var expires = '';
  if (optDays) {
    var date = new Date();
    date.setTime(date.getTime() + (optDays * 24 * 60 * 60 * 1000));
    expires = '; expires=' + date.toGMTString();
  }
  document.cookie = name + '=' + value + expires + '; path=/';
};
function getCookie (name) {
  'use strict';
  var nameEQ = name + '=';
  var ca = document.cookie.split(';');
  for (var i = 0; i < ca.length; i++) {
    var c = ca[i];
    while (c.charAt(0) === ' ') c = c.substring(1, c.length);
    if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length, c.length);
  }
  return null;
};
____
- Tom Fuertes | CTO @ CROmetrics / LinkedIn
"Most Impactful Use of Personalization" and "Experience of the Year" Optie award winner.


mkstvnsn 03-09-17
 

Re: Will Optimizely remove a bucketed user if they match an exclusion criteria later on?

Thanks Tom. So does that mean Optimizely will remove them from the experiment? For this use-case I actually don't mind if they are removed, I really just want their conversion numbers to remain in my results.

So if a user converts but then gets that cookie added because they landed on the certain page, would their results stay?
Level 2