How Customer.io SDK Tracking Works (and how to set it up for retention)

Customer.io partner logo

Table of Contents

Summarize this documentation using AI

This banner was added using fs-inject

Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Overview

If you’re using Customer.io to drive repeat purchase and recovery flows, the SDK is where retention either gets clean…or quietly breaks. The difference usually comes down to two things: (1) when you identify a user and (2) whether your events carry the right IDs and properties to stitch pre-login behavior to a real customer profile.

If you want a second set of eyes on your tracking plan before you build journeys around shaky data, book a strategy call—we’ll pressure-test identity, event naming, and the “gotchas” that cause missed sends or duplicate profiles.

How It Works

At a practical level, the Customer.io SDK sits inside your app (mobile or web) and does three jobs: it creates/maintains a device-level identity, it sends behavioral events, and it ties that behavior back to a known person once you have a stable identifier (email, customer ID, etc.). Retention teams feel the impact when anonymous sessions (browse, PDP views, add-to-cart) don’t merge cleanly after login or checkout—your cart recovery ends up incomplete or mis-targeted.

  • Anonymous activity starts first: the SDK can track events before a user logs in. That’s how you capture product discovery and cart building in-session.
  • Identify is the stitch point: once you call identify with your canonical user ID (and usually email), Customer.io can associate future events—and often prior anonymous activity—with that person.
  • Events become segmentation fuel: every track call (e.g., Product Viewed, Added to Cart, Checkout Started, Order Completed) becomes something you can filter on inside segments and use as triggers/conditions inside Journeys.
  • Device context matters for channel reach: SDKs typically manage device tokens/permissions for push and in-app. If device registration is flaky, your “push-first cart recovery” will underdeliver even when the journey logic is perfect.

Real D2C scenario: a shopper opens your app from a paid ad, views two PDPs, adds a bundle to cart, then closes the app. Later they come back, log in, and complete checkout. If you don’t track the pre-login cart events and then stitch them at login, your cart abandonment journey can misfire (or worse—send a “you left something behind” message after they purchased).

Step-by-Step Setup

Before you touch Journeys, get the app-side fundamentals right. In most retention programs we’ve seen, teams rush to build flows and only later realize the SDK is creating duplicate people or dropping key events—then you’re rebuilding segmentation and suppression logic under pressure.

  1. Install the correct Customer.io SDK for your app stack.
    Pick the native SDK (iOS/Android) or your framework SDK (React Native/Flutter/Expo). Confirm you’re on a current version so identity and device handling behave as expected.
  2. Initialize the SDK as early as possible in app startup.
    This ensures you capture first-session discovery events and attribution context. Late initialization is a common reason “first open → browse → cart” events never show up.
  3. Define your canonical identifier strategy.
    Decide what goes into identify:
    • Use a stable internal customer_id as the primary ID whenever possible.
    • Attach email as an attribute (and update it if it changes).
    • Avoid using volatile identifiers (like device ID) as the person ID.
  4. Call identify at the right moment (and only when you’re sure).
    Best practice for D2C apps: call it on login, account creation, or when you have a verified email at checkout. Don’t identify on an email field blur—typos create junk profiles that pollute segments.
  5. Track a tight retention event taxonomy.
    Start with events you’ll actually orchestrate against:
    • Product Viewed (include product_id, category, price)
    • Added to Cart (include cart_id, line items, value)
    • Checkout Started (include cart_id, value)
    • Order Completed (include order_id, value, items, discount)
    Keep naming consistent across platforms—iOS and Android sending different event names is a silent segmentation killer.
  6. Send device and permission state as attributes.
    At minimum: push token registered, push permission status, app version, and platform. You’ll use these attributes to route channel strategy (push vs email) and avoid sending “enable push” nags to people who already opted in.
  7. Validate in Customer.io before building journeys.
    Use a test device and confirm: person profile updates after identify, events appear in activity logs, and anonymous events are stitched to the known profile after login.

When Should You Use This Feature

The SDK matters most when the behavior you want to react to happens inside the app (or across app + web) and you need reliable identity stitching. If your retention program depends on “what someone did in the last hour” rather than “what they bought last month,” SDK tracking is usually the backbone.

  • Cart recovery with real-time triggers: trigger on Added to Cart or Checkout Started, then suppress if Order Completed arrives within a short window.
  • Repeat purchase timing: use Order Completed plus item-level properties to time replenishment or cross-sell (e.g., 21 days after a 30-day supply ships).
  • Browse-based reactivation: if someone repeatedly views a category but never purchases, you can build “interest segments” that don’t rely on email clicks as the signal.
  • Push-first orchestration: when you want to lead with push/in-app and fall back to email only if the device isn’t reachable.

