Summarize this documentation using AI
Overview
If you want Customer.io to drive real repeat purchase and recovery flows, your SDK events need to be boringly consistent: same names, same IDs, same timing—every time. If you’re unsure whether your app instrumentation is “good enough” for revenue workflows (or you’ve been burned by mismatched identities), book a strategy call and we’ll pressure-test your tracking plan like an operator would.
In most D2C retention programs, event tracking is the difference between “we sent an abandoned cart flow” and “we recovered carts reliably.” The SDK is where you capture high-intent behavior (viewed product, added to cart, started checkout, purchased) with the right context so Customer.io can segment, trigger, and personalize without guessing.
How It Works
Customer.io’s SDKs (mobile/web) send two kinds of data that matter for retention: identity (who the person is) and events (what they did). The hard part isn’t firing events—it’s making sure anonymous behavior stitches to the right customer once they log in, and that event payloads are stable enough to power segmentation and orchestration.
- Install the SDK in your app (iOS/Android/Web/React Native/etc.) and configure it with your workspace credentials.
- Identify the user when you actually know who they are (login, account creation, email capture). This is the moment that makes retention triggers trustworthy.
- Track events for key commerce actions. Each event should include properties you’ll need later for segmentation and message content (e.g., cart value, currency, product IDs, category, variant, quantity).
- Stitch anonymous → known by ensuring you don’t “identify” too early with placeholder IDs, and by keeping a consistent customer identifier across devices and sessions.
Real D2C scenario: A shopper browses anonymously on mobile, adds a product to cart, then logs in at checkout. If you track Added to Cart anonymously and then call identify at login/checkout with the real customer ID, Customer.io can attribute that cart to the right person and trigger the correct cart recovery message if they drop—without spamming someone else or losing the event.
Step-by-Step Setup
The goal here is simple: make your app send a small set of high-signal events with clean identity handling. Don’t start by tracking everything—start by tracking what you’ll actually use to trigger and personalize retention campaigns.
- Pick your canonical customer identifier.
Use a stable ID from your backend (e.g.,customer_id). Avoid email as the primary ID if it can change; store email as an attribute. - Install the Customer.io SDK in your app.
Do this in your mobile app (and web app if applicable). Configure environment handling (dev/staging/prod) so test events don’t pollute production segments. - Implement
identifyat the right moment.
Call identify only when you’re confident the person is known (account created, login, email verified, or checkout email captured). Send key attributes at identify time (email, phone, first_name, acquisition_source if you have it). - Track your retention-critical events.
Start with a tight set:Product Viewed(includeproduct_id,category,price)Added to Cart(includecart_id,items,cart_value,currency)Checkout Started(includecart_id,cart_value)Order Completed(includeorder_id,total,items,discount_code)
- Standardize event names and payload shape.
Lock naming conventions early (Title Case vs snake_case, singular vs plural). Decide on anitemsschema and keep it consistent across platforms. - Verify in Customer.io activity logs.
Use a test device and a test account. Confirm the same person profile shows: anonymous browsing events, then post-identify events, all under one profile. - Build one “proof” segment and one trigger.
Example segment: “Added to Cart in last 2 hours AND no Order Completed.” Trigger a simple push/email to validate end-to-end behavior before you scale.
When Should You Use This Feature
SDK event tracking is the move when your retention outcomes depend on behavior that happens inside the app (or you need faster, more reliable signals than what your ecommerce platform sends). If you’re trying to recover revenue based on intent, SDK events are usually where the cleanest intent lives.
- Cart recovery that doesn’t lie. Trigger on
Added to CartorCheckout Startedwith cart contents for dynamic product blocks. - Browse-to-buy follow-ups. If someone views the same product twice but doesn’t add to cart, send a product education message or social proof.
- Post-purchase replenishment. Use
Order Completedplus item-level data to estimate reorder windows (e.g., supplements at 25 days, skincare at 45 days). - Winback/reactivation based on real inactivity. “No app_open AND no product_viewed in 30 days” is more actionable than “no email clicks.”
- Cross-device continuity. If customers browse on mobile and purchase on web, consistent identity + event tracking prevents gaps in suppression logic (e.g., don’t send cart recovery after purchase).
Operational Considerations
This is where implementations tend to break in practice: not in the SDK install, but in how data flows through identity, segmentation, and orchestration. If your events aren’t designed for segmentation, your journeys become fragile and your message logic turns into a pile of exceptions.
- Segmentation depends on payload discipline. If
cart_valueis sometimes a string and sometimes a number, you’ll get segments that silently miss users. - Identity stitching is a retention lever. Decide how you treat guest checkout and email capture. If you identify on “email entered” in checkout, you can recover more carts—but only if you’re confident you won’t misidentify shared devices.
- Event timing affects suppression. Make sure
Order Completedfires immediately after confirmation. Delays create the classic bug: customers receive cart recovery after buying. - Orchestration needs a single source of truth. If your backend also sends purchase events, dedupe or pick one pipeline. Double-firing purchases will wreck frequency controls and LTV reporting.
- Platform parity matters. If iOS tracks
Checkout Startedbut Android doesn’t, your segments will skew and your holdouts won’t be clean.
Implementation Checklist
Before you build more journeys, get these basics locked. It’s the difference between a retention program you can scale and one you’re constantly patching.
- Canonical customer ID selected and documented
identifyimplemented at login/account creation/checkout email capture (as appropriate)- Event taxonomy defined (names + required properties)
- Consistent
itemsschema across platforms (product_id, variant_id, qty, price) Added to Cart,Checkout Started,Order Completedfiring reliably- Anonymous-to-known stitching validated in Customer.io profile activity
- Purchase event deduped (SDK vs backend) and tested
- At least one segment + one triggered message validated end-to-end
Expert Implementation Tips
These are the small choices that make your retention system resilient. Most teams skip them, then wonder why segments don’t match or why “high intent” audiences feel noisy.
- Track intent depth, not just actions. Add properties like
view_count(or track repeated views) andtime_on_producttiers—then reserve your strongest offers for the highest intent. - Use cart_id/order_id everywhere. It makes dedupe, troubleshooting, and suppression logic dramatically easier.
- Send currency explicitly. Multi-currency brands get burned when totals are compared without
currency. - Keep event names human-readable. Your future self building segments at 11pm will thank you.
- Validate with a “message preview” payload. Make sure the exact properties you want in the email/push (product title, image URL, deep link) exist in the event so you’re not blocked later.
Common Mistakes to Avoid
Most tracking failures show up as revenue failures: missed recoveries, over-messaging, or broken personalization. These are the repeat offenders.
- Identifying users too early with unstable IDs. If you identify with a device ID and later re-identify with a customer ID, you can split profiles and lose the cart.
- Inconsistent event naming across platforms. “add_to_cart” on web and “Added to Cart” on iOS creates two audiences and half your automation won’t fire.
- Tracking purchases without item detail. You’ll struggle to run replenishment, cross-sell, and category-based winbacks without line items.
- Double-sending purchase events. SDK + backend both firing
Order Completedinflates conversion and breaks suppression windows. - Forgetting unsubscribe/suppression logic in orchestration. Even perfect events won’t save you if your journeys don’t exit on purchase or respect frequency caps.
Summary
If you want Customer.io to reliably recover carts and drive repeat purchase, treat SDK event tracking like core infrastructure—not an analytics afterthought. Nail identity stitching, standardize your event schema, and validate one end-to-end recovery flow before you scale.
Implement Track Events with Propel
If you’re instrumenting SDK events and you want a second set of operator eyes on identity stitching, dedupe, and the exact event payloads that make cart recovery and replenishment work, we can help. We spend most of our time inside Customer.io accounts fixing tracking that “kind of works” and turning it into tracking you can confidently automate on—if that’s useful, book a strategy call and we’ll map the minimum viable event plan for your retention goals.