Query audiences a visitor is in via js
maybe i just have a bad day but i can not find any info in the docs how to query via the js api to which audiences a visitor belongs, which means which audience conditions he meets.
I just want to check if a specific visitor is part of an audience or not.
Help is highly appreciated :-)
Solved! Go to Solution.
There isn't a JS API for getting the audiences a visitor has qualified for but you can see this information in the Optimizely log by adding ?optimizely_log=true to the URL. The log will show you all the activity taking place in the snippet including which audiences a visitor has or has not gotten into. Please see the article below for more information on how to read the log.
Hi @CouchPsycho ,
Surely this is "not supported" and may "change at any time without telling us", but some audience information is available in localStorage.
In this array of objects, if decision.experimentId is not null, and you have any audiences attached to your experiment, you should see the audience ids in the array located at decisionTicket.audienceIds.
Analytics and Testing Guru