Segment Conditions

read

Overview

When building a segment, you can include or exclude people based on the following conditions:

  • What someone has done (or not done)
    Here, you can choose from any activity tracked by Klaviyo -- we call all activities "events" or "metrics"; to see a list of all metrics being tracked in your account, click here.
  • Properties about someone
    Here, you can choose to segment based on attributes associated with profiles in your account -- custom properties can be assigned via an integration, or you can add properties to profiles manually.
  • If someone is in or not in a list
    This option is great if you want to combine two or more lists or create a segment of a specific list, which is a best practice when sending campaign emails.
  • If someone is or is not suppressed
    If you plan on sending a campaign email to a segment, another best practice is to add this condition and exclude everyone who is suppressed in your account; this will give you a more accurate count of not only who meets your segment's conditions, but also which profiles are email-able.

Filtering a Segment Condition

When building a new segment around what some has done (or not done), you will have the opportunity to filter this action to refine your segment. You can do this by first choosing an action, and then selecting the Add Filter option.

2017-05-24_09-51-46.png


When you choose Add Filter, you will first see an input that says Choose Property and then another input that says Choose Value:

  • When you click within this empty Choose Property field, a drop-down menu will appear. This drop-down menu will populate with all top-level properties available for segmentation.
  • After choosing a property, you will be prompted to choose a value that you want to add a filter to. A drop-down menu will also populate here with available values. A value will only be pre-populated if it has been synced to Klaviyo along with an order, or another tracked event.

Note

Klaviyo will only pre-populate values for products that have already been purchased. If you are looking to build a segment around a property value that does not yet exist in Klaviyo -- for example, a new product in your store that nobody has purchased yet -- you can copy and paste the value into the Choose Value box. If the property value you paste is identical to the value that will eventually sync to Klaviyo, the segment will work as expected.

While Klaviyo may sync many details about a given metric, not all synced properties are available for segmentation. For data management purposes, only the primary details of an event are synced as "top-level" properties, and only these top-level properties are segment-able.

If you view the raw data Klaviyo syncs for an event, you will see key data points for the event. For a Placed Order event, for example, you may see the following top level properties:

  • Value
  • Collections / Categories
  • Item Count
  • Items
  • Source Name

You will see an array labeled "Extra" or "Details." While the data within an "Extra" or "Details" array is available to insert within an email template, properties nested within this array will not be segmentable.

Custom Integrations & Segmentation

If you are building your own custom integration, and are deciding what data to send to Klaviyo and how to structure this data, make sure that all properties you want to segment on are sent as top-level properties (and are not nested).

For example, if you create a Placed Order metric where an event will track whenever someone completes a purchase on your site, you may want to filter events based on what item(s) someone purchased.

In order to do this, there has to be a top-level "ItemNames" array that includes all purchased product names -- this would be in addition to a nested array with details for each item. Below, you can see the ItemNames array in the payload for this Placed Order event in addition to the Items array that contains detailed information about each product:

{
  "token" : "API_KEY",
  "event" : "Placed Order",
  "customer_properties" : {
    "$email" : "john.smith@gmail.com",
    "$first_name" : "John",
    "$last_name" : "Smith"
  },
  "$event_id" : "1234",
  "$value" : 29.98,
  "Categories" : ["Fiction", "Classics", "Children"],
  "ItemNames" : ["Winnie the Pooh", "A Tale of Two Cities"],
  "Brands" : ["Kids Books", "Harcourt Classics"],
  "Items" : [
    {
      "SKU" : "WINNIEPOOH",
      "Name" : "Winnie the Pooh",
      "Quantity" : 1,
      "ItemPrice" : 9.99,
      "RowTotal" : 9.99,
      "ProductURL" : "http://www.example.com/path/to/product",
      "ImageURL" : "http://www.example.com/path/to/product/image.png",
      "Categories" : ["Fiction", "Children"],
      "Brand" : "Kids Books"
      },
    {
      "SKU" : "TALEOFTWO",
      "Name" : "A Tale of Two Cities",
      "Quantity" : 1,
      "ItemPrice" : 19.99,
      "RowTotal" : 19.99,
      "ProductURL" : "http://www.example.com/path/to/product2",
      "ImageURL" : "http://www.example.com/path/to/product/image2.png",
      "Categories" : ["Fiction", "Classics"],
      "Brand" : "Harcourt Classics"
    }
  ],
  "time" : 1387302423
}
Was this article helpful?
2 out of 6 found this helpful