# Adding users to ProductLogz

## Manual authentication

Users can manually authenticate themselves by entering their email and password or signing in via Google. \
This process is simple—users just need to click the **Login/Signup** button. A popup will appear, allowing them to either login or create an account if they haven't already.

<figure><img src="/files/NiSjayqEEDopkmEY5mwd" alt=""><figcaption></figcaption></figure>

Clicking on the button will open a popup where your users can either create account if not created already.

<figure><img src="/files/6oPp8INPSIkYmQMuxSed" alt=""><figcaption></figcaption></figure>

With this method, user accounts are stored and authenticated by **Productlogz**. However, if you prefer to streamline this process, you can eliminate the manual authentication step for users.

## Automatically authenticating users

You can use the below **Productlogz SDK Identify** method to remove the manual authentication step from the user's side. This way, they are automatically verified when they click the feedback link from your product.

By integrating our JavaScript SDK, you can ensure that user feedback is linked to their accounts in your app.

### Step 1: Add the link to your product

In your application, add the below link (replace `href` value) to your **Productlogz feedback portal**. Make sure it is prominently displayed so users can easily access it.

<pre class="language-html"><code class="lang-html">```
&#x3C;a data-pl-link href="<a data-footnote-ref href="#user-content-fn-1">https://company.productlogz.com</a>" target="_blank">
   Give feedback
&#x3C;/a>
```
</code></pre>

Make sure you replace `https://company.productlogz.com`  with your public board link ( or your custom domain link).

\
⚠️ **Important:** The `data-pl-link` attribute must be included. If removed, authentication will not work.

### Step2: Add script tags

Place the following code in your application codebase, primarily at the root or in index.html.<br>

Modify the values to pass your application's user data.

<pre class="language-javascript"><code class="lang-javascript">&#x3C;script>
   window.ProductLogz('classify', {
      accountKey: &#x3C;<a data-footnote-ref href="#user-content-fn-2">replace-with-your-account-id</a>> // **required**,
      // NOTE: the 'user' is just used as a reference here, 
      // kindly replace it with your user's state.
      user: {
         alias: user.alias, // **optional**
         avatarURL: user.avatarURL, // **optional**
         createdAt: new Date(user.created).toISOString(), // **optional**
         email: user.email, // **required**
         id: user.id, // **required**
         name: user.name, // **optional**
         // **optional**
         companies: [
            {
               id: 'company-id',
               name: 'Company-Name',
               monthlyRevenue: some-number,
               createdAt: "2024-01-01",
            }
         ],
         // **optional**
         customFields: {
            title: 'Product Manager',
         }
      },
   });
&#x3C;/script>
</code></pre>

#### **Required Configuration**

**Account ID**

* **`accountId`** `[string]` **(Required)**
  * Replace this value with your actual **account ID**, which can be found in the ProductLogz dashboard under **Settings > Workspace Details**.

**User Fields**

* **`id`** `[string]` **(Required)**
  * A unique identifier for each user in your system, ensuring their feedback is correctly linked to their account.
* **`email`** `[string]` **(Required)**
  * The user’s email, making it easier to identify them and follow up on their feedback.
* **`alias`** `[string]` **(Optional)**
  * A custom identifier for the user, useful if you want to reference them with something other than their email or user ID.
* **`avatarURL`** `[string]` **(Optional)**
  * A URL for the user’s profile picture, helping personalize their feedback.
* **`createdAt`** `[string]` **(Optional)**
  * The date and time the user was created in your system, useful for tracking feedback based on account age.
* **`name`** `[string]` **(Optional)**
  * The user’s display name, making interactions more personal and recognizable.
* **`companies`** `[array]` **(Optional)**
  * Associates a user with one or more companies, helping track feedback at an organizational level.
* **`customFields`** `[object]` **(Optional)**
  * Attach additional metadata to a user, such as role, subscription plan, or other relevant attributes for better context.

By implementing this setup, you can enhance the user experience while ensuring that their feedback is automatically linked to their account. 🚀

***

⚠️ Productlogz Identify doesn’t track admins, so if you’re testing, use a regular user account.

[^1]: Replace this with your public page link here!!

[^2]: Replace this string with your account ID.&#x20;


---

# 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://help.productlogz.com/users-module/adding-users-to-productlogz.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.
