3rd party script wont load in editor. help!
I have a Product recommendations script generated by Barilliance. it loads and inserts script into the DOM on the page. I am trying to AB test the page with and without recommendations.
It will not load in the Editor. even with safe mode turned off and allow secure content enabled. I cannot see the Barilliance script loading and inserting their recommendations. So therefore I dont know how to select their content and turn it off for 50% of the traffic.
and the recommendations are here (image)
Thanks for reaching out to Optimizely Support!
I understand that you would like to A/B the presence of the recommendation block on the page.
Before we go further, are you able to load the rest of the page in the Visual Editor or is it the full page that doesn't load in the Visual Editor?
To achieve what you are looking to do, we can remove the element on the page in one of your variations. I took a look at your page and it seems like the #product-tabs > div:eq(0) CSS selector is the one responsible for displaying the recommendation products. So in the variation code, this line of code should remove the element from the page :
$("#product-tabs > div:eq(0)").remove();
You can test if this work by using some of our Quality Assurance tools to test the experiment before it goes live. We have a dedicated article on this topic that may be of interest to you. You can check it out by clicking here.
I hope that is helpful. Feel more than free to reply back with any additional questions at all.
@brassones here's one approach that might work for you. Let's say that Barilliance says that you need to inject the following script onto your page:
You can open up a new variant, and build the script as follows:
You will need to replace BARILLIANCESCRIPT with whatever URL is in your script.