---
title: Customers
slug: data-platform/docs/websdk-customers
docTags: 
createdAt: 2026-08-10T12:05:15.000Z
---

Calling `customer()` lets you send a new customer object or update a [customer object's fields](docId\:jWr_e_ykksqkpe5ZA-7fn) in Optimizely Data Platform (ODP).

The `customer()` method includes the VUID (cookie ID) on all requests automatically. To make updates that do not include the VUID, use the [Legacy Attribute Function](docId\:BffSVmohiRvYlh40IjeEw).

## Customer example

Form submissions connect browser cookie data with known identifiers like email and/or phone number. This lets you track website behavior on ODP customer profiles.

The `customer()` method requires two objects:

- The first object in the array contains any known [customer identifiers](docId\:kJQOKwTiRoXN6KRiV0sb9).
- The second object in the array contains [customer attributes](docId\:kJQOKwTiRoXN6KRiV0sb9), including any custom attributes available in the account.

:::hint{type="info"}
**Note**
If a customer ID is supplied in the identifiers, ODP associates it with future events in the same web session. See [Overview of customer identity and resolution](../../data-platform/customers/overview-of-customer-identity-and-resolution.mdx).
:::

## Example call of `customer()`

The JavaScript code automatically passes the customer's cookie identifier and email address, which creates or updates customer profiles in ODP with the data collected from the form submission (in addition to website behavior data).

```javascript
zaius.customer({ // First object contains any known customer identifiers
    email: "johnny.zaius@zaius.com"
  },{ // Second object contains customer attributes
    first_name: "Johnny",
    last_name: "Zaius",
    gender: "M",
    custom_field: yourvalue //see note custom field note
  });
```

:::hint{type="info"}
**Custom Objects & Fields**
If there are data fields on your form that do not already exist in ODP, you need to [create custom fields for them](docId\:jWr_e_ykksqkpe5ZA-7fn). Then, add them to the JavaScript code sample above, replacing `custom_field` with your custom fields.
:::
