About Segments

A segment defines a specific attribute profile that can be used to initiate marketing campaigns using the list of customers that match that profile.

Segments tab

The Segments tab provides the interface that allows users to build, define, and manage a list of segments.

Use the visual editor in the Segments tab to easily build a segment from a series of drop-downs and picklists. As you build the attribute profile refresh segment insights to see how many customers match and to see how much value they bring to your business. When the segment is ready, activate it, and then use it to initiate marketing campaigns.

The Segments tab.

Summary page

The Summary page highlights the most important information about a segment, including:

  • How much opportunity does this segment have?

  • Which channels should I engage on?

  • What is the predicted revenue for this segment?

Use the information on the Summary page to help determine the best way to initiate a marketing campaign.

A summary page available after a segment is activated.

Each Summary page contains the following details:

  1. The number of unique customers.

  2. The number of customers who have been active within the last year.

  3. The amount of revenue generated from these customers within the last year.

  4. The number of customers who are reachable.

  5. Revenue statistics, including historical revenue and predicted revenue trends.

  6. The channels through which this segment has customer opportunity.

  7. Segment insight charts for customer behaviors and customer attributes. These charts have a configurable date range and up to six may be selected. Click the Actions menu, and then select Customize charts to choose up to six charts for customer behaviors and for customer attributes.

  8. The list of customers who belong to this segment.

Customers page

The Customers page shows the columns and tables from which customer data for this segment is available.

How visual segments work

The Visual Segment Editor is the user interface for building segments in AmpIQ. This editor uses a series of drop-downs, picklists, conditions, and values to define an attribute profile. Refresh segment insights to see how many customers match the profile, and then active it as a segment.

The Visual Segment Editor is located within the Segments tab in Amperity.

The Visual Segment Editor is available from the Segments tab. Click Create from the Segments tab to open the editor, and then start building your segment.

The steps for building a segment using the Visual Segment Editor.

Follow this sequence when building a segment:

  1. Give your segment a name.

  2. Select a table that contains the attributes you want to use, and then use the drop-downs, picklists, conditions, and values to define the attribute profile.

    Note

    The Customer_360 table is the default. For many segments it’s the only table you will need.

  3. When more than one attribute is present within an attribute group use AND or OR to filter values on more than one condition.

  4. Click Add section to add additional attribute groups.

    Each attribute group has the same requirement for using AND or OR to filter values. There is another AND versus OR choice that must be made in-between each each attribute group.

  5. For each attribute group that is added to the segment, select the database table that contains the attributes, and then select attributes.

    Tip

    Any table that is listed in the lower right may be used to build the attribute profile. Open the Data Explorer to learn more about the individual attributes within these tables.

  6. To view updated segment insights based on the currently-defined attributes, click REFRESH. This will validate the segment, after which segment insights are updated to match the condition-value pairs associated to all of the attributes in the segment.

  7. When the segment returns the parameters that meets the goals for your campaign, click ACTIVATE.

Segment names

A good segment name is clear and concise, is not longer than necessary, uses patterns to help lists of segments stay organized, and considers how it might be represented in downstream workflows, such as lists of segments in the Campaigns tab in Amperity, but also external systems such as Braze, Campaign Monitor, Facebook Ads, Google Ads, Klaviyo, and Mailchimp.

Database tables

You can use any database table that is available to the Segments tab to build attribute groups. All of the tables in the currently-selected database are available from the drop-down menu in each attribute group and are shown in the bottom right corner of the Visual Segment Editor.

Important

Tables must be configured to be available to the Segments tab. This must be done by a member of your team who manages databases and tables from the Customer 360 tab.

Select a database to use tables in that database to build an attribute profile.
  1. You may change the selected database by choosing another one from the drop-down menu.

  2. The list of tables is refreshed to show the tables in that database.

Attribute groups

