Identify User

Reports a user identification

Use to identify visitors at any point during their journey on your site or app, such as during the checkout process.

Parameters

  • name: Human-readable name, not used to identify an event type
  • properties: A container for the event properties as specified in the following table:
PropertyDescriptionType
dyTypeMust be "identify-v1"String
cuid User identifier value.
! Must not include a / character
String
cuidTypeUse this identifier type to identify users across devices (for example, customer_id or account_id). Note: Do not include any personal information in this ID.String
secondaryIdentifiers
type, value
Optional
Optionally, add a phone number as a second method for identification across devices and Experience OS apps. Note: Phone number must be E.164 format (+ and country code and phone number, no spaces or symbols. For example, +12195551212, +49555343333.)String
hashedEmail
Optional
SHA-256 encoding of the lowercase email address. You can use this identifier type instead of cuid and cuidType.String

📌

Using the secondary identifier

As soon as you report a secondary identifier for a user, that ID is mapped to the user no matter which device is used or which event is reported. Until it's overriden with a new value, it exists for the user whether or not it's re-reported in an API or script-based event.

Example: Implementation via script, using hashed email address

DY.API("event", {
  name: "Identify",
  properties: {
    dyType: "identify-v1",
    hashedEmail: DYO.dyhash.sha256("[email protected]".toLowerCase()) // SHA256 encoding of the lowercase email.
  }
});

Example: Implementation via script, using cuid

DY.API("event", {
  name: "Identify",
  properties: {
    dyType: "identify-v1",
    cuid: "95764245",
    cuidType: "EcommerceID"
  }
});

Example: Implementation via script, using secondary identifier

DY.API("event", {
  name: "Identify",
  properties: {
    dyType: "identify-v1",
    cuid: "156498191",
    cuidType: "he",
    secondaryIdentifiers: [
      {type: "phoneNumber", value: "+972503803434"},
    ]  
  }
});

Example: Implementation via Experience API (server-side), using hashed email address

 "events": [
        {
          "name": "Identify User",
          "properties": {
            "dyType": "identify-v1",
            "hashedEmail": "62eccc43b550b012b7ea7fb07e64baafb1508d8b715a55148ccf0f3322eab1a1"
          }
        }
      ]

Example: Implementation via Experience API (server-side), using cuid

 "events": [
        {
          "name": "Identify User",
          "properties": {
            "dyType": "identify-v1",
            "cuidType": "clientId", //You can use any type you want to
            "cuid": "62eccc43b550b012b7ea7fb07e64baafb1508d8b715a55148ccf0f3322eab1a1"
          }
        }
      ]

Example: Implementation via Experience API (server-side), using secondary identifier

 "events": [
        {
          "name": "Identify User",
          "properties": {
            "dyType": "identify-v1",
            "cuid": "62eccc43b550b012b7ea7fb07e64baafb1508d8b715a55148ccf0f3322eab1a1",
            "cuidType": "clientId", //You can use any type you want to
            "secondaryIdentifiers": [
              {type: "phoneNumber", value: "+972503803434"},
            ]          
          }
        }
      ]

👍

Go to the API reference for the Events endpoint to learn more.