Events

Events represent actions that a visitor takes on your site or app. Events are tracked by Bento.js, external libraries, or our APIs. They are predominantly used to trigger automations or update visitor data/custom fields.

Using Event Data in Emails

You can use event data in emails within a Flow. Say you were sending over a purchase event that included the product name and price. You could then reference that data in an email like this:

Watch closely

{{ event.details.price }} {{ event.details.product_name }}

Cool, right?

Unique Events

You can configure events to be unique. This means that a visitor can only trigger that event once. This is useful for things related to sales or purchases.

Here is an example using our Node SDK and Laravel SDK. Note the unique key in the purchaseDetails object.

Properties

  • Name
    type
    Type
    string
    Description

    Name of the event, not unique, put unique data in the details

  • Name
    details
    Type
    string
    Description

    Data specific to the singular event

  • Name
    fields
    Type
    string
    Description

    A way to update a visitor's custom field data via the event

Custom Event
bento.V1.trackPurchase({
  email: "[email protected]",
  purchaseDetails: {
    unique: {
      key: 1234,
    },
    value: {
      amount: 100,
      currency: "USD",
    },
  },
});

Was this page helpful?