An attribute group is a series of attributes–individual fields from database tables–that combine to define an audience. You may use as many attribute groups as required. Each attribute group must be from the same database table. Multiple attributes from the same database table must all be assigned to the same operator (AND or OR).

  1. When you open the Visual Segment Editor only one attribute group is visible and it is assigned to the Customer_360 table.

  2. You may choose another table from the drop-down menu. You must define at least one attribute (2) by selecting an attribute from the drop-down, selecting a condition, and then (if required) providing a value.

  3. As you add attributes to an attribute group, additional rows appear. Continue defining attributes until you do not need anymore. If you want to remove an attribute, click the minus icon.

  4. If you need more attribute groups, click ADD SECTION. This will add another attribute group. This new group will behave the same as the first one. Add as many attribute groups as necessary for this segment.

  5. In the new section, select a database table.

  6. Define at least one attribute using the same steps as then previous attribute group.

Note

Each attribute group may use AND or OR within an attribute group, and then also between each attribute group. See AND vs. OR for more information about how to use AND and OR within and between attribute groups.

AND vs. OR

The Visual Segment Editor builds segments using a series of WHERE clauses. Each clause defines a single attribute group. There are two locations in the Visual Segment Editor where you must specify the use of AND and/or OR operators within a WHERE statement.

  1. Within every attribute group

  2. Across all attribute groups

Use AND to set multiple conditions, where each condition is evaluated separately and only records that satisfy each condition can be included in the results. Attribute groups that use the AND operator will typically become smaller as the number of attributes used in the attribute group gets larger.

Use OR to combine conditions, where at least one of the conditions must be satisfied to be included in the results. Attribute groups that use the OR operator will typically become larger (or at least stay the same) as the number of attributes used in the attribute group gets larger.

Important

All conditions within an attribute group must use the same operator. In addition, the same operator must be used across all attribute groups. In both situations you have a single choice: AND or OR.

Example segments

The following segments will produce very different outcomes.

Tip

These examples were run against test data used by the Amperity training and documentation teams. Try running a similar segment against your own data (without activating it) so that you can compare and contrast these result patterns against real data in your own tenant.

This segment returns a very small number of customers (fewer than 100), most of whom are active and most of whom are reachable. The 1-year revenue is ~$2500.

This segment returns a large number of customers (more than 5000), some of whom are active and most of whom are reachable. The 1-year revenue is ~$425k.

If you add another condition–surname is like "Smi"–to both examples, the attribute group built using the AND operator gets smaller, but the attribute group using the OR operator gets larger.

Consider the differences in how each operator returns data when you are choosing which attributes to add to attribute groups. You can define multiple attribute groups that use the same database table, such as one that pulls first and last names and another that groups by location using the Customer_360 table in both attribute groups.

You can get the same results as the example that uses the OR operator by creating three attribute groups with a single attribute in each group:

Attribute operators

An attribute operator defines how results from a column in a data source will be returned.

For example: From your customer 360 table, return all customer records that contain email addresses that are similar to “gmail.com”. The data source is your customer 360 table, the attribute is the email field in that table, and the is like operator allows you to use “gmail.com” to look for values that contain “gmail.com”, and then return a list of customers who have “gmail.com” in their email address.

In SQL, an operator is expressed using the WHERE clause. The following example returns a list of customers who have “gmail.com” in their email address:

SELECT
  email
FROM
  Customer360
WHERE email LIKE "gmail.com"

In the Segment Editor you define operators using a series of picklists that do not require knowledge of SQL or how to define a WHERE clause:

Defining an operator using the Segment Editor.

The list of operators that are available to an attribute in the Segment Editor varies, with each list depending on its data type:

Note

This topic is a reference for all operators that are available to all attributes and is organized alphabetically by data type, and then by operator. This topic does not contain specific recommendations for specific attributes (or attribute groups). Refer to the individual attribute reference pages to learn more about the set of operators that are available, including recommended operators and examples of using them.

About NULL and not NULL values

A field with a NULL value is a field with a value that does not exist.

A NULL value is different than a value of zero, a blank value, or a value that contains only spaces. An attribute can only have a NULL value if it remained empty after the record was created.

For example, if you have 100 customers, 99 of which have provided a value for their phone number (even if some of those phone numbers are invalid phone numbers), 1 of which has not provided any value at all. The customer record that does not have a phone number is empty and is a NULL value.

Conversely, a field with a value that is not NULL is a field with a value that exists, including values of zero, blank values, and value that contain only spaces.

Using the 100 customers and their phone numbers example, Amperity would return 1 record when the “is NULL” operator is used and 99 records when the “is not NULL” operator is used, even if 2 of them contained spaces instead of numbers and 4 of them were “555-555-1234”.

Boolean operators

A Boolean operator represents true and false outcomes, such as “Has this person purchased more than once?” The answer is “Yes” or “No.”

The following operators are available to all attributes with the Boolean data type:

Operator

Description

is false

false returns customer records that are “false”.

is NULL

is NULL returns customer records that do not have a value. A record that does not have a value cannot be “true” or “false”.

is NOT NULL

is not NULL returns customer records that have a value. A record that has a value is either “true” or “false”.

is true

is true returns customer records that are “true”.

Date operators

A Date data type represents a day, a month, and a year. For example: a birthdate.

A Date data type accepts YYYY-MM-DD.

The following operators are available to all attributes with the Date data type:

Operator

Description

is

is returns customer records with activity that matches the specified calendar date.

is after

is after returns customer records with activity that occurred after the specified calendar date, not including the specified date.

is before

is before returns customer records with activity that occurred before the specified calendar date, not including the specified date.

is between

is between returns customer records with activity that is between the specified calendar dates, not including the specified dates.

is not

is not returns customer records with activity that does not match the specified calendar date.

is not between

is not between returns customer records with activity that is not between the specified calendar dates, not including the specified dates.

is not NULL

is not NULL returns customer records that have a value.

is NULL

is NULL returns customer records that do not have a value.

is on or after

is on or after returns customer records with activity that occurred on or after the specified calendar date, including the specified date.

is on or before

is on or before returns customer records with activity that occurred on or before the specified calendar date, including the specified date.

Datetime operators

A Datetime data type represents a date and time combination. For example: a date and time at which a customer made a purchase.

A Datetime data type accepts YYYY-MM-DD hh:mm:ss.

The following operators are available to all attributes with the Datetime data type:

Operator

Description

is

is returns customer records with activity that matches the specified calendar date and time.

is after

is after returns customer records with activity that occurred after the specified calendar date and time, not including the specified date and time.

is before

is before returns customer records with activity that occurred before the specified calendar date and time, not including the specified date and time.

is between

is between returns customer records with activity that is between the specified calendar dates and times, not including the specified dates and times.

is not

is not returns customer records with activity that does not match the specified calendar date and time.

is not between

is not between returns customer records with activity that is not between the specified calendar dates and times, not including the specified dates and times.

is not NULL

is not NULL returns customer records that have a value.

is NULL

is NULL returns customer records that do not have a value.

is on or after

is on or after returns customer records with activity that occurred on or after the specified calendar date and time, including the specified date and time.

is on or before

is on or before returns customer records with activity that occurred on or before the specified calendar date and time, including the specified date and time.

Decimal operators

A Decimal data type represents amounts, percentages, and scores.

A Decimal data type accepts numeric values with a precision of 38 and a scale of 2 (default). Precision is the number of digits that may be in the decimal value. Scale is the number of digits that may be to the right of the decimal point.

Note

Amperity defaults precision and scale for the Decimal data type to 38 and 0: DECIMAL(38,2). The default value for scale may be configured in the feed for each data source.

The following operators are available to all attributes with the Decimal data type:

Operator

Description

is

is returns customer records with values that match the specified amount or percentage.

is between

is between returns customer records with values that are between the specified amounts or percentages, not including the specified amounts or percentages.

is greater than

is greater than returns customer records with values that are greater than the specified amount or percentage, not including the specified amount or percentage.

is greater than or equal to

is greater than or equal to returns customer records with values that are greater than or equal to the specified amount or percentage, including the specified amount or percentage.

is in list

is in list returns customer records with values that match the amounts or percentages that are specified in the list.

is less than

is less than returns customer records with values that are less than the specified amount or percentage, not including the specified amount or percentage.

is less than or equal to

is less than or equal to returns customer records with values that are less than or equal to the specified amount or percentage, including the specified amount or percentage.

is not

is not returns customer records with values that do not match the specified amount or percentage.

is not between

is not between returns customer records with values that are not between the specified amounts or percentages, not including the specified amounts or percentages.

is not in list

