简体   繁体   中英

How to trigger an A/B test VWO via java script

I'm searching a solution to trigger A/B test in VWO via java script only for a special group of users. I've already found something like this:

   Define Custom Visitor Segments -> Others -> JavaScript variable.

It allows to define some condition in js and decides to run A/B test for a specific user who passes through that JavaScript condition.

Is it the best way?

Yes, you can use the JS variable segmentation to define the JS within it and write the logic to evaluate a condition. However, you need to make sure that all the JS variables that are being used to evaluate the JS must be available before the VWO code.

In case the JS variables are coming late on the page then you can go with the feature called Manual Activation which will allow firing AB test on any event on the website.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM