Rich-text Reply

Setting up audiences

dianaluo 08-07-18
Accepted Solution

Setting up audiences

Hi, one of my customers is trying to instrument a test where they want to target those who have already seen a page earlier in the funnel. How do I create this audience in Optimizely X? 




Level 2

CouchPsycho 08-08-18

Re: Setting up audiences



one idea:


Create a cookie or a local storage entry on that page and refer to it in your audience definition. Cookie usage is quite easy and a standard option in audience definitions.


Local storage usage may be done by using jQuery. Have a look at this ;-)


where @JDahlinANF gave an idea and an example.


Kind regards



Kind regards



Re: Setting up audiences

Hi Dianaluo,


Depending on what plan you are on this can either be very easy or a little bit hard.


Since you are asking the question I am going to assume you don't have the 'Visitor Behaviour' option available within your Audience builder. As described here


This is only available on the Enterprise plan I believe.


As CouchPsycho mentioned there are alternatives and custom JS is a great option.


I would recommend querying the Optimizely API and the page view object.



  1. Create an audience using the 'Custom Javascript' drag and drop
  2. Copy/Paste this code into the 'Custom Javascript' box
  3. Update the text (in the code) which says ''your page name here" with the api name of your page
  4. Save it and add it as an audience condition on your experiment

Hopefully that helps and good luck,




dianaluo 08-09-18

Re: Setting up audiences

Hi all, thank you both for posting - super helpful!
Level 2