Skip to main content


Optimizely Knowledge Base

Add a pop-up modal (lightbox) without code in Optimizely

  • Test a page with a pop-up modal without using any code

Timed pop-up modals (or "lightboxes") are useful for emphasizing a call to action on your website, like asking visitors to sign up for a newsletter or share your page on social media sites. To use Optimizely to test a page with a pop-up modal, add one using the Optimizely timed modal extension—you don't need to know how to code! Read on to learn how.

This extension will work with most websites, but it may not work with all websites. 

Create a timed pop-up modal

  1. Navigate to Implementation > Extensions.

  2. Click Create New... and select Using JSON.

  3. In a second browser tab, open Timed Modal config.json and copy all 57 lines of code.

  4. In your Optimizely tab, paste the code in the Create Extension From JSON field and click Create Extension.

  5. Click the extension name (Timed Modal) to open the Extension Editor. In the Editable Fields panel, you can change the headline, subheadline, and call-to-action (CTA) text and link. You can also add an image to the pop-up modal.

    Scroll down to the bottom of the Editable Fields panel to change the number of seconds before the modal pops up. Developers can also code extensions for modals that appear after a certain user action.

  6. Click Save.

Enable the timed modal extension

Here's how to enable the timed modal extension, with steps listed below:


  1. Navigate to Implementation > Extensions.

  2. Click the ... icon for the Timed Modal extension and select Enable.

Now, you'll be able to add your timed pop-up modal extension to experiments!

Add your timed pop-up modal to an experiment

Here's a quick look at how to add your timed pop-up modal to an experiment, with step-by-step instructions below.


  1. Navigate to Experiments and select the experiment where you want to add the modal.

  2. Select the variation where you want to add the modal.

  3. Click Create.

  4. Under Create Options, select Timed Modal.

  5. Customize the modal fields specifically for this experiment. You can change the headline, subheadline, call-to-action (CTA) text and link, image, and number of seconds before the modal pops up.

  6. Click Save.

More resources

Learn more about Optimizely extensions.

Check out the the full set of Optimizely's sample extensions in the Optimizely Extension Library on GitHub.