Neocom.identify() reference
Call Neocom.identify() after login or when a shopper’s details change. The Global script makes the method available on your page.
Signature
Section titled “Signature”Neocom.identify(userId, traits)| Parameter | Type | Required | Description |
|---|---|---|---|
userId |
string | Yes | A nonempty customer ID, up to 255 characters. Use a stable account or CRM ID that survives profile updates. |
traits |
object | No | Up to 100 named properties to add or update on this shopper’s profile. |
When to call it
Section titled “When to call it”Call the method with the same customer ID in each session where the shopper signs in. When a value changes, send just the traits you want to update. For example, Neocom.identify(customerId, { loyalty_tier: "gold" }) updates the loyalty tier and retains the shopper’s other traits.
Reserved traits
Section titled “Reserved traits”| Property | Requirement | Where it appears |
|---|---|---|
first_name |
2 to 50 characters | The shopper’s name in Audience and on the profile |
last_name |
2 to 50 characters | The shopper’s name in Audience and on the profile |
email |
A valid email address | Can identify the shopper in lists |
The Global script omits empty trait values. If a reserved value sent to the service fails validation, the service rejects the request before updating any traits. For example, check the email address if an update containing both an email and a loyalty tier fails.
Custom traits
Section titled “Custom traits”Send strings, numbers or booleans. The profile stores these values as text. Send a date as a string, for example "2026-03-14".
Neocom.identify(customerId, { orders_last_year: 7, newsletter_subscriber: true, customer_since: "2026-03-14"});Open Traits on the shopper’s profile to verify the values. Find an identified shopper
Example
Section titled “Example”On a page where the shopper has signed in, substitute their actual ID and trait values. The readiness check also covers pages where the Global script loads after this code.
<script> function identifyShopper() { window.Neocom.identify("YOUR_CUSTOMER_ID", { loyalty_tier: "gold" }); }
if (window.Neocom) identifyShopper(); else window.addEventListener("neocomloaded", identifyShopper, { once: true });</script>Use the privacy guidance when deciding when to call the method and which traits to send.