πŸŽ›οΈHow to Set Up an Advanced Test using our JavaScript API

Intelligems allows you to set up powerful custom tests using its window object API.

Step 1: Create a new test

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. Select Content Test , then Advanced, then Create Test.

Step 2: Create your test groups

Create a test group for each theme you want to include in the test. Fill in the Test Name and Test 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.

You can add new 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. Click β€˜Continue’ when you are done.

Step 3: Set up targeting if needed

If you'd like to include, exclude, or assign specific treatment to certain traffic for your test, you can use our Targeting features. Check out this article for more information on configuring these options.

Step 4: Enable the Google Analytics integration if desired

If you would like to create an audience for each test group in GA4, enable the integration here.

Step 5: Get relevant IDs

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:

Step 6: Use the Intelligems window object API to set up your custom test

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 condition logic in your own Javascript code to provide a different experience.

Last updated