Rich-text Reply

Echoed image reverts to original

chudson 06-23-16

Echoed image reverts to original

I have replaced an image on a landing page, using substring match as the URL Targeting. The page has 3 different filters that can be used in various combinations. Whenever any filter is applied, the image reverts to the original. URL Match Validator confirms that all combinations of filters should be supported for the test but I cannot get the image to echo.

Christopher Hudson
Insights Analyst, DEG
www.DEGdigital.com | (913) 562-2582 | @DEGdigital
Level 1

AllisonR 06-24-16
 

Re: Echoed image reverts to original

Hi Christopher,

 

It sounds like your site automatically updates the view without a page refresh when a filter is selected. Are you familiar with our article on Single Page Applications? Since Optimizely only evaluates once, when the page loads, if the element you want to change gets updated at any point after that, you'll need to manually tell Optimizely to reapply the change. Does this seem to be the case?

 

If so, and you have an Enterprise subscription, then the easiest workaround for this is to conditionally activate the experiment each time the view is updated using the code sample here, for example. More information about conditional activation is in this knowledge base article.

 

Without access to conditional activation, you'll need to bind the variation changes to this callback in the variation code. This article explains where to find your experiment's variation code. Implementing the above solution, for example, would look like this: 

 

   //variation code here
   window.$(document).ajaxComplete(function(event, xhr, settings) {
     if (xhr.responseText.indexOf('rightRailModule') != -1) {
       //duplicate variation code here
     }
   });

Does this help? 

 

Allison
Sr. Technical Support Engineer
Optimizely | EMEA
Optimizely