How to Set Up a Test using our JavaScript API
Intelligems allows you to set up powerful custom tests using its window object API.
Last updated
Intelligems allows you to set up powerful custom tests using its window object API.
Last updated
Navigate to the "A/B Tests" tab in the menu on the left-hand side of the Intelligems app. Once there, click "Create New Test" above the experiments table.
Fill in the Name and Description for the experiment you are creating. This information is all internal - the more detail you include here the better! Tests can be live for several weeks, and your future self will thank you for including the details here. Select 'Content Test", then "Onsite Edits" and then "Create Test".
Create between two and five groups to include in the test by clicking on the ‘+’ button. Name the groups for the experiment and use the slider to allocate what percentage of traffic will go to each group. When you are done adding groups, click "Next step" in the top right.
The more groups you have, the longer it will take to get statistically significant results. You’ll need about 300 orders for each group in the test to detect a 10% change in conversion with 90% confidence.
No need to set up any Content Edits, Styles or JavaScript in this step of the set up if you are planning to use our JavaScript API. Go ahead and move on to step 4.
Targeting is an optional step. This tool allows you to apply specific conditions to certain site visitors.
There are a few different ways you can do this:
You can set up currency and country targeting that allows you to limit your test to a single currency and/or a list of specific countries. This feature is defaulted to your store currency for price test.
You can use UTM parameters to customize your user experience under the Audience option.
You can filter traffic based on JavaScript Expressions under the Audience option.
You can filter traffic based on device type (i.e. mobile or desktop) under the Audience option.
You can filter traffic based off of whether a visitor is new or returning under the Audience option.
You can prevent users from being targeted by related experiments to reduce undesired interactions under the Mutually Exclusive Tests option.
You can learn more about targeting here!
Finally, select whether analytics should by default consider only orders containing certain products you want to test (for example something related to a particular PDP), or orders containing any products in your shop. You can change this later after the test has started by changing the option in your Analytics filters. Go ahead and save the test, and move on to step 6.
Custom content tests require you to know the experiment ID and test group IDs so that you can branch your design or logic accordingly. You can get this information by clicking the "Show Info" button in the more menu:
Now that you have your test group IDs, you can use Intelligems' window object Javascript API to get the current user's test group for the given experiment. Once you know the user's test group, you can branch logic and styling with it. For example, you might set a class or show/hide an element to affect styling, or conditional logic in your own Javascript code to provide a different experience.