Rich-text Reply

Optimizely is changing unwanted images

olivehouse 03-08-16

Optimizely is changing unwanted images

Hey

 

My experiment changes the header and old logo to a new logo. However, for some reason it is changing another image on the website. The page here -> http://camerakings.co.uk/returns/ -> should not be displayed like that.  The logo replaces the logo that should be there.

 

Our end the code show this:

<div class="returnslogo">
<p><img alt="returns" src="/media/website/Warranty/Camerakings-returns.png" /></p>
</div>

But it seems its is being replaced by this:

<div class="returnslogo">
<p><img alt="CameraKings" src="//cdn.optimizely.com/img/5251360393/2ee6812bde204c9eaef6e4ea915e5fbb.png" width="270px"></p>
</div>

 

Why is this happening?

olivehouse 03-09-16
 

Re: Optimizely is changing unwanted images

This is happening on different parts of the website as well :/

Another example of this uses the code:
<p style="text-align: center;"><img class="retina" alt="" src="/media/website/Search/search-clapper.png" /></p>
JDahlinANF 03-09-16
 

Re: Optimizely is changing unwanted images

When I put myself into the B group of the experiment, I see the "... Your local filmmakers" logo in two places on the page - the top navigation and on the left-side of the main content.  It sounds like you want only one of them to be replaced.

This line of code from your B variation replaces every image on the page that is contained inside of a <p> tag:

$("p > img").replaceWith("<div class=\"logoimage-header\"><img alt=\"CameraKings\" src=\"//cdn.optimizely.com/img/5251360393/2ee6812bde204c9eaef6e4ea915e5fbb.png\" width=\"270px\"></div>");

If you want that code to only update the header, then your selector needs to be more specific.  Such as like this:

$(".header-container .logo p img").replaceWith("<div class=\"logoimage-header\"><img alt=\"CameraKings\" src=\"//cdn.optimizely.com/img/5251360393/2ee6812bde204c9eaef6e4ea915e5fbb.png\" width=\"270px\"></div>");