Rich-text Reply

Optimizely and Drupal

lilyt 05-09-14

Optimizely and Drupal

Does anyone know how to integrate optimizely and Drupal?

Im having a hard time testing anything other than the content of the webpage, since drupal does all the formatting.


Any help woul be great.


Level 2

willegan 05-09-14

Re: Optimizely and Drupal

Hi lilyt,


It's simple, all you need to do is include your Optimizely javascript code snippet anywhere on the page you are wanting to test. Preferably as high up the page as possible (directly under the head tag for example).


However, unlike Google Analytics, where you place the code snippet on every page of your website, Optimizely only needs to be placed on your test pages and variation pages. If you place the snippet in your template header tag through the Drupal template section you will cause your website to load the Optimizely tag on every page.... every... single... page...


Loading any external content when you render a web page takes time, your browser has to wait for your request to travel to the server in question, find the file and then travel all the way back. If you have any un-necessary external JS files, your site will go slow. Obviously, this will also impact your conversion rate (slow sites always convert poorer than fast ones).


So, you have two options:

  1. Use the native extension that's available for drupal ( - preferred
  2. Simply paste the optimizely code in the code view of your WYSIWYG editor for the pages you want - bad practice, but works

Hope this helps,



Melbourne, Australia

Level 2