# User Identification

Luciq helps you better identify the bug reports or feedback you get by associating a user's identity to them.

### User Email and Name

If you already have a user's name and email, you can pre-fill the email field in the bug, feedback, and question reporting flow. The user will then be identified in all reports (bugs, improvements, questions), crashes, surveys, and feature requests.

<figure><img src="/files/PQ0SCd8mRTUbePz38HNy" alt=""><figcaption><p><br><em>An example of a pre-filled email field in the bug reporting form.</em></p></figcaption></figure>

Ideally, this API should be called as soon as a user logs into your app.

{% tabs %}
{% tab title="Kotlin" %}
{% code overflow="wrap" %}

```kotlin
Luciq.identifyUser({user_name (optional)}, {user_email (optional)}, {id (optional)})
```

{% endcode %}
{% endtab %}

{% tab title="Java" %}
{% code overflow="wrap" %}

```java
Luciq.identifyUser({user_name (optional)}, {user_email (optional)}, {id (optional)})
```

{% endcode %}
{% endtab %}
{% endtabs %}

{% hint style="warning" %}

#### Null Values

If both the email and ID parameters are empty or null, the user will not be identified, and the SDK will through an error.
{% endhint %}

### User Data

You can also add additional data about your users. This API is best used for dumping large amounts of data. Each call to this method overrides the user data to be attached. The maximum length of the string is 1,000 characters.

{% tabs %}
{% tab title="Kotlin" %}
{% code overflow="wrap" %}

```kotlin
Luciq.setUserData("User data")
```

{% endcode %}
{% endtab %}

{% tab title="Java" %}
{% code overflow="wrap" %}

```java
Luciq.setUserData("User data");
```

{% endcode %}
{% endtab %}
{% endtabs %}

### Logout

When a user logs out, the following API should be called. Calling `logOut` will reset the value of the email and name previously set. It will also remove any currently set user attributes, user events, user chats, and user data.

{% tabs %}
{% tab title="Kotlin" %}
{% code overflow="wrap" %}

```kotlin
Luciq.logoutUser()
```

{% endcode %}
{% endtab %}

{% tab title="Java" %}
{% code overflow="wrap" %}

```java
Luciq.logoutUser();
```

{% endcode %}
{% endtab %}
{% endtabs %}

{% hint style="warning" %}

#### Logout only when user is identified

Please note that if the user is currently not identified using the `identifyUser` API, the `logOut` method will have no effect.
{% endhint %}


---

# 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.luciq.ai/android/set-up-luciq-for-android/identify-users/user-identification.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.
