Rich-text Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
Manually Activate More than 1 experiment at once via JS API
parththakkar 03-17-16
Manually Activate More than 1 experiment at once via JS API
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report
Hello,
So I can successfully activate 1 experiment via JS API, but for my particular usecase, I have to activate 2 at a time and I use audience segmenting to determine which one the user sees.
However, I have been unsuccessful in activating 2, the syntax I used is:
if (condition == "true") { window.optimizely.push(["activate", xxxxxxxx]); window.optimizely.push(["activate", xxxxxxxx]); }
Any Tips or advice is much appreciated!
Analyst
MartijnSch 03-18-16
Re: Manually Activate More than 1 experiment at once via JS API
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report
Hi,
What probably is happening right now that instead of trying to activate what you'd like to activate is that you're overriding the current test/variant that you're activating. What you could is initialise a second Optimizely with a different naming convention in order to do this. Not sure how you're dealing with the audience segments, could you share more about what you're achieving with that?
What probably is happening right now that instead of trying to activate what you'd like to activate is that you're overriding the current test/variant that you're activating. What you could is initialise a second Optimizely with a different naming convention in order to do this. Not sure how you're dealing with the audience segments, could you share more about what you're achieving with that?

parththakkar 05-09-16
Re: Manually Activate More than 1 experiment at once via JS API
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report
To follow up with this,
I actually activated all the experiments first and then used JS to assign the visitor to the relevant audience that would then get picked up by the relevant optimizely experiment.
I used this bit of code to activate all manually activated experiments:
window['optimizely'] = window['optimizely'] || []; window['optimizely'].push(["activate"]);
Analyst