Optimize
3.7K members online now
3.7K members online now
Learn how to create your first experiment and get tips on creating A/B, redirect, and multivariate tests.
Guide Me
star_border
Reply

For image variations you may need override the html if the original image has a srcset attribute

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

When trying out a multivariate experiment on my pre-production site I was having issues with image variants not showing. This was because the images had a source set (srcset) attribute specified as well as a source. Just updating the image source resulted in the original image still being shown because the images specified in the srcset attribute were taking precedent.

 

To get the variant to show the correct image I had to override the html for the image to remove the srcset attribute (or alternatively you could amend all of the images specified in the srcset).

 

This is likely to impact experiments on sites based on CMSs like Wordpress that automatically create multiple image sizes and add the srcset attribute.

1 Expert replyverified_user
Marked as Best Answer.
Solution
Accepted by Jason O (Community Manager)
February 2017

For image variations you may need override the html if the original image has a srcset attribute

Community Manager
# 2
Community Manager

Hello @Duncan E,

 

This is a known issue and we don't have an ETA. I'm going to accept this answer and will re-open the thread when it's fixed. Feel free to subscribe to the thread so that you get a notification. 

 

Thanks for your report

- Jason