is not in list returns customer records with values that do not match the amounts or percentages that are specified in the list.

is not NULL

is not NULL returns customer records that have a value.

is NULL

is NULL returns customer records that do not have a value.

Integer operators

An Integer data type represents quantities, such as items ordered, frequency of purchase, number of orders, clicks, and page visits.

An Integer data type accepts numeric values with an implied scale of zero.

The following operators are available to all attributes with the Integer data type:

Operator

Description

is

is returns customer records with values that match the specified quantity.

is between

is between returns customer records with values that are between the specified quantities, not including the specified quantity.

is greater than

is greater than returns customer records with values that are greater than the specified quantity, not including the specified quantity.

is greater than or equal to

is greater than or equal to returns customer records with values that are greater than or equal to the specified quantity, including the specified quantity.

is in list

is in list returns customer records with values that match the quantities that are specified in the list.

is less than

is less than returns customer records with values that are less than the specified quantity, not including the specified quantity.

is less than or equal to

is less than or equal to returns customer records with values that are less than or equal to the specified quantity, including the specified quantity.

is not

is not returns customer records with values that do not match the specified quantity.

is not between

is not between returns customer records with values that are not between the specified quantities, not including the specified quantity.

is not in list

is not in list returns customer records with values that do not match the quantities that are specified in the list.

is not NULL

is not NULL returns customer records that have a value.

is NULL

is NULL returns customer records that do not have a value.

String operators

A String data type represents many things, such as identifiers, names (of people, places, and products), phone numbers, etc.

A String data type accepts A-Z, a-Z, underscores, and hyphens.

The following operators are available to all attributes with the String data type:

Operator

Description

is

is returns customer records with values that match a string of characters.

is blank

is blank returns customer records with values that are blank.

is in list

is in list returns customer records with values that match strings of characters that are specified in a list.

is like

is like returns customer records with values that have a matching string of characters within the string of characters.

is not

is not returns customer records with values that do not match a string of characters.

is not blank

is not blank returns customer records with values that are not blank.

is not in list

is not in list returns customer records with values that do not match strings of characters that are specified in a list.

is not like

is not like returns customer records with values that do not have a matching string of characters within the string of characters.

is not NULL

is not NULL returns customer records that have a value.

is NULL

is NULL returns customer records that do not have a value.

Segment insights

Note

Segment insights are available when the customer 360 database contains the Unified_Transactions, Transaction_Attributes, and Transaction_Attributes_Extended tables.

Segment insights within the Visual Segment Editor include the following categories:

  • The number of unique customers.

  • The number of customers who have been active within the last year.

  • The amount of revenue generated from these customers within the last year.

  • The number of customers who are reachable.

When you start building a segment, the values for segment insights represent 100% of your customers and revenue across all categories. As you apply attributes to your segment refresh segment insights and review the the updated values.

Segment insights are available when using the Visual Segment Editor.
  1. Segment insights are shown when you start using the Visual Segment Editor.

  2. As you apply attributes segment insights are reset. Click the Refresh button to update segment insights based on the attributes you have selected. The values for each category are updated.

SQL editor

The SQL Segment Editor is an optional interface that allows you to build an attribute profile using Presto SQL. Start with a SELECT statement that returns the Amperity ID, and then apply a series of WHERE statements to define one (or more) attribute groups that match specific conditions and values.

There SQL Segment Editor has the following requirements:

  1. The only field that can be returned by the SELECT statement is amperity_id.

  2. All conditions and values must be contained within a WHERE clause.

  3. A WHERE clause must use one of the following operators: AND or OR.

Example segments

For example, a segment that uses the OR operator to return customers whose first name begins with “Mi”, last name begins with “Smi”, and who reside in California:

SELECT
  "amperity_id"
FROM
   "Customer_360"
WHERE
  (
    (LOWER("given_name") like '%mi%')
     OR LOWER("state") = 'ca'
     OR (LOWER("surname") like '%smi%')
  )

The following example is identical to the previous example, but shows each condition in its own WHERE clause, using UNION ALL between each clause to group the results together:

SELECT
  "amperity_id"
FROM
   "Customer_360"
