Rich-text Reply

Optimizely changes style of other elements

zundy 07-10-16

Optimizely changes style of other elements

So i'm testing the main message in my hero image (my H1) but the style changes effect other H1s on my site.

I'm pretty sure that shouldn't do that.

Is there a way to make sure it only effects the item I wanted to change?

Level 2

Re: Optimizely changes style of other elements

I think we would need a bit more information.

Do you use experiment CSS to alter the CSS or you insert it via jquery only for the variation? Also, what's the experiment targeting settings - maybe you've added the global CSS and your experiment is using RegEx to target more pages across the website (or the whole website).
Performance Marketing Manager @ Blacklane
Founder @ Stereofox

zundy 07-11-16
 

Re: Optimizely changes style of other elements

I'm not using experiment CSS. I just change the text using the 'change text' feature and moved it a bit using the 'more and arrange' feature.

I also removed 2 form fields.

 

I don't think I use jquery. I've just implemented the JS code and started playing around in the WYSIWYG editor.

I didn't add a global CSS and I am not using Regex. I'm just a'b testing the homepage.

Level 2
AllisonR 07-11-16
 

Re: Optimizely changes style of other elements

Hi there,

 

What @himynameisivo is reffering to involving jQuery is the experiment variation code. This article explains where to find your experiment's variation code. Each time you make a change using the Visual Editor, a corresponding line of jQuery is added there. This jQuery will be run on all pages where the experiment is targeted. 

 

To make sure your variation code only changes the one headline you're testing, you'll want to make sure the jQuery selector used in the variation code is specific to only that headline. This support article contains a non-technical explanation of how jQuery selectors work if you're not already familiar. You can make your selector more specific by adding a class or id name. 

 

Hope this helps!

Allison
Sr. Technical Support Engineer
Optimizely | EMEA
Optimizely
zundy 07-11-16
 

Re: Optimizely changes style of other elements

So if I get it right, if I add an ID to my specific headline on my end, the jQuery will stop using CSS path and therefore won't change any other titles on the page, only the one I meant to change. Is that right?
Level 2