Tutorial / Example: Simple A/B Test
Last updated
This document introduces an example using the JavaScript SDK from Hackle's supported SDKs. The purpose of the example is to:
Understand what code work is needed.
Experience the features of the SDK.
The example performs the following:
Accepts an arbitrary User Identifier as input.
Clicks the Variation Distribution button.
Performs variation distribution and tracks the hackle_test_event_key event.
View example code and practice link
Hackle JavaScript SDK Integration and Feature Example
Tip. Reading the JavaScript documentation alongside the comments in the code will help you understand it quickly.
The example runs based on an A/B test created by Hackle for demonstration purposes. This example A/B test has the following characteristics:
It is configured to let you experience multiple types of distribution reasons.
Entering apple as the User Identifier returns variation A, and banana returns variation B.
For other input values, the variation is determined according to the Variation Distribution Principle.
To run this example with an A/B test you created in the Hackle Dashboard, you need to modify the SDK Key and Experiment Key in the JS tab.

Last updated