Search
Clear search
Close search
Google apps
Main menu

Visual editor diagnostics

Visual editor diagnostics alert you when you modify an element that has changed location or structure on a dynamic page. This will help you diagnose problems with your experiments on dynamic pages.

In this article:

Background

Websites with a dynamic page structure (e.g. AJAX manipulating the DOM) can prevent changes made in Optimize's visual editor from firing. This can happen when, for example, JavaScript modifies the page after the Optimize snippet loads, or when the page is modified during progressive rendering and CSS selectors no longer match the same elements (creating a potential race condition). Optimize's visual editor includes built-in diagnostics that alert you when problems are detected with dynamic pages.

How it works

Editor diagnostics keep a copy of the original document and apply each change to both the current document and the original document, so that the editor knows if the elements have been changed between when the document loads and when the editor applies the change.

Diagnostic alerts

If elements on the web page have changed since initial loading, Optimize displays the following diagnostic alerts in several areas of the visual editor:

An alert icon appears in the app bar:

Click the alert icon to display the corresponding Diagnostics property panel:

optimize-editor-diagnostics-dialog

The change list will display an alert icon next to any change where an error is detected.

Click the alert icon to display the corresponding dialog box.

optimize-editor-diagnostics-dialog-box

A pop-up alert will appear in the browser if the editor is hidden.

Snippet errors

Error message Description
This page is not tagged with the Optimize snippet. To run experiments on this page, you must install the Optimize snippet with the ID: GTM-123X No Optimize snippet found. Check that the Optimize snippet has been added to the page.
This page is not tagged with Google Analytics snippet. To run experiments on this page, you must install the Analytics snippet for the tracking ID: GA-10000-1 No Analytics snippet found. Check your Google Analytics tracking code setup.

Editor errors

Error message Description
No matching elements found. Please update your selection. The selector in the change doesn’t match any elements. This is likely caused by a change in HTML structure after the edit was created in the editor.
The original elements used to create this change are not included. Make sure your changes are rendering correctly by using preview mode. When you edit a change and change the selector, it may not select the element that was used to create the change.
The number of elements selected changed after the page was initially loaded. Make sure your changes appear as expected using preview mode. This warning occurs when the page is modified by JavaScript after the page loads. The change applied in the editor may affect different elements than when the experiment runs.
This attribute was modified after the experiment changes were applied. Make sure your changes appear as expected using preview mode. This warning occurs when the attribute value for the elements modified by this attribute is different from the value when the page loads. The attribute value modified by this attribute change is most likely going to be overwritten by JavaScript that runs in the page after the page loads.
This content was modified after the experiment changes were applied. Make sure your changes appear as expected using preview mode. This warning occurs when the content for the elements modified by the text change or content change is different from the content when the page loads. The change is most likely going to be overwritten by JavaScript that runs in the page after the page loads.
The number of target elements for this move operation has changed. The number of target elements selected in the editor is different from the number of target elements selected when the experiment would run. Make sure your changes appear as expected using preview mode. For the move change, there are selectors for the source elements and selectors for the target selector. This warning occurs when the number of elements selected by the target selector is different than the number selected when the page loads.
There are more target elements than source elements in this move operation. Remaining target elements will be ignored. Just a warning that there are more target elements than source elements selected in the move change and the remaining target elements will be ignored.
This change cannot be applied, as the page may have been modified after this change was created. A text change selects an element first and then changes the text node at a specified childIndex position. This warning occurs when the childIndex is out of bounds or does not point to a text node. Most likely caused by structure change in the page after the change was created.
The following JavaScript errors occurred while applying the change: Lists any JavaScript exceptions that occurred while applying the script change.
Was this article helpful?
How can we improve it?