Rich-text Reply

Testing A/B's on Shopify not working

adoredscents 02-09-16

Testing A/B's on Shopify not working

Hi,

 

We use Shopify for our site adoredscents.com and we have implemented the tag. When i come here to test it and make sure its working when i choose a different varient it doesnt change the homepage slider image like it should...

 

Any help would be apprecited 

David_Orr 02-11-16
 

Re: Testing A/B's on Shopify not working

Hi,

 

Thank you for reaching out. I took a look at the site and it appears to be two issues: Optimizely isn't able to find the element it needs to change by the time it finish loading and the homepage slider's functionality is preventing the changes to appear. The first issue can be resolved by following the steps below. But the second will require you to get in touch with the site's developer. The reason is because the image that the experiment is replacing will disappear when the code below is used. But the actual HTML code is being changed. 

 

Optimizely isn't able to find the element it needs to change by the time it finish loading:

 

You may use this simple interval code that will wait until a selector is available until the variation code applies.

 

window.myInterval = setInterval(function() {
  			if ($("SELECTOR").length > 0) {
//paste variation code here
      				clearInterval(myInterval);
 			}
}, 100);

Here are the steps on how to use this:

 

1. In the experiment editor, click on the blue "edit code" box.

2. Copy the selector for the thing you would like to change. The selector for the image you are replacing currently is $(".flex-active-slide img").

3. Copy the interval code above and paste it in the variation code.

4. Replace "Selector" on line 1 with .flex-active-slide img 

5. Cut and paste the variation code in the variation code.

 

David

Senior Technical Support Engineer
Optimizely

Re: Testing A/B's on Shopify not working

Thanks David can you check if what you outlined was changed correctly on optimizley's end...

Also if there a way you can tell me in laymans terms how to communicate to my developer what is wrong with the shopify theme?