> ## Documentation Index
> Fetch the complete documentation index at: https://docs.paraminternationalltd.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Identify Users

> Use identify after a user logs in, registers, or when their profile information becomes available.

The method connects anonymous website activity with a known user. This helps you to target user through ads and many more.

## Identify a user

Pass your application’s unique user ID to the `identify()` method.

<CodeGroup>
  ```javascript npm theme={null}
  TwinalyzeAnalytics.identify("USER_123");
  ```

  ```html CDN theme={null}
  <script>
    window.TwinalyzeAnalytics.identify("USER_123");
  </script>
  ```
</CodeGroup>

<Info>
  Initialize the Twinalyze SDK before calling `identify()`.
</Info>

## Identify with user properties

Pass user information as the second parameter.

<CodeGroup>
  ```javascript npm theme={null}
  TwinalyzeAnalytics.identify("USER_123", {
    name: "John Doe",
    email: "john@example.com",
    phone: "+919876543210",
    plan: "Growth",
    company: "Example Company",
  });
  ```

  ```html CDN theme={null}
  <script>
    window.TwinalyzeAnalytics.identify("USER_123", {
      name: "John Doe",
      email: "john@example.com",
      phone: "+919876543210",
      plan: "Growth",
      company: "Example Company",
    });
  </script>
  ```
</CodeGroup>

## Update user properties

Call `identify()` again when important user information changes, such as the user’s subscription plan or company.

<CodeGroup>
  ```javascript npm theme={null}
  TwinalyzeAnalytics.identify("USER_123", {
    name: "John Doe",
    email: "john@example.com",
    plan: "Enterprise",
    company: "Example Company",
  });
  ```

  ```javascript CDN theme={null}
  window.TwinalyzeAnalytics.identify("USER_123", {
    name: "John Doe",
    email: "john@example.com",
    plan: "Enterprise",
    company: "Example Company",
  });
  ```
</CodeGroup>

## Parameters

| Parameter            | Type   | Required | Description                                                    |
| -------------------- | ------ | -------- | -------------------------------------------------------------- |
| `userId`             | String | Yes      | Permanent and unique identifier of the user.                   |
| `identifyProperties` | Object | No       | User information such as name, email, phone, plan, or company. |

## Registration example

Call `identify()` after a user completes registration.

<CodeGroup>
  ```javascript npm theme={null}
  function handleRegistration(user) {
    TwinalyzeAnalytics.identify(user.id, {
      name: user.name,
      email: user.email,
      plan: user.plan,
      company: user.company,
    });
  }
  ```

  ```javascript CDN theme={null}
  function handleRegistration(user) {
    window.TwinalyzeAnalytics.identify(user.id, {
      name: user.name,
      email: user.email,
      plan: user.plan,
      company: user.company,
    });
  }
  ```
</CodeGroup>

## When to call identify

Call `identify()` when:

* A user successfully logs in
* A user completes registration
* User profile information becomes available
* User properties such as plan or company change

<Warning>
  Use a permanent and unique user ID from your application. Do not use a display name, session ID, or another value that may change.
</Warning>

<div className="twinalyze-bottom-nav">
  <a href="/sdks/javascript/analytics/sdk-initialization" className="twinalyze-nav-side">
    <span className="twinalyze-nav-arrow">‹</span>
    <span>Previous</span>
  </a>

  <a href="/sdks/javascript/analytics/custom-event-tracking" className="twinalyze-nav-center">
    <strong>Track custom events</strong>
    <span>Track website actions and event properties.</span>
  </a>

  <a href="/sdks/javascript/analytics/custom-event-tracking" className="twinalyze-nav-side">
    <span>Next</span>
    <span className="twinalyze-nav-arrow">›</span>
  </a>
</div>
