> For the complete documentation index, see [llms.txt](https://user.netmera.com/netmera-developer-guide/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://user.netmera.com/netmera-developer-guide/platforms/cordova/user-and-attributes.md).

# User & Attributes

### Managing User Data

The `NetmeraUser` class allows you to send structured information about your application's users to Netmera. The ideal time to update user attributes is **right after the user logs into your application.**

{% hint style="warning" %}
**User ID Management**

For optimal performance and data integrity:

* **Update user information at login**: It’s crucial to update the user information as soon as the user logs in.
* **Unique userId**: Ensure that each user has a unique `userId`. Assigning the same `userId` to multiple users leads to data inconsistencies and is not recommended.
  {% endhint %}

### Updating User Information

After login, create a `NetmeraUser` object, set the attributes, and call `Netmera.updateUser`

```typescript
import { NetmeraPlugin, NetmeraUser } from '@awesome-cordova-plugins/netmera/ngx'

const user = new NetmeraUser()

user.userId = "the_greatest"
user.email = "clay@champion.com"
user.msisdn = "001XXXXXXXXX"
user.name = "Netmera"
user.surname = "Notification"
user.gender = NetmeraUser.GENDER_MALE
user.externalSegments = ["sports", "box"]
user.dateOfBirth = 743069748000
user.maritalStatus = NetmeraUser.MARITAL_STATUS_SINGLE
user.country = "USA"
user.state = "Arizona"
user.city = "Scottsdale"
user.district = "Old Town Scottsdale"
user.favoriteTeam = "My Team"
user.language = "English"
user.industry = "Sports"
user.occupation = "Professional Boxer"

// Update the user profile in Netmera
this.netmera.updateUser(user)
```

{% hint style="warning" %}
**Important:**

* `userId` **cannot** be removed.
* You should send a **single** user update request at a time.
  {% endhint %}

### Creating Custom Profile Attributes&#x20;

#### Step 1: Navigate to the Developers section

Custom profile attributes must be created and configured in the Netmera Panel before they can be used in the application.&#x20;

* Go to **Panel** > **Developers > Profile Attributes > Create New Attribute.**

#### Step 2: Fill in Attribute Details

Define the following information:

* **Name**: The unique identifier for the attribute.
* **Label**: A user-friendly name for the attribute.
* **Description**: A brief description of the attribute.
* **Data Type**: Choose the appropriate data type for the attribute.
* **Is Array**: Define whether the attribute can hold multiple values.

#### Step 3: Save the Attribute

After clicking **Save**, the custom attribute will be available for assignment to your users.

#### Step 4: Generated Code for Custom Attributes

Once the attribute is defined in the Netmera Panel, the generated code can be found at the bottom of the **Profile Attribute** page, under the **Generate Code** section. This code must be added to your Netmera Panel under **Profile Attributes > User Class**.

{% hint style="info" %}
**Private Information Considerations**

Under the **KVKK** law, the sharing of private user data is prohibited. To ensure compliance:

* **Private Information Flag**: When defining profile attributes or events, the **Private Information** feature must be selected to ensure that these attributes are not sent to the backend by the Netmera SDK.
* **SDK Enforcement**: The SDK checks for the **Private Information** flag during the `(Netmera.update(user))` call. If the flag is set, the request will not be sent to the backend.
  {% endhint %}

<figure><img src="https://2578508252-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0bOAscrXzPSujyzq8DEz%2Fuploads%2FhdG2lVSfEWWdSab1o1MO%2FScreenshot%202025-02-06%20at%2016.36.38.png?alt=media&amp;token=cffd0f0a-f89b-49e7-8911-d50640093b3b" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://user.netmera.com/netmera-developer-guide/platforms/cordova/user-and-attributes.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
