# Troubleshooting

Here is a summary of common integration issues and their solutions.

{% hint style="success" %}
If you encounter a problem, check the following first.

* Verify that `variation` and `track` are using the same User Identifier.
* In the JavaScript SDK, verify that user information is passed as an object.
* Check whether previous configuration is persisted due to browser cache.
* Verify whether the aggregation criteria differ between Real-time Exposure Status and goal metrics.
  {% endhint %}

### 1. A User Identifier error occurs when calling `variation`

#### Cause

The JavaScript SDK accepts user information as an object. Passing only a string may cause an error.

#### Solution

Pass user information as an object as shown below.

```javascript
hackleClient.variation(6, "user_id") // incorrect
hackleClient.variation(6, { id: "user_id" }) // correct
```

### 2. I am using a custom identifier but the metrics look incorrect

#### Things to check

Both `variation` and `track` must pass the same identifier. If only one side passes the identifier, they may be counted as different users.

#### Incorrect example

```javascript
hackleClient.variation(7, { id: "12345" })
hackleClient.track("purchase")
```

#### Correct example

```javascript
// Option 1. Use a custom identifier
hackleClient.variation(7, { id: "12345" })
hackleClient.track("purchase", { id: "12345" })

// Option 2. Use the device identifier managed by the SDK
hackleClient.variation(7)
hackleClient.track("purchase")
```

{% hint style="warning" %}
The method of passing the identifier must be the same in variation distribution and event tracking.
{% endhint %}

### 3. The Real-time Exposure Status keeps increasing for the same user

This is normal behavior.

* Real-time Exposure Status aggregates the raw call count of `variation`.
* This is the total exposure count without deduplication.
* Goal metrics are calculated based on unique visitors (UV) with deduplication.

**In other words, the numbers in Real-time Exposure Status and goal metrics can differ.**

### 4. After the test ends, all traffic goes to the Winner group

This is normal behavior. Once a Winner is selected, subsequent traffic is directed to that group.

#### Recommended order

1. End the A/B test in the Dashboard.
2. Select the Winner group.
3. Remove the test-related code from the Production environment.
4. Archive the test in the Dashboard.

### 5. Overrides in the JavaScript SDK are not reflected immediately

The JavaScript SDK caches configuration values for performance. As a result, Override results may not appear immediately.

#### Solution

1. Perform a hard refresh in Chrome.
2. If that does not work, open Developer Tools.
3. Right-click the refresh button.
4. Select **Empty Cache and Hard Reload**.

![Clear cache and hard reload in Chrome browser](/files/OHbNfPWfwnC5FKjIF4Mq)

### 6. It seems like users are all being assigned to variation A

Variation A is the default group. Users may be placed in group A in the following cases:

* When the user is not allocated to the test
* When the user is an Override target
* When an error occurs

Related behavior can be found in detail in the documents below.

* [Variation Distribution Process](/en/ab-test/group-distribution/ab-variation.md)
* [Variation Distribution Principle](/en/ab-test/group-distribution/ab-bucketing.md)

#### How to identify the cause

Some SDKs support the `variationDetail` method.

This method also returns the reason why a user was assigned to a specific group. If you need to analyze the cause, check this method first.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.hackle.io/en/development-guide/troubleshooting.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
