Cannot edit iframes in the Visual Editor

  • Updated
  • Optimizely Web Experimentation
  • Optimizely Performance Edge
  • Optimizely Personalization

Inline frames (<iframe> tags) provide a way for websites to display interactive content from other pages inside the current page. These iframes can load content from other pages on your own site or from other sites entirely (for example, to show ads or third-party buttons).

Optimizely Web Experimentation lets site owners modify certain aspects of the iframe on the page, within the Optimizely Web Experimentation Visual Editor. This method treats the iframe as an element on the page. If you want to edit or create click events or goals on elements within the iframe instead, and you control the page that is referenced, you can run an experiment on the referenced page.

Due to technical and security considerations for cross-frame communications, Optimizely Web Experimentation actions are only supported on the iframe element itself, not the elements of the page within the iframe, if you do not control the page. Due to the way that ads are served within iframes, Optimizely Web Experimentation does not support modifications to iframes that display ads. 

Site does not load within an iframe

Optimizely Web Experimentation loads pages into the Visual Editor as an iframe. Some sites do not let themselves be loaded as an iframe outside of their own domains. In these cases, Optimizely Web Experimentation cannot load the site's pages into the Visual Editor. 

Optimizely developed a Chrome extension to work around this issue when you need to load a page into the Visual Editor.