WHERE
  (
    (
      "amperity_id" IN (
        SELECT
          "t0"."amperity_id"
        FROM
          "Customer_360" "t0"
        WHERE
          ((LOWER("t0"."given_name") like '%mi%'))
        UNION ALL
        SELECT
          "t1"."amperity_id"
        FROM
          "Customer_360" "t1"
        WHERE
          (LOWER("t1"."state") = 'ca')
        UNION ALL
        SELECT
          "t2"."amperity_id"
        FROM
          "Customer_360" "t2"
        WHERE
          ((LOWER("t2"."surname") like '%smi%'))
      )
    )
  )

How-tos

This section describes tasks related to building segments in Amperity:

Browse tables and columns

The Visual Segment Editor provides access to all tables in all databases that have been made available for use with segments. These are available from a list in the segment editor, sorted by table, and then within each table sorted by field. Use this list as a quick reference for tables, columns, and data types as you are building segments.

To browse tables and columns

  1. From the Segments tab, open a segment. This opens the Visual Segment Editor.

  2. Under Database, select a database from the drop-down menu. The list of tables is updated to show the tables in that database.

  3. Under Table, expand the name of a table. Details include the number of records in the table, a list of columns, and for each column its data type.

Discard segment

Use the Discard option to remove a segment from Amperity. This should be done carefully. Verify that both upstream and downstream processes no longer depend on this segment prior to discarding it.

To discard a segment

  1. From the Segments tab, open the menu for a segment, and then select Discard. The Discard Segment dialog box opens.

  2. Click Confirm.

Download segment

You can download segment results as a CSV file. The CSV format is supported by many applications, which makes the format a great way to test the potential of orchestrating segments for downstream applications and workflows.

Note

You cannot download the results of any segment that returns an error.

To download a segment as a CSV file

  1. From the Segments tab, open the menu for a segment, and then select View. This opens a segment editor.

  2. Click the Customers tab.

  3. Click Download.

  4. A CSV file with a filename that is identical to the segment name is downloaded to your local machine.

Organize segments

A folder helps you organize the list of segments in the Segments tab. Up to three levels may be added.

You can organize the segments shown in the Segments tab:

Add folder

Folders may be expanded (or collapsed) to view (and hide) the list of segments and subfolders contained within.

To add a folder

  1. From the Segments tab click Create, and then select Add Folder. This opens the Create Folder dialog box.

  2. Enter the name for the folder.

  3. Click Save.

Add subfolder

Use the Create folder option in the menu to add up to three levels of subfolders. All folder names must be unique.

To add a subfolder

  1. From the Segments tab, open the menu for a folder, and then select Create folder. This opens the Create Folder dialog box.

  2. Enter the name for the folder.

  3. Click Save.

Move segment

Use the Move option to move around and organize the list of folders and segments. Folders may be expanded (or collapsed) to view (and hide) the list of segments and subfolders contained within.

To move a segment

  1. From the Segments tab, open the menu for a segment, and then select Move. This opens the Move Segment dialog box.

  2. Select the name of an existing folder to which a segment will be moved, and then click Move.

Hint

If the folder to which a segment will be moved is not present in the list of folders, you can add it directly from the Move Segment dialog box. Click the + New folder link, type a name for the folder, and then select it.

Select database

You can build a segment against any database that is visible from the Customer 360 tab.

To select a database

  1. From the Segments tab click Create, and then select Visual Segment. This opens the Visual Segment Editor.

  2. Under Database, select a database. The Customer 360 database is selected by default.

  3. Build your segment against the list of tables that are available in that database.

Show columns

You can view columns that are in the segment results from the Customers tab in the segment viewer. This can be configured to show all columns from all tables or only columns from a specific table.

To show columns

  1. From the Segments tab, open the menu for a segment, and then select View. This opens a segment editor.

  2. Click the Customers tab.

  3. Expand the Show [x] columns from [table] link.

  4. Use the Show all columns and Show only the columns I choose options to configure which columns are shown.

  5. Click Refresh to update the segment results to show the configured set of columns.

Switch to SQL segment

You can switch a visual segment to a SQL segment.

To switch to a SQL segment

  1. From the Segment Editor, open a segment.

  2. In the Segment Editor, in the top right, click View SQL.

  3. Click Convert to SQL Segment.