Cannot load a password-protected, gated, or session-specific page in the editor

  • Updated
  • Optimizely Web Experimentation
  • Optimizely Performance Edge

Are you unable to log into a page that is password-protected, session-specific, or behind basic authentication with the Optimizely Web Experimentation editor? If your site is password-protected, behind basic authentication, or requires session-specific information to access certain pages, those pages do not immediately load in the editor.

Password-protected pages and pages behind basic authentication might include Intranet pages, staging sites behind firewalls, and pages that are gated or available only to logged-in visitors. Pages that require session-specific information to load include shopping carts.

To give the Optimizely Web Experimentation editor access to the necessary cookies or session-specific information it needs to load the page correctly:

  1. Open your site in a browser tab and go to the page you want to edit. To get to the page, you might need to log in, complete a portion of a form or add an item to your cart if you are trying to load a checkout page. Take the exact steps that get you to the exact page that you want to load in the editor.
  2. Copy the URL of the page.
  3. Load Optimizely Web Experimentation in an adjacent browser tab where you had the page open.
  4. Create an experiment using the copied URL of the page you want to test.

Why does this technique work? The editor loads the page as it would appear if you went directly to the URL in another tab. If you can repeatedly load the page into a separate tab outside of Optimizely Web Experimentation, Optimizely Web Experimentation should be able to load the page within the editor. 

What's going on? The key is to let Optimizely Web Experimentation retrieve session-specific information from the browser. If this information is passed through cookies, using an adjacent tab or the same tab will work. If the session-specific information is passed through Session Storage, you need to load the editor in the same tab where you just loaded your page.

If you are sure that your page can load in the same browser tab (or an adjacent one), but your page still does not load, check the right-hand side of the browser's URL bar for a shield icon that indicates  you are in "compatibility mode". Compatibility mode prevents the solution above from working as expected. To resolve compatibility mode issues, see Compatibility mode warning and mixed content in the editor

Other solutions

If you still cannot see the page after following these instructions (for example, your cart is still empty or you are not logged in on the page in the editor), the session data on your site may not be stored in cookies or session storage. This means the session data is not available from within the editor. If you cannot use Interactive mode to go to the page you want to edit, you need one of these two alternate options to create variation code:

  • Option 1 – Separately host a static HTML version of the page and load it into the editor. You can then make changes to that page using the Visual Editor. This option requires help from a developer.
  • Option 2 – If you are familiar with jQuery, use the developer console in your browser to make changes and see them reflected on your live page. Then, copy that jQuery into the experiment's variation code. 

These two options work because the editor acts as a template for the changes you want make, but does not dictate your experiment targeting. Target URLs to choose where your experiment runs dictates exactly where the experiment will run. 

This issue is common in single-page applications (SPAs). If your site is built on a SPA framework, check out our articles on SPAs in Optimizely Web Experimentation for more considerations to watch for when testing on your site.

Troubleshoot other page-loading issues