For the complete documentation index, see llms.txt. This page is also available as Markdown.

Tutorial

Overview

This document provides a hands-on guide to help you understand Hackle A/B Tests. You can experience the Hackle platform integration process using the Hackle JavaScript SDK, and through this, understand the basic flow of an A/B Test.

Who this tutorial is for

  1. If one person is doing the tutorial

  • This is aimed at developers, but anyone who understands what the following code means can follow along.

varString = "I am String";
varNumber = 3000;
  1. If two or more people are doing the tutorial together

  • We recommend splitting roles: one person to handle the Dashboard, and one person to handle the code work.

Prerequisites

  • Text editor

  • Web browser

  • Hackle Dashboard (logged in, Production Environment selected)

If you are using the Mac text editor

You need to switch to plain text mode in the Mac text editor to get the correct output. For information on switching edit modes, refer to the help provided by Apple. → Work with HTML documents in TextEdit on Mac

1. Create an A/B Test

Step 1. Create a new test

Go to A/B Test in the Dashboard and click the Create new A/B Test button in the upper right to create a new test.

You can leave everything blank except the required test name

The test name is required, so enter an appropriate name. The rest can be left blank. Then click the Create test button in the lower right.

Step 2. Set goals

On the created A/B Test screen, you will see a button that says Set goals. Click this button to register a goal.

Goals are used to measure the performance of an A/B Test and at least one must be registered.

When you click the Set goals button, a dialog appears. You can either select a goal recommended by Hackle, or create one yourself. In this tutorial, let's select one of the recommended goals. Select Average Purchase Amount from the recommended goals.

Select Average Purchase Amount from the goals.

The selected goal shows the event name, goal type, and success criteria. Among these, the purchase value under the event name is used as the event key, so please remember it. The event key is mentioned again in Step 5 and Step 8.

  • For details on each item, refer to the Set Metrics document.

Step 3. Override (optional)

This step is not required and can be skipped. However, we recommend including it in the tutorial to understand the Override feature.

Override is a feature that forces a user with a specific user identifier into a specific group. To do this, enter a user identifier through the Test Device Registration menu in the A/B Test Settings tab.

Click the Register test device button to configure.

Type abcde in Group A and press Enter, then type qwerty in Group B and press Enter. The user identifiers are then registered in the respective group lists. Afterward, click the Save button on the right.

Step 4. Start the test

The test preparation in the Dashboard is now complete. Click the Start button in the upper right. A dialog like the one shown below will appear.

Set the traffic percentage to 100.

Since the purpose of this tutorial is to experience A/B Testing, we want all users to be exposed to the A/B Test. Therefore, set the traffic percentage to 100%. Finally, click the Start button in the lower right of the dialog.

2. Integrate Hackle Platform

Now it is time to integrate the Hackle platform using the SDK. As mentioned, we will integrate the JavaScript SDK.

Step 5. Copy and paste the example code

Open a text editor, create a new file named hackle_sdk_test.html, and copy-paste the following code.

Looking at line 7 in the code above, it says You must modify the SDK Key and Experiment Key values directly. We will modify these values in the next step, Step 6. Below that, it says do not modify eventName. The purchase value assigned to this variable is the event key of the goal set in Step 2.

Step 6. Modify the SDK Key and Experiment Key

The SDK Key can be found in the SDK Integration Info menu. Referring to the screenshot below, copy the Browser key for the Production Environment.

Click the icon to copy.

The Experiment Key can be found on the detail page of the A/B Test you created earlier.

In the screenshot above, the Experiment Key is 13.

The number in the Experiment Key {number} part to the left of the test name is the Experiment Key. In the example above, the Experiment Key is 13. However, keep in mind that you must enter the Experiment Key of the A/B Test you created, not 13.

For example, if your SDK Key is abcdefg and the Experiment Key is 13, the code should be modified as follows:

Be careful not to delete the quotation marks when replacing the SDK Key. Once you finish modifying the SDK Key and Experiment Key and save the file, the SDK integration is complete.

3. Run the A/B Test

Step 7. Variation distribution practice

Open the hackle_sdk_test.html file you edited earlier in a web browser, and you will see a screen like the one below.

The hackle_sdk_test.html file opened in a browser

Follow the steps shown on the screen.

First, try entering a USER ID. Enter abcde. Then click the Variation Distribution button.

If you configured Override in Step 3. Override, the user is force-assigned to Group A and you will see the result shown in the screenshot above. If you did not configure Override, you may see the user assigned to Group B.

This time, enter qwerty and click the Variation Distribution button.

Opposite to the abcde example, if you configured Override in Step 3. Override, the user is force-assigned to Group B and you will see the result shown above. If you did not configure Override, you may see the result assigned to Group A.

You can also enter any arbitrary user IDs to see the variation distribution results.

You can review the results distributed so far in the Dashboard. Click the A/B Test with the Experiment Key currently being tested in the Dashboard to see a screen like the one below.

Click the Real-time Exposure Status tab

Clicking the Real-time Exposure Status tab here shows the exposure results of test distributions performed over the last 30 minutes. These results can be refreshed every 30 seconds by clicking the Update button.

Real-time Exposure Status

Step 8. User event tracking practice

Now that you have a solid understanding of variation distribution, let's practice user event tracking. Sending a user event can be thought of as notifying Hackle that a specific event has occurred.

If you closed the hackle_sdk_test.html file, open it again.

3 more steps have been added.

Enter any user ID again, click Variation Distribution to see the distribution result, and then click the last button Track User Event that you haven't clicked yet. Repeat this a few times, then navigate to Events in the Dashboard.

Click purchase.

Click purchase in the event list. This is the event key of the goal set in Step 2.

You can see the event tracking status for the last 30 minutes.

You can see a real-time graph of events collected for that event over the last 30 minutes. Like the Real-time Exposure Status, it refreshes every 30 seconds.

This graph shows the collection results for a specific event, so if you only performed variation distribution for a user ID without clicking the Track User Event button, nothing will appear in the graph.

4. Now it's your turn

If you have completed up to this step, you have experienced the overall A/B Test flow with Hackle using the JavaScript SDK. Now move beyond this tutorial and create an A/B Test that suits your needs. For areas where you need more detailed information, refer to the Related Documents provided at each step.

Last updated