Operational Considerations

SDK tracking isn’t just “engineering setup”—it changes how you segment, suppress, and sequence messages. In practice, this tends to break when multiple IDs exist for the same human or when events arrive out of order (common on mobile with flaky connectivity).

  • Segmentation depends on event consistency: if Added to Cart sometimes sends without cart_id or without line items, your cart segments will be leaky and your dynamic content will fail.
  • Identity stitching rules your suppression logic: cart recovery needs a single customer timeline. If anonymous carts don’t merge after login, you’ll message the wrong “person” or miss the right one.
  • Data flow latency can cause false positives: mobile events may batch and arrive late. Build short guardrails like “wait 30–60 minutes” before sending, and always add an exit condition on Order Completed.
  • Cross-platform parity is non-negotiable: if web tracks Checkout Started but app doesn’t, you’ll create channel bias in your segments and misread funnel drop-off.
  • Orchestration needs channel reach attributes: keep push token + permission status up to date so Journeys can branch cleanly (push if reachable, email if not).

Implementation Checklist

If you want the SDK to reliably power retention journeys, treat this like a launch checklist—not a “we’ll clean it up later” task. Getting this right upfront saves weeks of debugging segments and duplicate profiles.

  • SDK installed and initialized at app start (iOS/Android/framework)
  • Canonical person ID defined (stable customer_id)
  • identify called only after login/account creation/verified checkout
  • Core retention events implemented with consistent names and required properties
  • Order Completed includes order_id and total value (plus line items if possible)
  • Push token + permission state captured as person attributes
  • Test plan executed: anonymous browse → login → purchase, and verify stitching
  • Basic suppression/exit logic planned (purchase exits cart recovery)

Expert Implementation Tips

These are the operator moves that keep your retention program stable as volume grows and the app evolves.

  • Use “event contracts” with engineering: write down required properties per event (e.g., cart_id, value, currency). Treat missing properties as a bug, not a nice-to-have.
  • Prefer internal IDs over emails for identity: emails change; customer IDs don’t. Keep email as an attribute you update.
  • Add idempotency where possible: for purchase events, include a unique order_id so you can detect duplicates and avoid double-triggering post-purchase flows.
  • Design for offline/mobile batching: add a short delay before cart abandonment sends, and always re-check purchase state with an exit condition.
  • Track “Viewed Category” sparingly: it’s tempting to log everything, but noisy events make segments expensive to reason about. Focus on the few signals you’ll actually use to route messaging.

Common Mistakes to Avoid

Most retention issues blamed on “Customer.io deliverability” or “journey bugs” are really SDK identity or event hygiene problems upstream.

  • Identifying too early: capturing an unverified email at checkout and calling identify creates bad profiles and wrecks segmentation.
  • Different event names on iOS vs Android: you’ll end up building duplicate segments and missing half your audience.
  • Missing purchase suppression: cart recovery without an Order Completed exit condition will inevitably message buyers.
  • Not passing item-level properties: without line items, you can’t personalize recovery (and you can’t exclude items that are out of stock).
  • Letting duplicate people accumulate: if you don’t have a clear ID strategy, you’ll see multiple profiles per human and your frequency caps won’t work.

Summary

If you want Customer.io to drive cart recovery, repeat purchase, and reactivation from in-app behavior, the SDK is the foundation. Get identify timing right, keep event naming consistent, and treat stitching as a first-class requirement.

Once the data is clean, Journeys become straightforward—and your suppression logic actually holds under real-world edge cases.

Implement How It Works with Propel

If you’re already on Customer.io, the fastest path is usually: confirm identity strategy, lock the event contract, then build 2–3 high-leverage journeys (cart recovery, post-purchase cross-sell, and winback) on top of validated tracking. That sequencing prevents the common “beautiful journey, bad data” trap.

If you want help auditing your SDK events and stitching (especially across app + web) and translating that into reliable retention orchestration, book a strategy call.

Contact us

Get in touch

Our friendly team is always here to chat.

Here’s what we’ll dig into:

Where your lifecycle flows are underperforming and the revenue you’re missing

How AI-driven personalisation can move the needle on retention and LTV

Quick wins your team can action this quarter

Whether Propel AI is the right fit for your brand, stage, and stack