Dealing with disabled cookies
Hi, our application is hosted inside an IFrame that's hosted on a domain A, where as the IFrame content is loaded from our domain:
I know that Optimizely does use first party cookies but, in this case, these so called 'first party' are only first party inrelation to the IFrame src rather than the browser URL, thus they are considered as 3rd party in the hosting website point of view.
With many browsers block 3rd party cookies by default, and the way optimizely behaves when cookies are disabled, this leads to a problem: a visitor that is rolled into the experiment sees a different variation on almost every page load.
What's the best way to prevent experiments to run for users that do not have cookies?
Have you tried an audience condition?
var cookieEnabled = (navigator.cookieEnabled) ? true : false;
if (typeof navigator.cookieEnabled == "undefined" && !cookieEnabled)
cookieEnabled = (document.cookie.indexOf("testcookie") != -1) ? true : false;
This code should check to see if the browser has cookies enabled and, if so, try to create a session cookie then verify the cookie was created.
As a 3rd party, if a user has 3rd party cookies disabled, the testcookie should fail to be created and the function will return false.
However, I do get a "You do not have the permission to add a condition of type: code" error.
Do you think it might be due to using the free plan?
Solutions Architect | Optimizely, Inc.