Using bucketVisitor API on Optimizely X
I'm trying to force users into a specific variation based on some custom conditions. Can I call the bucketVisitor API at any point in the process or does it have to be made at a specific time? Can you force a condition using bucketVisitor within expirement-level code or variation-level code. I have tried making the bucketVisitor calls from those areas and it doesn't appear to be working. I'm thinking it's too late and the system has already determined the variation at that point.
I understand that you are asking about the bucketVisitor API. Your suspicions are correct - the bucketVisitor calls from Experiment and Shared Code are after the experiment has already included the visitor into the experiment and been assigned a variation. I recommend you add the bucket logic in Project JS, to run before the rest of Optimizely's evaluations.
If you have further questions or issues using the bucketVisitor API, please submit a Support Ticket with the experiment ID so we can investigate further.
Woojae | Technical Support Engineer