Summarize this documentation using AI
Overview
If you’re trying to run retention programs off shaky tracking, you’ll end up guessing—especially on cart recovery and reactivation where timing and identity matter. Customer.io’s SDK approach is straightforward: track the right events in the app/site, stitch identity cleanly, then trigger Journeys off those events. If you want a second set of eyes on what to track (and what to ignore), book a strategy call and we’ll pressure-test your tracking plan against the flows you actually want to run.
In most retention programs, we’ve seen the biggest lift come from getting three things right: (1) when you identify a user, (2) which commerce events you send, and (3) how consistently you pass IDs so Customer.io can match behavior to the right person.
How It Works
At a practical level, the SDK is just your app/site’s way of telling Customer.io: “this person is X” and “they just did Y.” Once Customer.io receives those calls, you can segment, trigger Journeys, and personalize messages based on real behavior—not pageviews and hope.
- Anonymous activity starts first. A shopper can browse and add to cart before they log in or enter an email. The SDK can still record events, but they’ll be tied to an anonymous profile until you identify them.
identifyis the stitching moment. When the shopper logs in, creates an account, or submits email/phone at checkout, you callidentifywith your stable customer ID (and optionally email/phone). Customer.io then ties future events to that person—and depending on your setup, can merge earlier anonymous activity too.tracksends the behavioral events that power retention. ThinkProduct Viewed,Added to Cart,Checkout Started,Order Completed,Subscription Created. These events become your triggers, your filters, and your conversion criteria.- Device context matters for mobile. On mobile SDKs, Customer.io also maintains device tokens (for push) and device metadata. If identification is inconsistent, push eligibility and message targeting gets messy fast.
- Journeys run on top of your data. Once events and attributes are flowing, you build Journeys that react in near-real time—like a 30-minute cart reminder, a 3-day bounceback offer, or a 45-day reactivation attempt.
Real D2C scenario: A shopper adds a skincare bundle to cart on iOS, closes the app, then later completes checkout on desktop after clicking an email link. If you identify with the same customer ID across app + web and track consistent Added to Cart / Order Completed events, Customer.io can suppress the cart series instantly once the order hits—no “still thinking about it?” email after they’ve paid.
Step-by-Step Setup
The fastest path is to decide your identity strategy and event schema first, then implement the SDK calls to match. If you code first and name events later, you’ll spend weeks cleaning up segments and broken triggers.
- Pick your canonical identifier (don’t overthink, but be consistent).
Use a stable internal customer ID as the primary ID. Treat email/phone as attributes that can change. - Install the right SDK(s) for your surfaces.
Most D2C teams need at least one mobile SDK (iOS/Android/React Native/Flutter) and often web tracking as well. Align versions across platforms so event behavior is predictable. - Implement
identifyat the correct moments.
Callidentifywhen you actually know who the user is: login, account creation, email capture, or checkout identity step. Avoid identifying on app open with a guessed email. - Send key commerce events with clean properties.
At minimum:Product Viewed,Added to Cart,Checkout Started,Order Completed. Include properties likesku,product_id,variant,price,quantity,cart_value,currency. - Set person attributes you’ll actually segment on.
Examples:first_order_date,last_order_date,lifetime_value,subscription_status,preferred_category. Don’t dump your whole user table “just because.” - Verify the data in Customer.io before building Journeys.
Check a few real test users end-to-end: anonymous browse → identify → add to cart → purchase. Confirm events land once, with expected properties, and on the right profile. - Only then build triggers + suppression logic.
Cart series should exit immediately onOrder Completed. Reactivation should suppress ifOrder Completedhappened in the last X days. This depends entirely on reliable event delivery.
When Should You Use This Feature
SDK tracking is worth the effort when behavior inside your app/site should directly control what messages someone receives—and when. If your retention program relies on “last email click” as a proxy for intent, you’ll miss the real buyers and annoy the wrong people.
- Cart recovery that doesn’t embarrass you. Trigger on
Added to Cartand suppress onOrder Completedacross devices. - Browse-to-buy product discovery. Use
Product Viewed+ category affinity to send replenishment, cross-sell, or “similar products” messaging. - Repeat purchase timing. Use
Order Completedplus SKU-level data to time replenishment reminders (e.g., 21 days after a 30-serving supplement). - Reactivation based on real inactivity. Trigger when someone hasn’t had an
Order Completedevent in 45–90 days, not when they “haven’t opened an email.” - Mobile push orchestration. If push is a meaningful channel, SDK-based device management + identify hygiene is non-negotiable.
Operational Considerations
This is where most teams lose time: the SDK technically “works,” but the data isn’t usable for segmentation and orchestration. The goal is not more data—it’s data you can trust inside Journeys.
- Segmentation depends on event consistency. If Android sends
add_to_cartand iOS sendsAdded to Cart, you’ll build duplicate segments and miss users. Standardize names and required properties. - Identity stitching breaks when you have multiple IDs. Decide whether Customer.io’s primary key is your internal customer ID, email, or something else—and stick to it across app + web + backend. In practice, this tends to break when checkout uses email but the app uses a numeric user ID without mapping.
- Backend vs client-side event sources. For revenue-critical events like
Order Completed, many D2C brands send the “source of truth” from backend/webhook (Shopify/OMS) and use SDK events for intent (view/cart/checkout). That avoids false positives from flaky clients. - Deduplication matters. Mobile retries, offline caching, and multi-tap UX can create duplicate events. If you don’t include an idempotency key (like cart ID, order ID, or event UUID), your conversion metrics and Journey logic will drift.
- Orchestration needs suppression rules, not just triggers. Every retention Journey should have clear exit conditions (purchase, subscription started, support ticket opened, etc.). That only works if those events reliably arrive and map to the right profile.
Implementation Checklist
Before you ship SDK tracking to production, make sure you’ve covered the basics that keep retention automations clean and measurable.
- Canonical customer ID chosen and documented
identifyimplemented at login/signup/email capture/checkout identity step- Anonymous-to-known behavior strategy confirmed (merge expectations aligned)
- Event schema standardized across platforms (names + required properties)
- Commerce events implemented: Product Viewed, Added to Cart, Checkout Started, Order Completed
- Order events include
order_id,value,currency, and line items (when possible) - Deduplication approach defined (order_id/cart_id/event_uuid)
- Test users validated in Customer.io: correct profile, correct event payloads
- Journeys include suppression/exit rules based on purchase events
Expert Implementation Tips
The difference between “we’re tracking events” and “retention is compounding” usually comes down to a few operator decisions that keep your data usable over time.
- Track intent client-side, confirm revenue server-side. Use SDK for browse/cart/checkout intent; use backend/webhook for
Order Completedso you don’t trigger winbacks on failed payments. - Include SKU/variant on every commerce event. If you only track cart value, you can’t do replenishment, cross-sell, or category-based suppression without messy inference.
- Make “cart ID” a first-class property. It gives you cleaner dedupe and lets you reason about multi-cart behavior (common on mobile).
- Build one “golden path” QA Journey. A private Journey that pings Slack/email when key events fire (Added to Cart, Checkout Started, Order Completed) helps you catch broken releases before revenue emails go sideways.
- Don’t identify too early. If you identify on a prefilled email field that the user edits later, you’ll create duplicates and lose attribution. Wait until the email/phone is confirmed.
Common Mistakes to Avoid
These are the issues that quietly wreck cart recovery and reactivation programs—even when the creative and offers are solid.
- Using email as the only identifier across app + web without a stable user ID. Emails change; guest checkout creates edge cases; identity splits.
- Inconsistent event naming between platforms. You’ll build segments that “work” but only for half your users.
- Missing suppression events. Teams trigger cart flows on
Added to Cartbut forget to reliably sendOrder Completed, so buyers keep getting reminders. - Not sending timestamps or sending them inconsistently. Time-window logic (like “within 2 hours”) becomes unreliable if event time isn’t trustworthy.
- Overloading person attributes with raw JSON blobs. It feels flexible, but it slows segmentation work and makes personalization brittle.
- No dedupe strategy. Duplicate orders/events inflate revenue attribution and can accidentally qualify people for winback incentives.
Summary
If you want Customer.io Journeys to drive repeat purchase and recover carts cleanly, your SDK implementation needs disciplined identity and event tracking. Get identify right, standardize commerce events, and make purchase events reliable enough to suppress everything else.
Implement How It Works with Propel
If you’re already running retention in Customer.io, the fastest wins usually come from tightening identity stitching and upgrading the event payloads that power your highest-volume flows (cart, post-purchase, winback). If you want us to map your SDK events to the Journeys you’re trying to run—and flag where tracking will break under real traffic—book a strategy call.