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

Server User Identifier

Since users cannot be identified on the server, you must always pass a custom identifier as a parameter.

// Variation distribution
long experimentKey = 42L;
User user = User.builder().userId("ae2182e0");
Variation variation = hackleClient.variation(experimentKey, user);

// Event tracking
hackleClient.track("purchase", user);
# Variation distribution
uesr = Hackle.user(user_id='ae2182e0')
variation = hackle_client.variation(experiment_key=42, user=user)

# Event tracking
event = Hackle.event(key='purchase')
hackle_client.track(event=event, user=user)
// Variation distribution
const experimentKey = 42;
const user = { userId: "ae2182e0" };
hackleClient.variation(experimentKey, user);

// Event tracking
hackleClient.track("purchase", user);

Matching Identifiers Between Client and Server

When using the Client and Server SDKs simultaneously, you can align the identifier for the same user across both environments.

In this case, it is recommended to pass the identifier via an HTTP header during client-server API communication, as shown below.

Last updated