support for a No Cookie Mode or custom tracking initialization without cookies (API)

Status: Maybe One Day
by Gus ‎04-22-2014 April 22, 2014

It will be great if we could initalize the tracker manually ( we can do it with experiments), or to push a "no cookie" command before snippet loading. 

With the present implementation, we can´t give solutions to Cookie Policies, like EU "Cookie" Directive.

Status: Maybe One Day
Level 2

by Optimizely
‎04-22-2014 April 22, 2014

For A/B experiments to have meaningful results, it's essential to be able to identify visitors across page views, site visits and browser sessions. With the current browser eco system, the best way to achieve this is by using cookies.


That being said, it's important to honor the wishes of your visitors and legal requirements / cookie laws in your target markets. The best way to do so it by using one of the conditional script loaders that will only load tags / snippets when a visitor has implicitly or explicitly (depending on your target country) agreed to cookies of a specific type. Optimizely should be loaded if a visitor agrees to ‘Statistics / Analytics’-type cookies. One good, comprehensive solution is


One thing to watch out for is that the cookie consent script you're suing should be able to handle synchronous tag / snippet loading. This is to avoid a visible ‘flashing’ effect (the original element appears briefly before the change is applied).


So, in short, it's better to not load a snippet in the first place instead of loading it and having it do nothing at all.

One thing that I'll take back to the team is the fact that we're not currently removing Optimizely cookies when a visitor opts out. That's something we'll look into.


Thank you for your question / idea! I believe this thread will be helpful to many of our customers here in Europe.

by Gus
‎04-22-2014 April 22, 2014

Hi Toby,


i´m aware about the opposite trends of changing the interface as soon as possible (avoiding flashy effects) and the fact that a new user has to interact with the interface to accept an experiment ( for example) that changes the interface ( flash!).

My point is, it will be great to start to track in a no cookie way, letting to the developer the management of variables needed by code and start the experiment manually using them ( so no flash) , and when the user accepts the cookie policy, start the tracker in the usual way, with all the cookies needed. We have done this with other tracking tools, because we have control over the tracker,  as well as the experiments, goals, etc... via the APÎ.

The problem i see is that the snippet loading implies the tracker initialization. And you can "disable" or "opt-out" the user, but you are mixing the tracking and the experiment events, so in some sense, you need cookies in those cases too because you track by default, and with the tracking you get cookies ( that´s necessary, for example, to know when some user is recurrent, even when there is no experiment running). Moreover, you can´t create a new tracker after that.

So i still believe that we need an access to a tracker initialization method and its parameters. And, in my case, to a "no cookie" parameter. 


Level 2
by HeatherW
‎06-02-2014 June 2, 2014
Status changed to: Maybe One Day
Level 2
by msartintarm
‎07-01-2016 July 1, 2016 - edited ‎07-01-2016 July 1, 2016



Is this feature, or one similar to it, not going to happen? The way the snippet always sets cookies is causing issues with our Europe integration as well. Has there been equivalent functionality added in the past 2 years by any chance?


I think with our current approach either we are forced to accept additional latency because we need client-side code that needs to be evaluated after page load but before conditionally loading the script, or we need to have the server itself make the determination of whether to include the script, which is undesirable for caching purposes and it also involves duplicating app-level code for the EU mechanism.


Preferably, there would be a mode where no cookies would be set until an Optimizely experiment is activated.

Level 1