This document provides information on how to use the Hackle SDK for web browsers or apps created with Go.


Before You Read

  • If this is your first time working with an SDK, please refer to the What is a SDK? document
  • There are several keys mentioned in this document. In order to find out where to obtain these keys and the roles of each key during the SDK integration, please read Keys Used by SDK Functions before you read this document.

Follow the links below to be redirected to the necessary code for each step.

Step 1: Integrating SDK SDK Integration
Step 2: Setting up user identifiers and properties User Identifier and Properties
Step 3: (For A/B test) Setting up traffic distribution for different test groups Traffic Distribution
Step 4: (For feature flags) Setting up features for on/off state of feature flags Feature Flag Determination
Step 5: (For A/B test and data analytics) Setting up tracking specific user events for data collection and analysis Track and Send User Events

Sequence of SDK Integration and Configuration


1. SDK Integration

You must integrate the SDK into your personal code in order to use Hackle's services.

You only have to do SDK Integration once. For example, if you are already tracking and sending events but would like to also use the feature flag function, you do not need to re-integrate a new SDK. Once integrated, you're all connected. Make sure you do not initialize the SDK multiple times, as this may lead to problems.

2. The Functions of SDK

Different types of SDK functions can be used together depending on the main purpose. This should also be set in advance before using the functions.
Some typical use cases include:

Case 1. A/B Testing

This function distributes incoming user traffic into test groups A, B, and C and returns the information on the assigned groups of the users back to the server to keep a record of each userโ€™s exposure after the distribution is complete. We also call this the "distribution into test groups" function.

After distribution, the SDK collects the user behavior accordingly to each test group. The user behavior is a pre-defined user event. This step is necessary to calculate the metrics and findings of A/B testing.

Case 2. Feature Flag

If you apply a feature flag for a specific feature, you can enable or disable that feature with a single click on the Hackle Dashboard. The SDK needs to be able to get those values at the code level and consequently determine the on/off state of the feature flag for each user.

Case 3: Event Tracking

This is used to record specific user actions (events).
This feature has many applications. It is useful for measuring reactions to A/B tests or feature flags because it records user actions. Additionally, it can be valuable for activities like log tracking and user funnel analysis.

Case 4: Detailed Data Analysis

You can perform detailed data analysis using user properties. User properties can be assigned to user objects and can be sent along with test group distribution, feature flag decisions, and user event transmissions.

Case 5: Targeting

In A/B testing and feature flags, you can target users with specific properties. In A/B testing, only users with specific properties can participate, and in feature flags, you can apply feature flags to users with specific properties.

Case 6: Remote Configuration

Remote configuration allows you to control the behavior and settings of your application in real-time by replacing values or properties managed in the application with parameter values defined in the Hackle dashboard. Parameters can be set for all properties of client/server-side applications, such as button colors or external links.