Information for: DEVELOPERS   PARTNERS   SUPPORT

Segments

In Campaign Studio, segments are lists, or groups of contacts. Use segments to send emails, trigger campaigns, or for analysis. You can add to and remove contacts from a segment, and into static and dynamic segment types.

After creating a segment, click the View Contacts button on the right side of the Segments page for a list of contacts attached to the segment. You can also see lists of contacts in a segment by searching segment:{segment-alias} on the Contacts page.

Static segments

Static segments are not filter-based. Adding contacts to a segment in one of the following ways:

Manually moving contacts

Segments - Batch Modify

The two manual options to move a contact into a static segment are:

  • For batch updating contacts:
    1. Use search filters in the contacts section of Campaign Studio to find the contacts to change.
    2. Select the checkboxes next to those contacts.
    3. Click the green arrow which appears at the top of the column.
    4. Select Change Segments from the list.
    5. Choose the segment(s) you want to add the contacts to or remove contacts from.
    6. Click Save.
  • For individual contacts:
    1. Navigate to the contact record you want to change
    2. Click the arrow in the top right, next to Edit/Send Email/Close Select Preferences.
    3. Click Segments.
    4. Choose the segment(s) you want to add the contacts to or remove contacts from.
    5. Click Save.

Campaign action

Segments - Campaign Action

Inside a campaign, you can add contacts to or remove contacts from segments using the Modify contact’s segment action. To add contacts to a segment, you must have already created the segment and set to Public Segment = Yes.

  1. In the campaign builder, click a connector.
  2. Select Action.
  3. In the list of actions, select Modify contact’s segments.
  4. Choose from the list of existing segments you want to add your contact to or remove your contact from.
  5. Click Save and close.

Form submit action

Segments - Modify in Form

Modify contact’s segment is available as a submit action on Standalone forms. With a Campaign form, create a campaign with a Modify contact’s segment action.

  1. Click Actions.
  2. From the Add new submit action menu, select Modify contact’s segments.
  3. Add a Title for the submit action and add a Description (optional).
  4. Select the segment(s) you’d like to add the contact to or remove the contact from.
  5. Click Add.

Points trigger

Segments - Points Trigger

Once a contact has accrued an assigned number of points, the system can add them to a segment. This may be a segment for your most engaged contacts who become eligible for special offers, or a segment your sales team reviews to find strong prospects.

  1. In the Points section of the platform, select Manage Triggers.
  2. Click +New.
  3. Give your trigger a Name and Description.
  4. Enter the Minimum number of points for a contact to be added to your segment.
  5. Decide if you want to add all contacts with at least that number of points to the segment:
    • If you only want to add new contacts who reach the threshold to this segment, select No (default).
    • To add all existing contacts with at least a certain number of points to the segment, toggle the switch to Yes.
  6. Click Events.
  7. Click the menu for Add an event and select Modify contact’s segments.
  8. Add a Title for the event and a Description (optional).
  9. Select the segment(s) you want to add to or remove the contact from.
  10. Click Add.
  11. Click Save & Close.

This accomplishes the same thing as creating a Dynamic segment with a filter for Points, the operator greater than (or equal to), and the minimum number of points. The difference is if you only want to add contacts to a segment who reach the point value after creating this trigger to a segment, you can.

CSV import

If you have a list outside of Campaign Studio, saved as a UTF-8 encoded CSV file, you can import the list directly into a Campaign Studio segment.

Note

As a best practice, you must create segments before importing contact lists. You can also create segments after importing a CSV file. However, Acquia does not recommend you to create new segments during the import process because it results in some contacts being missed by filters in the dynamic segment build. These contacts do not appear in the new segment immediately but are added in the next scheduled daily build.

  1. Click Contact.

  2. Click the menu in the upper-right hand corner and select Import.

  3. Ensure that the file is in a UTF-8 CSV format. Select your file then click Upload.

  4. At the top of the next screen, select the segment you want to add the contacts to.

    Note

    You must select a default segment when importing a CSV file.

  5. Map the appropriate fields from the file.

    Remember to always map the unique identifier so that you do not create duplicates.

  6. Click Import.

If your file is larger than 1,000 rows, the system changes screens and informs you once the file has imported. After the import is complete, click the Segments section of the platform to see the added contacts.

Dynamic segments

Campaign Studio moves contacts into and out of dynamic segments based on the filters applied to the segment. As the data associated with the contact updates, including company associations and behaviors, Campaign Studio updates segment membership.

Filtering

Mautic Segments - Filters

Campaign Studio dynamically moves your contacts to and from segments based on filters. You can filter on contact fields, company fields and even actions, such as emails sent or read.

  1. Create a new segment by clicking the +New button.
  2. In the Details tab, add a Name and Description to your segment.
  3. Click the Filters tab to add filters.
  4. Click the Choose one… menu and search for the field you want to segment by. Fields are broken up into three sections:
    • Contact fields
    • Contact behavior and actions
    • Primary company fields
      • Fields must be set to Available for Segments = Yes in your Custom Field manager to appear here.
      • Contacts may be associated with multiple companies, but Campaign Studio will add them to segments based on fields for the primary company.
  5. Add more filters, using the And and Or operators. An Or operator creates a new group of filters which can include And operators.
  6. Click Save and close.

Note

Segment building is not real-time. For segment filters based on core fields and custom fields except Date/Datetime type fields, users must wait for up to 10 mins to view contacts under the segment.

All behavioral and Date/Datetime based filters get rebuilt during nightly refresh. The nightly segment rebuild jobs for each segment are randomized for 6 hours. Jobs are executed anytime between midnight to 6 am with respect to the Default timezone set for the instance in Settings > Configurations > System Settings.

If a segment fails to rebuild for a predetermined length of time, Campaign Studio displays a notification alerting you of an error. For information on defining this time period, see segment settings.

The include/exclude operators with pipe-separated values are supported in the Text field types in segment filters. The values can also be pasted from the spreadsheet.

Using Date Filters

Segment activity over time summary graph

You can create dynamic segments by using date filters.

Note

The date format for values stored in the database is YYYY-MM-DD. For example, December 11, 2020 is stored as 2020-12-11 and November 12, 2020 is stored as 2020-11-12. To update the display format for dates, go to Settings > Configuration > System Settings > System Defaults. However, this does not alter the format in which dates are stored in the database.

Operators

You must ensure that you use the correct operator and time frame in order to build an effective segment.

Once you have selected a date field as your filter, such as the default Date last active field or a custom Birthday field, you will have a list of operators to choose from:

  • Equals: The value on the contact record exactly matches the filter value.

  • Not Equal: The value on the contact record is any value that does not match the filter value.

  • Greater than: The value on the contact record is at a later date in time than X date. For example, Greater than today means anytime from tomorrow until the end of time.

  • Greater than or equal: The value on the contact record is either at a later date in time than or including X date. For example, Greater than or equal today means anytime from today until the end of time.

  • Less than: The value on the contact record is at an earlier date in time than X date. For example, Less than today means anytime from the beginning of time until yesterday.

  • Less than or equal: The value on the contact record is at an earlier date in time than X date. For example, Less than or equal today means anytime from the beginning of time until today.

  • Empty: No value exists in the field on the contact record.

  • Not empty: A value exists in the field on the contact record.

  • Like: This operator is not supported in date or datetime fields, and must not be used.

  • Not like: This operator is not supported in date or datetime fields, and must not be used.

  • Regexp: Contacts with values that match the specified regular expression pattern are included in the segment. If you are not proficient with regular expression, do not use this operator.

  • Not regexp: Contacts with values that do not match the specified regular expression pattern are included in the segment. If you are not proficient with regular expressions, do not use this operator.

  • Starts with: Contacts whose field values begin with the specified numbers are included in the segment. These filter values should generally reference years (or years and months).

    For example, a value of 19 matches any contacts whose field value has a year in the 1900s. A value of 200 matches contacts with a year value between 2000 and 2009 and a value of 2020-11 matches contacts with a field value in November 2020.

  • Ends with: Contacts whose field values end with the specified numbers are included in the segment. These filter values should generally reference days (or months and days).

    For example, a value of 1 matches anyone whose field value is on the 1st, 11th, 21st, or 31st of any month but a value of 01 matches the 1st of a month. A value of 01-01 finds contacts whose value is for January 1 of any year.

  • Contains: Contacts with the specified filter value anywhere in the field value are included in the segment. Acquia does not recommend using this operator, as there are very few use cases for this data apart from potentially finding a somewhat random subset of contacts (without using Randomizer).

Dynamic values

While using date filters, you may not want to reference a static date. Additionally, you may not want to update a date or date range regularly. Hence, Campaign Studio supports more dynamic date ranges, as listed below:

Note

For the examples on Yesterday, Today, Tomorrow, and Anniversary, assume that the operator is equals. Not equal, greater than, greater than or equal, less than, and less than or equal are all valid operators with these values.

  • Yesterday: The value on the contact record is exactly one day before today’s date. For example,

    • Field: Loyalty Program Sign Up Date
    • Purpose: Trigger a welcome email or campaign for contacts who signed up for your loyalty program to increase engagement and customer satisfaction. The campaign will begin the day after the signup date.
    • Contact gets added to the segment/campaign when: Today is November 1, 2020 and the contact signed up for the loyalty program on October 31, 2020.
    • Contact gets removed from the segment/campaign when the calendar turns to November 2, 2020, because the signup date was not exactly one day in the past.
  • Today: The value on the contact record exactly matches today’s date, including the year. For example,

    • Field: Reward Issue Date
    • Purpose: Trigger a campaign with a single email notifying customers that they have earned a reward that is effective today, driving them to make a purchase using that reward.
    • Contact gets added to the segment/campaign when: Today is November 1, 2020 and the reward was issued on November 1, 2020.
    • Contact gets removed from the segment/campaign when the calendar turns to November 2, 2020, because the reward was not issued on that day.
  • Tomorrow: The value on the contact record is one day after today’s date. For example,

    • Field: Subscription End Date
    • Purpose: Trigger a reminder email to customers whose subscription is about to expire, driving them to renew and maintain their status.
    • Contact gets added to the segment/campaign when: Today is November 30, 2020 and the subscription expires on December 1, 2020.
    • Contact gets removed from the segment/campaign when the calendar turns to December 1, 2020, because the subscription end date is no longer a day in the future.
  • Anniversary: The month and the day of today’s date match the month and day of the contact field value. For example,

    • Field: Birthday
    • Purpose: Trigger an email wishing someone a happy birthday to increase engagement and customer satisfaction.
    • Contact gets added to the segment/campaign when: Today is November 1, 2020, and the contact was born on November 1 of any year.
    • Contact gets removed from the segment/campaign when the calendar turns to November 2, 2020, because it is no longer the contact’s birthday.

    Note

    Weeks in Campaign Studio begin on Monday and end on Sunday, and week references match the previous, current, or next calendar week rather than the preceding, current, or following 7-day period. Similarly, months and years follow calendar months (January, February, 2020, 1) rather than a set period of days like 30 or 365.

  • Last/this/next week/month/year: Combinations of the indicator (last, this, and next) and time period (week, month, and year) can be used for very powerful dynamic segmentation. Combined with the various operators, these can mean different things.

    • Less than: The contact field value is further in the past than the time period. For example, Today is November 1, 2020 and your filter says last year. Contacts whose field values match years of 2018 or earlier are included in the segment. 2019 is excluded, because that would equal last year.
    • Less than or equal: The contact field value is further in the past or exactly matches the selected time period. For example, Today is November 1, 2020 and your filter says last month. Contacts whose field values are in October 2020 or earlier are included in the segment.
    • Equal: The contact field value is within the previous calendar period. For example, Today is Tuesday, November 10, 2020 and your filter says this week. Contacts whose field values are in the period of Monday, November 9, 2020 to Sunday, November 15, 2020 are included in the segment.
    • Greater than or equal: The contact field value is in the future from or exactly matches the selected time period. For example, Today is November 1, 2020 and your filter says next month. Contacts whose field values are in December 2020 or later are included in the segment.
    • Greater than: The contact field value is further into the future from the selected time period. For example, Today is November 1, 2020 and your filter says next year. Contacts whose field values are in 2022 and later are included in the segment. 2021 is excluded, because that would equal next year.
  • +/- X minutes/hours/days/months/years: Rather than using a calendar period, you can determine a set period of time for your segment filters to match contact field values to. This uses the value for the minute, hour, day, month, or year column in the filter and add or subtract the number you use in the segment filter to match contact field values. Minutes and hours are only available for Date/Time fields.

    To look for a date in the future, use a positive value with a number value and a time period. For example, 30 days matches contacts whose field value is 30 days in the future from today.

    To look for a date in the past, use a negative value. For example, -30 days matches contacts whose field value is 30 days ago from today.

    Note

    A positive value does not require a + sign, but a negative value does require a - sign.

    Combining these values with various operators can provide the most powerful date-based segmentation, but ensure that they are set up properly to work with the campaigns you want to run. The following examples contain various combinations of positive and negative values, but usage is not limited to these combinations.

    • Less than: The contact field value is earlier in time than the specified relative time period. For example, Today is November 1, 2020 (2020-11-01) and your filter says -30 days. Contacts whose field values are more than 30 days in the past (2020-10-02) are included in the segment. Since time continues to move forward, the value would get further and further into the past and contacts would not be removed from this segment because the relative value is negative (assuming the field value does not change).
    • Less than or equal: The contact field value is earlier in time or equal to the specified relative time period. For example, Today is November 1, 2020 (2020-11-01) and your filter says 5 years. Contacts whose field values are anytime in the past or up to five years in the future (2025-11-01) are included in the segment. Since time continues to move forward, the value would remain within the future range or get further and further into the past and contacts would not be removed from this segment (assuming the field value does not change).
    • Equals: The contact field value exactly matches the specified relative time period. For example, Today is November 1, 2020 (2020-11-01) and your filter says 7 days. Contacts whose field value is November 8, 2020 (2020-11-08) are included in the segment. If the filter said -7 days, contacts whose field value is October 25, 2020 (2020-10-25) are included in the segment.
    • Greater than or equal: The contact field value is in the future from or equal to the specified relative time period. For example, Today is November 1, 2020 (2020-11-01) and your filter says -1 month. Contacts whose field value is October 1, 2020 (2020-10-01) or later are included in the segment. Since this filter value changes dynamically, contacts may be removed from the segment if the field value is no longer within the specified time period. In this example, a contact with a field value of October 1, 2020 is removed on November 2 because while the month value remains at 10 for October (11 for November minus 1 as specified in the segment filter), the dynamic day value moves to 02 and looks for contacts with a value greater than or equal to October 2 (2020-10-02).
    • Greater than: The contact field value is in the future from the specified relative time period. For example, Today is November 1, 2020 (2020-11-01) and your filter says 2 years. Contacts whose field value is November 1, 2022 (2022-11-01) or later are included in the segment. Since this filter value changes dynamically, contacts may be removed from the segment if the field value is no longer within the specified time period. In this example, a contact with a field value of November 2, 2022 is removed on November 2, 2020 because while the year value remains at 2022 (2020 + 2), the dynamic day value moves to 02 and looks for contacts with a value greater than (not equal to) November 2 (2022-11-02).

Important

Keep the context and timing of events in the campaign in mind when using these filters. If you have a series of events over a span of time longer than the day contacts, enter the segment and campaign, ensure that the operators and values do not cause the contact to drop out of the campaign before all events have been triggered. This is particularly important when using minutes or hours. Acquia does not recommend using seconds.

Segment options

Static and dynamic segments have more options on the right side of the Segment page.

segment options

  • Public Segment: This option determines if the segment is available for all users to see and use, or only the user who created the segment.
  • Available in Preference Center: If set to Yes, contacts can see and opt into or out of the segment on a Preference Center page. The segments display if the Preference Center has the Segment List slot type.
  • Published: If set to No, the segment will not be available for use in filters for other segments, as a contact source in campaigns, modify segment actions, etc. You will still see the segment in your segment list, but it essentially will not exist anywhere else in Campaign Studio.

On the Details tab, static and dynamic segments also have the option to display a different public name for a segment.

  • Public name: Users can set a different name for the segment, which is to be displayed to contacts in Preference Center options.

Viewing and exporting contacts in a segment

To view contacts in a specific segment, click View X contacts from your segment list. Or, in the Contacts section of Campaign Studio, enter segment:segment-alias in the search bar.

Segment - View Contacts

After the list of contacts loads, click the menu next to the Quick Add and Add New buttons and then select Export to download a .csv file with those contacts.

Contacts in time

After saving your segment, the segment summary page displays a graphical summary of the segment growth, by number of contacts who are members of the segment.

mautic-contacts-in-time-summary

The purple line shows how many contacts were added on a particular day. The green line shows the number of contacts removed from the segment. The orange line shows the total number of contacts in the segment.

If you change the timeframe on the graph to show growth over a longer period than 30 days, the intervals change from days to weeks. At greater than 100 days, the intervals change to months.

If you are using the branding function in Campaign Factory, the line for contacts added follow the color assigned as the primary color. The line for contacts removed follows the secondary color, and the total line follows the tertiary color.

Segment usages

On the right side of the segment summary page, you can see what other elements in your Campaign Studio instance the segment is used by. Click the number next to the item type to view the list of emails, campaigns, segments, reports, forms, or point triggers that use the segment. Usage may include the segment being a source for a segment email, campaign, report, segment membership filter or campaign condition, or an action to add or remove contacts to/from the segment.

This graph is helpful to see how contacts may be getting into or out of a segment, or what messages that segment is receiving. Be careful when making any changes to filters on the segment, particularly if a segment is used in a published campaign. Removing contacts from the segment based on filter changes removes them from the campaign. Adding contacts to the segment adds them to the campaign triggers events when the changes to the segment are saved.

Segment Dependencies

When a user builds a segment that leverages other segments within it, the page with the segment details displays an additional tab. This tab allows you to see if you have used a segment multiple times within a single segment, and helps to avoid creating logical errors when composing segments together.

Note

The tab displays both ‘included’ and ‘excluded’ segments.

For example, if you create Segment A that uses Segment B as a filter but Segment B already uses Segment A as a filter, this will be highlighted in the Segment Dependencies tab.

Segment Dependencies

Campaign Share

Below the Contacts in Time graph, you will see the contacts who are members of the segment, in card format. Click the Campaign Share tab to display a list of campaigns, and the percentage of contacts from that segment in each campaign.