Common searches used for segments

Rob Howard Updated by Rob Howard

Below are some tips on putting together common searches used to build segments.

Birthdays by month

DailyStory maintains and updates the annual birthday for your members (if you have provided their date of birth).

A common request may be to build a segment for everyone whose birthday is in June (or any other month). However, this can be problematic since the birth year can vary. For example, if today is May 3rd, 2020 and two member's birthdays are June 29, 1983 and June 7, 1974.

DailyStory solves this by constantly updating a contact's birthday to their next anniversary date. In this case, June 29, 2020 and June 7, 2020.

Note: DailyStory always sets the year to the future date. For example, if today is June 15, 2020 and someone's birthday was June 7, 1974 their next birthday in DailyStory is June 7, 2021.

Fortunately, all you need to do is pick the dates in search:

Birthdays today, tomorrow or other ranges

While specifying the exact dates for your birthday search may work in some cases, a more powerful option is to use a period search, e.g. birthdays within the next 3 days. When used in a dynamic segment it will constantly update each day as the criteria changes. While these are much more powerful, they are a little more complex too, please see the using advanced search article on more tips for working with ranged dates.

For a shortcut for common searches, type the following searches into the DailyStory search:

  • Birthdays today - &dateBirthFrom=today&dateBirthTo=today
  • Birthdays tomorrow - &dateBirthFrom=tomorrow&dateBirthTo=tomorrow
  • Birthday in next 3 days - &dateBirthFrom=today&dateBirthTo=next-3-days
Note: Unlike other period searches you cannot use the yesterday or past-#-[days|weeks|months|years] search criteria as birthdays are always advanced to the future date.

Working with Date Ranges

For customers using integrations such as Shopify, or other ecommerce integrations, it's common to want to build segments such as: customers that have not ordered in past 45 days.

These types of ranged based segments are automatically included when these integrations are enabled. However, you may want to build your own ranges or customize and existing range based search. Therefor, it's import to understand how they work.

Dynamic dates

DailyStory support dynamic range searches (as described above in Birthdays today, tomorrow and other ranges). Below are the supported range criteria.

yesterday

When comparing dates, use yesterday's date. For example, if today is June 15, 2023 yesterday is June 14, 2023.

today

When comparing dates, use yesterday's date. For example, if today is June 15, 2023 today is June 15, 2023.

tomorrow

When comparing dates, use yesterday's date. For example, if today is June 15, 2023 tomorrow is June 16, 2023.

next-N-days, next-N-weeks, next-N-months, next-N-years

Used to built dynamic search ranges. For example, if today is June 15, 2023 and we wanted to match on any date in the next 15 days: next-15-days.

past-N-days, past-N-weeks, past-N-months, past-N-years

Used to built dynamic search ranges. For example, if today is June 15, 2023 and we wanted to match on any date in the past 15 days: past-15-days.

Date range searches always work on a start date and end date. When building searches from contact search you are presented with this UX:

Used for searching within specific fixed date ranges.

This allows you to pick exact dates.

Using the options to the left you can configure period based date range searches along with some preset dynamic date range search.

The period based search option is shown when the Period link is clicked:

When calculating a period based search the first drop down allows you to choose between Next and Previous. Using this search you can calculate periods from today, e.g. next 30 days or past 30 days.

The preset search option provides several more advanced, but common, dynamic date range options. For example, to find anyone that made a purchase between 60 - 90 days ago you can select that option below.

There are a few special options, such as "All past dates including today". If today's data was June 15, 2023 this would match any contacts whose date field's value was June 15, 2023, June 14, 2023, May 1, 2001, etc.

Advanced date range configuration

While the search tools provide options for manipulating dates, some customers have more advanced requirements. For example, when using the Shopify integration, you may want to build a segment that targets customers that purchased in thee last 2 days.

To accomplish this you will need to directly edit the search critiera:

shopify_lastorder_dateFrom=yesterday&shopify_lastorder_dateTo=today

This would return all customers that ordered from yesterday until today.

This gets a little more complicated when you want to find customers that have not ordered within a specific range of time, such as haven't ordered in the past 45 days:

shopify_lastorder_dateFrom=past-1-year&shopify_lastorder_dateTo=past-45-days

The logic above is: find customers that have ordered at least 1 year ago up to 45 days ago. This would exclude anyone who has ordered in the past 45 days. Returns the desired results of anyone who has not ordered in the past 45 days.

This could also be written as:

shopify_lastorder_dateTo=past-45-days

However, if you want to build different segments, you'll need to be more specific to ensure a segment doesn't include a contact more than once:

Haven't ordered in past 45 days:

shopify_lastorder_dateFrom=past-90-days&shopify_lastorder_dateTo=past-45-days

Haven't ordered in past 90 days:

shopify_lastorder_dateFrom=past-180-days&shopify_lastorder_dateTo=past-90-days

Haven't ordered in the past year:

shopify_lastorder_dateFrom=past-1-year&shopify_lastorder_dateTo=past-180-days

How Did We Do?

Filtering your search

Contact