Reports a user identification

Report this event to track subscriptions (regardless of whether the user has an account) and associate the anonymous user ID with the hashed email address entered by the user. This event does not accept custom user ID types, and its main use is to enable personalized email features.

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 "newsletter-subscription-v1"String
cuidUser identifier valueString
cuidType
Use 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
hashedEmail
Optional
SHA-256 encoding of the lowercase email address. You can use this identifier type instead of cuid and cuidType.String

Example: Implementation via script, using hashed email address

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

Example: Implementation via script, using cuid:

DY.API("event", {
  name: "Newsletter Subscription",
  properties: {
    dyType: "newsletter-subscription-v1",
    cuid: "156498191",
    cuidType: "EcommerceID"
  }
});

Example: Implementation via script, using phoneNumber

DY.API("event", {
  name: "Newsletter Subscription",
  properties: {
    dyType: "newsletter-subscription-v1",
    cuid: "156498191",
    cuidType: "EcommerceID",
    phoneNumber: "+12197658907"
  }
});

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

״events״:[
  {           
  "name": "Newsletter Subscription",           
  "properties": {
   "dyType": "newsletter-subscription-v1",
   "hashedEmail": "43e62d636651bc44edcd528a510d57ce69126cd875c..."           
  }
} ]

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

 "events":[
        {
  "name": "Newsletter Subscription",           
  "properties": {
  "dyType": "newsletter-subscription-v1",
  "cuidType": "clientId", //You can use any type you want to
  "cuid": "62eccc43b550b012b7ea7fb07e64baafb1508d8b715a55148ccf0f3322eab1a1"
          }
        }
      ]
    

Example: Implementation via Experience API, using phoneNumber

"event":[
  {
 "name": "Newsletter Subscription",
 "properties": {
    "dyType": "newsletter-subscription-v1",
    "cuid": "156498191",
    "cuidType": "EcommerceID",
    "phoneNumber": "+12197658907"
  }
});