Sitewide Header Test + Homepage Headline Test
I'm trying to run a test where I change a site's tagline in the header across all pages along with a block of H1 text on the homepage.
When I set up a substring match to take the tagline change to all pages, it also changes the H1 text on all pages (ignoring the H1 class this is unique to the homepage).
Is there a way in variation code to only include the H1 edits on the homepage through a simple match? Or do I need to set these up as two seperate experiments?
Solved! Go to Solution.
Your response made me take another look and I think it was an issue where the selectors are determined by the DIV container, but editing the element in Optimizely was not picking up the right DIV.
The div is set as:
<div class="col-md-14 banner-content">
but it pulled
$(".col-md-14 > h1").replaceWith("<h1>CLIENT TEXT</h1>").
By changing it to
$(".banner-content > h1").replaceWith("<h1>CLIENT TEXT</h1>"),
it has confined the change to just the homepage.
We had a similar problem making a change to a CSS3 style through the visual editor, so I think it's just a lesson to make sure Optimizely is speaking the language of the site (and vice-versa.)