Re-execute Experiment Changes some time after the first execution

Sometimes, the changes that are created on the Visual Editor, will not change the elements when previewed. Even though the right elements are targeted.

When this happens is good to try executing the experiment changes a bit later. You can use the following code to achieve this. Insert in the Code Editor > Variation JS section. 

 

// Check if the code has already been executed
if (!window._hasExecuted) {
// If not, set the flag to true
window._hasExecuted = true;

// Delay execution by 1000 milliseconds (1 second)
setTimeout(function() {
window._conv_q = window._conv_q || [];
window._conv_q.push(["executeExperiment","123456789"]); // Change the number to match your experiment id
}, 1000); // Change the 1000 to adjust to how many ms you want to delay the code.
}