Rich-text Reply

The changes I make in variation #1 are not saving.

joebray 11-16-16

The changes I make in variation #1 are not saving.

I can edit the HTML ok and save it, but if I leave and come back the changes I made are no longer there for the test. The test is on this page (https://www.cougarmtn.com/) and the test is to remove the pricing (located about half way down). 

This is a wordpress website, and the pricing section is inserted via a widget.

Level 2

robertchan 11-16-16
 

Re: The changes I make in variation #1 are not saving.

This is dependent on how your widget loads, but you can just copy and paste the following into your experiment variant's variation code that you're targeting:

 

window.onload = function(){
	var pricingSection = document.getElementById('tm-top-c'); 	  // Grabs the pricing section
		if(pricingSection){ 									  // Checks if the pricing section exists when the document has finished loading
			pricingSection.remove(); 							  // If the pricing section exists, remove it
		}
}

I've added comments to help you see what's happening.

Robert Chan

Experimentation Hero
joebray 11-29-16
 

Re: The changes I make in variation #1 are not saving.

I've tried inserting that into the test area, but it still isn't saving (I save the experiment and leave, come back and the edits are no longer visible). Here is the code I'm inserting:

Level 2
robertchan 11-29-16
 

Re: The changes I make in variation #1 are not saving.

The code I provided should be inserted into the variation code section with <script> and </script> (that section is already reserved for JavaScript). If you're making HTML changes below that code then those need to be rewritten into JavaScript as well if they're being pasted into the same variation code section.
Robert Chan

Experimentation Hero
joebray 11-29-16
 

Re: The changes I make in variation #1 are not saving.

I'm not sure where that is - "should be inserted into the variation code section" - can you specify?
Level 2
robertchan 11-29-16
 

Re: The changes I make in variation #1 are not saving.

Sure thing, I've attached a screenshot. It's the big white text area toward the bottom that says Variation Code above it.

Robert Chan

Screen Shot 2016-11-29 at 12.06.01 PM.png
Experimentation Hero
joebray 11-29-16
 

Re: The changes I make in variation #1 are not saving.

One stop closer, but inserting the code in the Variation Code section produces errors. Here's a screenshot:
http://dev.cougarmtn.com/wp-content/uploads/2016/11/scrennshot2.png
Level 2
robertchan 11-29-16
 

Re: The changes I make in variation #1 are not saving.

You need to remove the script tags as I had mentioned, so where it says <script> and </script> - those need to be removed. On top of that, the HTML you're using to replace things with should be stored into one variable. For example:

var theHtmlYouMade = '<div><strong>Some text in here</strong></div>';

Now, instead of everything you have there, you can instead do the following:

$('.uk-scrollspy-init-inview > .uk-margin > div:eq(0)').replaceWith(theHtmlYouMade);

Finally, you need to work with your developers to resolve the following issues first otherwise you'll continue encountering issues: $ is undefined at the moment which means you can't use $('.some-selector') for example, and have to use jQuery('.some-selector') instead, and the selector you're attempting to replace with new HTML is not available until you scroll down on your page. You'll need to listen for whatever even triggers the presence of .uk-scrollspy-init-inview > .uk-margin > div:eq(0) and work off of that.
Robert Chan

Experimentation Hero
joebray 11-29-16
 

Re: The changes I make in variation #1 are not saving.

Unfortunately I don't have a developer at the moment - sounds like this tool is not a good fit for me. I do want to thank you Robert for taking the time with me. Thanks!
Level 2
robertchan 11-29-16
 

Re: The changes I make in variation #1 are not saving.

Anytime, I'd say one approach would also be to use the WYSIWYG, make the adjustments you would have made with HTML then just paste the window.onload code I provided you after you do that.
Robert Chan

Experimentation Hero