Rich-text Reply

Conditional activation in a Multipage test, How to create a rule only for certain pages?

miguelm 05-09-16
Accepted Solution

Conditional activation in a Multipage test, How to create a rule only for certain pages?

Hi,

 

I'm going to run a multi page test (which involves four pages), and I need conditional activation rules, but is not the same rule for all pages. How can I do this?

 

Thank you,

Level 2

JasonDahlin 05-09-16
 

Re: Conditional activation in a Multipage test, How to create a rule only for certain pages?

@miguelm - Can you walk through what you are trying to accomplish?  Are you trying toadjust each of 4 different pages but only when the user performs a different action on each page?

--Jason Dahlin
Analytics and Testing Guru Smiley Happy
Experimentation Hero

Re: Conditional activation in a Multipage test, How to create a rule only for certain pages?

[ Edited ]

@JasonDahlin is right on the money with this one. If you want to preview your experiments live, the ideal way to do it for your use case is to use a test cookie.

More info on setting up test cookies here.

What I used to do was just set the experiment live with 100% traffic to my desired variation and use a query parameter for the word "test" - but THIS SHOULD NOT BE DONE! There's a lot of reasons why, but just don't do it haha.

Analyst
miguelm 05-10-16
 

Re: Conditional activation in a Multipage test, How to create a rule only for certain pages?

Hi @JasonDahlin I want to run the experiment a in a Hotel company website, the test consists in show a promotional message for certain hotels and show the message during the entire booking process if the visitors has selected the promotional rate. For instance:

 

  1. Result list; If at least one of the special hotels has availability
  2. Step1 (where the user select type of room & rate); If is a hotel with the special rate
  3. Step2 (Check-out, where the user introduce data); Only show the mesage if the user has selected the rate
  4. Confirmation; Only show the message if the user has selected the rate

 

Conditional activation rules are based on utag_data vars. So what I need for this multi-page experiment is the possibility to create a conditional activation rule for each page, instead of one unique conditional activation rule for all the pages. If this is not possible, I'll try to create a rule concantenating the different ifs using the OR ( || ) operator.

 

Thank you, best regards

Level 2
JasonDahlin 05-10-16
 

Re: Conditional activation in a Multipage test, How to create a rule only for certain pages?

@miguelm - I think I figured out the solution... instead of thinking about it as "activating" the experiment on each page, let the experiment run on Step 1, 2, and Confirmation, but place a conditional inside each page's variation code so that only those users who meet the criteria for that page see the message.

 

1- Set up the experiment so it runs on all pages, and define your page types as you've laid out (Results, Step 1, Step 2, Confirmation).  Using Manual Activation on the Results page would work - that way only users who have seen a results list that contains a hotel with the rate available will show up in your dashboard.

 

2- In the "Variation B" for the Results page, add code that counts the number of results on the page and adds the message:

if (specialRateAvailable == true) {
  //code that shows message here
}

 

3- In "Variation B" for Step 1, if the chosen hotel has a special rate, show the message:

if (chosenHotelHasSpecialRate == true) {
  //code that shows message here
}

 

4- In "Varation B" for Step 2, if the special rate was chosen, show the message:

if (specialRateChosen == true) {
  //code that shows message here
}

 

5- In "Confirmation" for Step 2, if the special rate was chosen, show the message:

 

if (specialRateChosen == true) {
  //code that shows message here
}

 

 

With this set up - users will only be in the experiment if they saw the message on the Results page, will only see the message on conversion funnel pages if they meet the criteria for seeing the message, and only those users will be counted as completing any of your conversion funnel goals.

 

Let me know if there is a benefit to your original method of activation that I'm not seeing.

--Jason Dahlin
Analytics and Testing Guru Smiley Happy
Experimentation Hero

Re: Conditional activation in a Multipage test, How to create a rule only for certain pages?

Great solution by @JasonDahlin, but I want to caution that if you begin your variation code with a Vanilla JS conditional, Optimizely will wait for DOMReady before executing any of your variation code - potentially causing the Flash of Original Content and potentially slowing the pageload. But considering how easy and nice that solution is, you can actually tell optimizely to force run that code by wrapping the Vanilla JS in these comments:

/* _optimizely_evaluate=force */
   your "pure JS" goes here
   /* _optimizely_evaluate=safe */


More info on this here


Analyst
JasonDahlin 05-10-16
 

Re: Conditional activation in a Multipage test, How to create a rule only for certain pages?

@parththakkar - Yes!  As long as you are looking for and/or manipulating items that are part of the web server's reponse (no dynamic content) and can access them using jQuery, use the "force" mode to let it run right away.

--Jason Dahlin
Analytics and Testing Guru Smiley Happy
Experimentation Hero
miguelm 05-11-16
 

Re: Conditional activation in a Multipage test, How to create a rule only for certain pages?

Thank you @JasonDahlin I'll do it that way and I'll add the visitors who met the condition in a custom dimension for segmented the results.

 

 

Level 2