Rich-text Reply

Optimizely JS setup

onotole404 05-28-14

Optimizely JS setup

Hi all! In the "Implementing the Optimizely snippet" manual described that Optimizely code (<script src="//"></script>) may be placed inside <head> element. But it little defers page load. Question: may this code be placed after content (directly before end of <body>)  without destroying functionality?

tobyurff 05-28-14

Re: Optimizely JS setup

Hi onotole404! We recommend loading our snippet synchronously within the element of your page to avoid page flashing (original content appearing in the visitors browsers before the variation changes jump into place). Adding the snippet as one of the first things on your page will delay page load by a bit (that's unavoidable) but will allow us to execute the visual changes of your experiment before the page renders in the visitor's browser. We have developed an excellent CDN balancing infrastructure ( over time so that we're confident to keep the performance impact our snippet causes to an absolute minimum. One additional thing you can do to decrease the size of our snippet even further is to implement the snippet so that we use the jQuery you already have on your page (if you do). Here's how you can achieve that: