How do I target my audience using date user properties?
Target and track your audience based on the date and time of custom user properties with date-typed user properties. For example, target users who have an upcoming event, such as a flight or concert, or ask customers to leave a review a few days after an event, such as checking out of a hotel or purchasing an item.
DateTime user properties have been available since Swrve SDK version 4.7. For information on how to implement custom DateTime user properties in your app, see the related integration guide:
This article describes the time frames associated with DateTime filter operators. It also includes examples of how to use custom DateTime user properties to target or segment your users. For more information about how to use the available segment and audience filters, see Segment and audience filters.
Filter time frames
For DateTime targeting purposes, one day equals a 24-hour sliding window. The following examples show how a property would match the selected filter, where the point of evaluation for in-app campaigns is session start and the point of evaluation for push notification campaigns is the scheduled time of the push.
Example | Time frame |
---|---|
Property is 1 day ago. | The property DateTime is within a 24-48 hour window prior to the point of evaluation. |
Property is 1 day away. | The property DateTime is within a 24-48 hour window after the point of evaluation. |
Property is 2 days ago. | The property DateTime is within a 48-72 hour window prior to the point of evaluation. |
Property is 2 days away. | The property DateTime is within a 48-72 hour window after the point of evaluation. |
Property is not 2 days ago. | The property DateTime falls outside of the 48-72 hour window prior to the point of evaluation. |
Property is not 2 days away. | The property DateTime falls outside of the 48-72 hour window after the point of evaluation. |
Property is between 1 and 2 days away. | The property DateTime is within a 24-48 hour window from the time of evaluation. |
Property is between 1 and 2 days ago. | The property DateTime is within a 24-48 hour window prior to the time of evaluation. |
Property is not between 1 and 2 days away. | The property DateTime falls outside of the 24-48 hour window from the time of evaluation. |
Property is not between 1 and 2 days ago. | The property DateTime falls outside of the 24-48 hour window prior to the time of evaluation. |
Property is date June 3, 2020 PST. | The property DateTime is between 00:00 and 23:59:59:59 on the selected date, in the selected time zone. |
Property is date between June 3, 2020 9:30am PST to June 5, 2020 9:30am PST. | The property DateTime is between the dates and times selected, in the selected time zone. |
Time zones
If using the date is or date is between filter operators, note the following points about time zones:
- The customer’s device logs the property DateTime in a set time zone (for example, PST). For targeting purposes, the SDK converts the value to UTC when sending the DateTime to Swrve (for example, UTC-08:00).
- The filter in the audience builder defaults to your company time zone. If you select the same time zone as the property’s time zone (for example, America/Los_Angeles), the system again converts the DateTime to UTC and the values will match.
- If you select a filter time zone that is different than the property’s time zone, the DateTime may not match the targeted time frame. For example, if the property is set to EST but the audience filter is set to PST, there could be a possible mismatch of three hours.
Targeting DateTime user properties
This section covers some common use cases for targeting DateTime user properties.
Target an upcoming event
Use this example to target customers who have an upcoming event, such as a flight, to encourage them to check in or book a seat.
Target a recent purchase
Use this example to target customers who made a recent purchase, to prompt them to review their purchase.
Target a specific date range
Use this example to target customers within a specific date range; for example, to notify them of an airport strike.
Recurring push notifications
Our legacy push campaign workflow had the option to use DateTime properties as the recency criteria when creating a recurring push campaign. This is now possible by defining your audience criteria using a DateTime user property, as described in the previous section, and then scheduling your campaigns to send repeatedly over a chosen period or on specific days. For more information on how to achieve this scenario in the new campaign workflow, see How do I configure target audiences for daily recurring push campaigns?
The following examples show the time frames associated with the different scheduling options for recurring push notifications and how Swrve calculates the target audience based on your DateTime audience criteria. In this example, the property DateTime is seven days away and the company time zone is PST (UTC-8). For evaluation and scheduling purposes, Swrve converts all times to UTC.
Option 1: Schedule the notification at the same time worldwide
- The point of evaluation is the scheduled time, converted to UTC. For example, 16:55 UTC.
- Every day at 16:55 UTC, Swrve calculates the target audience, checking if the property DateTime is within 168 (24 x 7) and 192 (24 x 8) hours from the time of calculation.
- If the property DateTime is in that range, the user is sent the push notification.
Option 2: Schedule the notification at the user’s local time
- The point of evaluation is at the scheduled time in the company’s time zone, converted to UTC. For example, 16:55 UTC.
- Every day at 16:55 UTC, Swrve calculates the target audience, checking if the property DateTime is within the 168-192 hour window from the time of calculation.
- If the property DateTime is within that range, the user is sent the push notification at the scheduled time in their local time zone.
Option 3: Schedule the notification at the user’s optimal time between 8am and 9pm
- The point of evaluation is midnight in the company’s time zone, converted to UTC. For example, 08:00 UTC.
- Every day at 08:00 UTC, Swrve calculates the target audience, checking if the property DateTime is within the 168-192 hour window from the time of calculation.
- If the property DateTime is within that range, the user is sent the push notification at their optimal time between 8am and 9pm, in their local time zone.
Option 4: Schedule the notification at the user’s optimal time over a 24-hour period
- The point of evaluation is midnight in the company’s time zone, converted to UTC. For example, 08:00 UTC.
- Every day at 08:00 UTC, Swrve calculates the target audience, checking if the property DateTime is within the 168-192 hour window from the time of calculation.
- If the property DateTime is within that range, the user is sent the push notification at their optimal time over a period of 24 hours, in their local time zone.
Next steps
- To learn how to schedule your campaigns in the new campaign flow, see Scheduling your campaigns.
- To learn how to target your campaign audience, see Targeting campaign audiences.