Summarize this documentation using AI
Overview
If you’re running retention in Customer.io, authentication is the difference between “we sent the flow” and “the right person actually got the right message.” If you want a second set of eyes on your identity plan before you scale cart recovery or winback, book a strategy call and we’ll pressure-test it like an operator.
In practice, most D2C teams don’t lose revenue because their creative is bad—they lose it because anonymous browsing, logged-in sessions, and purchases don’t stitch cleanly. That leads to duplicate profiles, broken suppression logic, and recovery messages going to the wrong channel (or not going out at all).
How It Works
On web and mobile, people behave anonymously until they do something that proves who they are—log in, create an account, or enter an email/phone at checkout. Customer.io’s SDK-side authentication pattern is about capturing events early (even when anonymous) and then attaching that activity to a known person the moment you can confidently identify them.
- Anonymous session starts first. The SDK can track page views, product views, add-to-cart, and checkout-start events before you know who the customer is.
- Identity gets established at a “trust moment.” When the customer logs in or submits an email/phone, you call
identifywith your stable customer identifier (and optionally set attributes like email/phone). - Stitching happens through the SDK/device context. Once identified, future events should land on the known person—so your cart recovery, browse abandon, and replenishment logic can rely on a single profile instead of a pile of fragments.
- Logout matters. If someone logs out (shared device, family iPad), you need to reset the SDK identity. Otherwise you’ll attribute the next person’s browse/cart activity to the prior customer, which is how you end up sending “Finish your order” to the wrong person.
Real D2C scenario: A customer browses on mobile Safari, adds a cleanser to cart, then later opens your iOS app and logs in to check order status. If your SDK authentication is clean, that earlier anonymous cart activity can be stitched to the logged-in profile—so your cart recovery flow triggers once, on the right person, with the right SKU and channel (push/email/SMS). If it’s messy, you’ll either miss the recovery entirely or send duplicate nudges from multiple profiles.
Step-by-Step Setup
The goal here is simple: track events as early as possible, then identify as late as necessary (only when you have a reliable ID). That gives you full-funnel behavioral data without poisoning profiles with incorrect merges.
- Install the Customer.io SDK on each surface you care about (web + mobile).
Make sure you’re using the same workspace/environment across platforms (prod vs staging), or you’ll think stitching is broken when it’s really just split data. - Define your stable identifier.
Use your internal customer ID (not email) as the primaryidyou pass toidentify. Emails change; customer IDs shouldn’t. - Track anonymous events immediately.
Instrument key retention events even before login:Product Viewed,Added to Cart,Checkout Started. Include properties you’ll need later (SKU, price, category, cart_id). - Call
identifyat the first trustworthy moment.
Typical moments: account login, account creation, or email/phone capture during checkout. Pass the stable ID and set attributes likeemail,phone,first_nameif you have them. - Persist identity across app launches, but handle logout explicitly.
When the user logs out, reset/clear the SDK identity so the next session starts anonymous again. - Send a purchase event with strong identifiers.
On order completion, trackOrder Completedwithorder_id, line items, revenue, and any subscription flags. This is the anchor for repeat purchase and winback segmentation. - QA stitching in Activity Logs before you launch campaigns.
Run a test: browse anonymously → add to cart → identify → purchase. Confirm those events appear under one person profile and that your cart/purchase segments behave as expected.
When Should You Use This Feature
Authentication work is worth it when you’re relying on behavioral triggers and suppression rules. If your program includes cart recovery, browse abandon, post-purchase cross-sell, or winback, identity stitching is not optional—it’s the foundation.
- Cart recovery that doesn’t double-send. You need anonymous cart building plus a clean handoff when an email/phone is captured.
- Browse abandon with channel accuracy. If a customer is logged in on app (push eligible) but anonymous on web, stitching prevents you from treating them like two different people.
- Repeat purchase and replenishment timing. Purchase events must land on the same profile that did the browsing, otherwise “reorder” flows target the wrong cohort.
- Reactivation/winback that excludes recent buyers. Bad identity means you’ll spam recent purchasers because their purchase landed on a different profile.
Operational Considerations
Most retention programs don’t break in the campaign builder—they break in the seams between app identity, web identity, and backend truth. Plan for how data moves, when it’s trustworthy, and how you’ll prevent duplicates from contaminating segments.
- Segmentation depends on consistent event naming and IDs. If web tracks
AddedToCartand app tracksAdd to Cart, your “cart abandoners” segment will silently undercount. - Decide where “source of truth” lives for purchases. Many teams track purchase client-side and server-side; that’s fine, but you must dedupe with
order_idor you’ll inflate revenue and trigger post-purchase flows twice. - Identity stitching needs guardrails. Only call
identifywhen you’re confident. Don’t identify on a partially typed email field; wait for a confirmed submit. - Orchestration reality: suppression logic needs one person. Browse abandon, cart recovery, and winback all rely on “has purchased since event” checks. Duplicate profiles make those checks meaningless.
- Shared devices are common in D2C. Tablets and family phones create cross-account contamination unless logout/reset is implemented correctly.
Implementation Checklist
If you want this to hold up under real traffic (not just QA), align product, engineering, and retention on a single identity contract and a short list of canonical events.
- SDK installed and initialized on web and all mobile platforms you support
- Stable customer ID selected for
identify(not email) - Anonymous tracking implemented for product view, add to cart, checkout start
identifyimplemented on login/account creation/confirmed checkout capture- Logout/reset identity implemented and tested on shared-device flows
- Order completion event implemented with
order_idand item-level data - Dedupe plan for purchase events (client vs server) documented
- QA path validated in Customer.io activity logs (anonymous → identify → purchase)
Expert Implementation Tips
These are the small operator moves that prevent weeks of “why is this segment wrong?” debugging later.
- Identify once, then update attributes separately. Keep identity stable; use attribute updates for email/phone changes so you don’t accidentally fork profiles.
- Standardize event payloads across platforms. Use the same keys for SKU, product_id, cart_id, and category everywhere—your segments and message personalization will thank you.
- Use cart_id as your stitching anchor for recovery. Even if identity is late, a consistent
cart_idhelps you dedupe and avoid sending multiple recoveries for the same cart. - Instrument “Checkout Email Submitted” as a distinct event. In most D2C funnels, that’s the cleanest moment to identify for cart recovery without waiting for account creation.
Common Mistakes to Avoid
These are the failure modes we see when retention teams scale spend and suddenly the data can’t keep up.
- Using email as the primary ID. It seems convenient until someone changes their email or checks out with a different one and you fragment their purchase history.
- Calling
identifytoo early. Identifying on an unconfirmed email field creates dirty merges and misattributed carts. - Not resetting identity on logout. This is how you send cart recovery to the wrong person on shared devices.
- Double-tracking purchases without dedupe. Two
Order Completedevents can trigger two post-purchase flows and wreck LTV reporting. - Inconsistent event names between app and web. Your segments will look “fine” but underperform because they’re missing half the audience.
Summary
If you want reliable cart recovery, repeat purchase, and winback, you need clean SDK authentication and identity stitching across anonymous and logged-in sessions.
Get the identify/logout moments right, standardize events across platforms, and QA stitching before you scale journeys.
Implement Auth with Propel
If you’re tightening up authentication so Customer.io campaigns stop leaking revenue through duplicate profiles and missed stitching, it helps to validate the identity contract end-to-end (web + app + backend). If you want us to review your current tracking plan and point out where it’ll break under real retention orchestration, book a strategy call.