# Update Method

### **Overview** <a href="#about-the-method" id="about-the-method"></a>

The `update` method is used to update user information in CrossEngage. This means that anytime you want to provide/update user attributes based on the information available on the website, you can use this method to update attributes/traits in CrossEngage.

You do not need to identify users to update them via the update method, as CrossEngage automatically assigns them an anonymous `xngGlobalUserId`.

Personal information can of course be sent via web tracking but we recommend to transmit sensitive information (like address, telephone etc) per API or upload via feed.

The `update` method has the following structure for updating users:

```
ce('update', { name: 'Jeff', age: 59 });
```

{% hint style="warning" %}
If the user trait name overlaps with an identifier(e.g. email), it will override that identifier.&#x20;
{% endhint %}

## Use Cases <a href="#about-the-method" id="about-the-method"></a>

#### **A user changes their address information** <a href="#a-user-changes-their-address-information" id="a-user-changes-their-address-information"></a>

Upon form submission, call the `update` function with the new address values:

```
var attributes = {    
    "address": "Bertha-Benz-Strasse 5",    
    "postCode": "10557",     
    "city": "Berlin",    
    "country": "Germany"};
    
ce('update', attributes);
```

This ensures that this user's data is updated on the CrossEngage platform in real time. For example, after an update is made, direct mail campaigns can immediately have access to the most recent address information.

#### **A user signs up using their personal information** <a href="#a-user-signs-up-using-their-personal-information" id="a-user-signs-up-using-their-personal-information"></a>

Upon successful registration, call the `identify` function with the newly created `externalId` followed by an update call containing any newly gathered information:

```
var externalId = "211519787" 
var attributes = {    
    "name": "John Doe",    
    "plan": "tier3" 
    };

ce('identify', externalId);
ce('update', attributes);
```

You should consider sending all of the information that the user provided in their registration form so the user is set up on the CrossEngage platform in real time.

{% hint style="warning" %}
Never send any user passwords or tokens through CrossEngage web tracking functions.
{% 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://documentation.crossengage.io/data-and-engagement-platform/web-tracking/web-tracking-v2/tracking-user-behavior/update-method.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.
