Summarize this documentation using AI
Overview
“Within the past X days” is one of the most common filters used to drive revenue in D2C automations, but it is also one of the easiest ways to accidentally exclude the exact shoppers you want. Timestamp conditions in Customer.io decide eligibility based on how your timestamps are stored, the exact moment the platform evaluates the segment, and whether the field is treated as a true timestamp or a plain string.
A common D2C example is cart recovery: you build a segment for “Added to Cart within the past 1 day” and wonder why yesterday’s high-intent shoppers are missing, even though you can see the events in your warehouse or Shopify logs.
If you want this to be dependable across email, SMS, and paid retargeting audiences, Propel can help you audit the data contract and automation logic end to end in Customer.io. If you want a second set of eyes on your segment logic, book a strategy call.
How It Works
“Within the past X days” timestamp conditions in Customer.io work by comparing a timestamp field (or event time) against “now” at evaluation time, then checking whether the difference falls inside the window you specified.
In practice, three mechanics matter most:
- Evaluation time is literal. If your condition is “within the past 1 day,” someone at 24 hours and 1 minute will not match, even if it still feels like “yesterday” to your team.
- Time zone and formatting affect the stored value. If you send timestamps in local time without a timezone indicator, or you store a date string like “2026-03-22” instead of a true timestamp, the comparison can behave unexpectedly.
- You might be filtering on the wrong clock. “Event occurred” uses the event’s timestamp, while “attribute updated” uses when the attribute changed. For D2C, this shows up when cart state is stored as an attribute that gets overwritten, rather than an immutable event stream.
When you build segments and triggers around these rules, treat them like strict math, not like calendar language. This is also why teams often see different counts between a segment preview and a campaign entry rule, depending on when the system evaluates each. For more hands-on implementation patterns, we typically align these rules with the way Customer.io evaluates segments versus campaign entry.
Step-by-Step Setup
To make “within the past X days” timestamp conditions in Customer.io reliable, set it up like you would a revenue-critical data dependency, because it is.
- Confirm the source of truth. Decide whether you are segmenting off an event timestamp (preferred for behaviors like add_to_cart, checkout_started, order_completed) or a person attribute timestamp (sometimes fine for last_purchase_at).
- Validate the timestamp format in your incoming data. Ensure timestamps are sent as true timestamps (for example, ISO 8601 with timezone like 2026-03-22T18:42:10Z) and not as ambiguous strings.
- Check for overwrite behavior. If you store something like last_cart_updated_at as a single attribute, it will change every time the cart updates. That can kick people out of a “within past X days” audience unexpectedly if your logic assumes a stable moment in time.
- Choose the right window. Use hours when you mean hours. For cart recovery, “within the past 6 hours” and “within the past 24 hours” usually map better to intent decay than “within the past 1 day.”
- Preview the segment with known customers. Spot-check 10 to 20 real profiles where you know the event time. Compare their event timeline to whether they match the segment right now.
- Align campaign entry rules with the segment. If a campaign is triggered by an event, avoid adding a separate “within past X days” filter that re-checks the same thing unless you are intentionally creating a grace window.
- Instrument a QA workflow. Create an internal Slack or email alert when a “should be eligible” test profile fails to match, so you catch drift after site changes.
When Should You Use This Feature
“Within the past X days” timestamp conditions in Customer.io are best used when recency is the core predictor of conversion, which is true for most D2C revenue moments.
- Abandoned cart recovery: Target shoppers who added to cart or started checkout within a tight window, then sequence incentives as time passes.
- Post-purchase cross-sell: Trigger replenishment or complementary product discovery based on last_order_at within 21 to 45 days, depending on your category.
- Browse abandonment: Build audiences for “viewed product within past 1 day” and suppress purchasers within the same window to avoid wasted sends.
- Reactivation: Identify customers whose last_purchase_at is outside your repeat cycle, then reintroduce bestsellers or new arrivals.
Operational Considerations
“Within the past X days” timestamp conditions in Customer.io require operational rigor around segmentation, data flow, and orchestration, or they will quietly leak revenue.
- Event-first data modeling wins. In retention programs we’ve implemented for D2C brands, cart and checkout behaviors are far more reliable as immutable events than as mutable attributes.
- Define a single canonical timezone. Standardize on UTC for incoming timestamps, then use messaging send-time localization separately. Mixing local timestamps with UTC comparisons is a common source of “missing people.”
- Account for evaluation timing. If your segment is used for a daily newsletter audience, it will evaluate at send time, not at the moment you built it. That matters when your window is tight.
- Suppressions should use the same clock. If you suppress “purchased within past 1 day,” make sure purchase timestamps are consistent with the event time you use for eligibility, or you will message recent buyers.
Implementation Checklist
Use this “within the past X days” timestamp conditions in Customer.io checklist to keep segments stable as your site and data evolve.
- All behavioral timestamps are sent in ISO 8601 with timezone (preferably UTC).
- Key behaviors (add_to_cart, checkout_started, order_completed) are tracked as events, not only as attributes.
- Segment logic uses hours-based windows where intent decays quickly (cart, checkout).
- Segment preview is validated against a list of known test profiles with real event histories.
- Campaign entry rules and segment filters are aligned (no redundant recency checks unless intentional).
- Suppression logic (recent purchasers, recent unsubscribes) uses the same timestamp standard.
- Ongoing QA alerts exist for “expected eligible” profiles that fail to match.
Expert Implementation Tips
“Within the past X days” timestamp conditions in Customer.io become a lot more predictable when you design around edge cases on purpose.
- Use a grace period instead of stretching the window. For cart recovery, keep eligibility tight (like 24 hours), then add a short delay before the first message to avoid hitting people who are still actively checking out.
- Model cart state as a series, not a snapshot. In retention programs we’ve implemented for D2C brands, teams that track cart_updated plus cart_cleared events can build cleaner logic than teams relying on a single last_cart_updated_at attribute.
- Backstop with “not purchased since.” If you are using “within past X days” for browse or cart, add a purchase suppression that checks for order_completed after the behavior event time, not just “within past X days.”
Common Mistakes to Avoid
“Within the past X days” timestamp conditions in Customer.io often fail for simple, fixable reasons that look like platform bugs until you trace the data.
- Sending date strings instead of timestamps. A value like “03/22/2026” might display fine in a profile but compare poorly in recency logic.
- Assuming “1 day” means “today and yesterday.” It means the last 24 hours from the moment the segment evaluates.
- Using mutable attributes for behavioral recency. Overwrites can move customers in and out of eligibility unexpectedly.
- Stacking multiple recency filters. Example: trigger on checkout_started, then also filter “checkout_started within past 1 day,” which can exclude legitimate entrants if the evaluation happens later.
- Ignoring timezone drift. Local timestamps without explicit timezone info are a silent source of mismatches.
Summary
Use “within the past X days” when recency drives conversion, especially for cart, checkout, and post-purchase timing.
Make it dependable by standardizing timestamps, preferring event-based tracking, and validating evaluation timing in Customer.io.
Implement with Propel
Propel helps D2C teams make Customer.io segments and automations match real shopper behavior, so revenue flows do not get derailed by timestamp edge cases. If you want help auditing your recency audiences and fixing data contracts, book a strategy call.