Customer.io events

Updated

Customer.io events are events that perform specific actions in Journeys—our messaging automation tool. These events can remove people from your environment, delete relationships, suppress users, and so on.

How it works

Journeys, our messaging automation tool, supports a number of actions that aren’t immediately apparent from the API. For example, I can add a person using the identify function, but what if I want to remove a person?

That’s what semantic events are for: they let you send track calls with a specific event name to perform actions in Journeys. In general, the event names map directly to the thing you want to do: like Create Device or Delete Person.

When you look at the Actions tab of your Journeys Destination, you’ll see these semantic events as any action with the Trigger event = "<event name>". These represent the events you should send from your sourcesA source is a website or server that you want to capture data from—it’s a source of data! to perform corresponding actions in Journeys.

Actions in the Customer.io Journeys destination correspond to semantic events you should send from your source
Actions in the Customer.io Journeys destination correspond to semantic events you should send from your source

Create or Update Device

The Device Created or Updated event creates a new device if device.token doesn’t exist and updates the device if it does.

A “device” is a mobile device or browser that a person uses to interact with your app or website. You might send this event when someone logs into your app or website. These events require a device object. The device object must contain a token.

analytics.track("Device Created or Updated", {
  device: {
    token: "string",
    type: "ios"
  }
});
  • event string
    Required The event name.

    Accepted values:Device Created or Updated

      • token string
        Required The device token.
      • type string
        The device type.

        Accepted values:ios,android

    • * any type
  • userId string
    Required The user’s unique identifier.

Delete Device

This event removes a device. You might send this event when someone logs out of your app.

As with the Create Device and Update Device events, this event requires a device object. The device object must contain a token.

analytics.track("Device Deleted", {
  device: {
    token: "string",
    type: "ios"
  }
});
  • event string
    Required The event name.

    Accepted values:Device Deleted

    • * any type
  • userId string
    Required The user’s unique identifier.

Delete Person

This event removes a person from your Customer.io workspace. You might do this when someone cancels their subscription with you or otherwise leaves your service.

analytics.track("Delete Person");
  • event string
    Required The event name.

    Accepted values:User Deleted

  • userId string
    Required The user’s unique identifier or their email address. If you provide an email address, we’ll look up the person by their email address and delete them.

Delete Object

This event removes a group (also called an objectNot to be confused with a JSON object, an object in Customer.io is a non-person entity that you can associate with one or more people—like a company, account, or online course. You can use objects to message people based on changes to their company, account, or course itinerary.) from Customer.io Journeys. Groups/objects represent things like accounts, companies, and online classes—non-people entities that people can be related to. You might delete a group when an account is closed, a company is acquired, or you stop offering a class.

This event requires an objectId and an objectTypeId. If you don’t provide an objectTypeId, we’ll assume it’s 1, but if the objectId with the associated objectTypeId (defaulting to 1) does not exist, the event will not find and delete the objectId.

analytics.track("Object Deleted", {
  objectId: "Acme",
  objectTypeId: 1
})
  • event string
    Required The event name.

    Accepted values:Object Deleted

    • objectId string
      A person is related to a group/object. This is the group/object you want to remove.
    • objectTypeId integer

      Default: 1

      The type of group/object the objectId represents. In Customer.io, each type of group/object has a an integer value, starting at 1 and incrementing. For example, if you have two types of groups/objects, you might have 1 represent accounts and 2 might represent companies.

      If you leave this value blank, we’ll assume it’s 1.

Delete Relationship

This event removes a relationship between a person and an object in Customer.io. This is basically the opposite of the group function in Customer.io Journeys. Groups (or objectsNot to be confused with a JSON object, an object in Customer.io is a non-person entity that you can associate with one or more people—like a company, account, or online course. You can use objects to message people based on changes to their company, account, or course itinerary.) represent things like accounts, companies, or online classes, you might delete a relationship when a person is no longer on an account, leaves a company, or drops a class.

This event requires an objectId and an objectTypeId. If you don’t provide an objectTypeId, we’ll assume it’s 1, but if the objectId with the associated objectTypeId (defaulting to 1) does not exist, the event will not remove a person from the group.

analytics.track("Relationship Deleted", {
  objectId: "Acme",
  objectTypeId: 1
})  
  • event string
    Required The event name.

    Accepted values:Relationship Deleted

    • objectId string
      Required A person is related to a group/object. This is the group/object you want to remove the person from.
    • objectTypeId integer

      Default: 1

      The type of group/object the objectId represents. In Customer.io, each type of group/object has a an integer value, starting at 1 and incrementing. For example, if you have two types of groups/objects, you might have 1 represent accounts and 2 might represent companies.

      If you leave this value blank, we’ll assume it’s 1.

  • userId string
    Required The user’s unique identifier or their email address. If you provide an email address, we’ll look up the person by their email address.

Suppress Person

Remove a person from your Customer.io workspace and prevent them from being added back to your workspace using the same identifier. In general you should only send this event for compliance reasons, like when someone invokes their right to be forgotten in accordance with GDPR or CAN-SPAM regulations.

analytics.track("Suppress Person");
  • event string
    Required The event name.

    Accepted values:User Suppressed

    • * any type
  • timestamp string  (date-time)
    The ISO-8601 timestamp when the event occurred.
  • userId string
    Required The user’s unique identifier.

Unsuppress Person

Allow a userId to be added back to your Customer.io workspace. This does not restore information from a person you previously suppressed. It only allows you to add a person back to your workspace using the same identifier.

You might do this if a person explicitly asks to be resubscribed to your messages after having been suppressed.

analytics.track("Unsuppress Person", {
  userId: "person-i-want-to-unsuppress"
});
  • event string
    Required The event name.

    Accepted values:User Unsuppressed

    • * any type
  • timestamp string  (date-time)
    The ISO-8601 timestamp when the event occurred.
  • userId string
    Required The user’s unique identifier.

Report Delivery Event

In general, we use this event with our JavaScript snippet to report delivery events for in-app messages back to your Customer.io workspace.

While Customer.io knows about messages that are sent, this event reports back to Customer.io when an in-app message is delivered, clicked, and so on. Each message contains a unique deliveryId that we trace back to the person, campaign/broadcast, and other items in your Customer.io workspace.

You can use this event to report delivery events for other message types, like push notifications. You might do this if you’re using a third-party push notification service and want to report delivery events back to Customer.io.

analytics.track("Report Delivery Event", {
  deliveryId: "delivery-id",
  metric: "clicked",
  recipient: "device-token",
  actionValue: "enable push",
  href: "myApp://settings/push"
});
  • event string
    Required The event name.

    Accepted values:Report Delivery Event

    • actionValue string
      For in-app messages that are clicked, this value represents the value of the action the recipient clicked.
    • deliveryId string
      The ID of the message delivery.
    • href string
      For in-app messages that are clicked, this value represents the URL/link the recipient clicked.
    • metric string
      The metric you’re reporting. Remember, these are metrics that occur outside of Customer.io—after the message is sent. Because this event typically tracks in-app messages, you’ll generally see metrics like delivered, opened, clicked, etc.

      Accepted values:delivered,clicked,converted,opened

    • reason string
      If the message failed for some reason, this field contains the reason why.
    • recipient string
      The recipient of the message. This field changes depending on the type of message. For in-app messages, this is the person’s deviceId; for SMS it’s the recipient’s phone number; for push notifications, it’s their device token.
    • * any type
  • timestamp string  (date-time)
    The ISO-8601 timestamp when the event occurred.
Copied to clipboard!
  Contents
Is this page helpful?