Track Events with the Customer.io SDK (Mobile/Web) 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 want Customer.io to actually drive repeat purchase and recovery flows (not just send messages), your SDK event tracking needs to be clean, consistent, and stitched across anonymous-to-known users. If you want a second set of eyes on your tracking plan before you ship it, book a strategy call—most retention issues we see start as “small” identity or schema decisions that snowball later.

In practice, “Track events” is the foundation for every retention automation you care about: cart abandonment, browse abandonment, replenishment, winback, VIP perks, and post-purchase cross-sell. The SDK is where you earn accuracy—because you control when events fire, what payload they include, and how you connect sessions to a real customer.

How It Works

On the app side (mobile or web), you instrument key customer actions as events and send them to Customer.io through the SDK. Customer.io stores those events on the person profile (or an anonymous profile), and you use them to trigger campaigns, build segments, and personalize messages.

  • Identify vs track: you identify when you know who the user is (login, account created, email captured). You track whenever something meaningful happens (product viewed, added to cart, checkout started, purchased).
  • Anonymous → known stitching: you typically start tracking on an anonymous profile (device/browser session). When the user later logs in or submits email/SMS, you call identify and merge that anonymous activity into the known person so your abandonment and discovery flows don’t “reset.”
  • Event payloads drive segmentation: the event name gets you into a workflow; the properties (SKU, category, price, cart_value, quantity, currency) let you branch logic, suppress irrelevant messages, and personalize content.
  • Timing matters: SDK calls happen in real time. That’s what makes a 30–60 minute cart recovery push or email possible without waiting on nightly ETL.

Real D2C scenario: a shopper views two moisturizers, adds one to cart, then bounces. If your SDK sends Product Viewed and Added to Cart with the right product metadata—and you identify the user when they enter email at checkout—you can trigger a cart recovery series that includes the exact item, the right price, and a fallback recommendation if it sells out.

Step-by-Step Setup

The goal here isn’t “send more events.” It’s to send the minimum set of high-signal events with consistent naming and identity handling, so your retention automations don’t leak users or misfire.

  1. Install the Customer.io SDK in your app (or web app).
    Follow the platform-specific SDK install steps (iOS/Android/React Native/etc.). Confirm the SDK initializes on app launch and can reach Customer.io in your environments (dev/stage/prod).
  2. Define your retention event schema before you code.
    Lock a small set of canonical event names (e.g., Product Viewed, Added to Cart, Checkout Started, Order Completed). Decide required properties for each event (SKU, product_id, variant_id, category, price, currency, quantity, cart_value).
  3. Implement anonymous tracking immediately.
    Start tracking events as soon as the session begins—even before login. This is what powers browse/cart recovery for users who only identify later.
  4. Call identify as soon as you have a stable identifier.
    Use the earliest reliable moment: account creation, login, or email/SMS capture. Pass your internal customer ID if you have it; otherwise use email as the primary identifier (but be consistent).
  5. Stitch anonymous activity to the known profile.
    Make sure your implementation merges the anonymous profile into the identified person (platform SDKs support this pattern). This is where most retention programs quietly break—events exist, but they’re attached to the wrong profile.
  6. Track the core commerce events with full payloads.
    Instrument Added to Cart and Checkout Started with cart line items if possible. Track Order Completed with order_id, total, items, discount, and shipping—this drives post-purchase branching and LTV segmentation.
  7. Validate in Customer.io Activity Logs.
    Use a test device and a test account. Confirm: (a) events arrive, (b) properties look right, (c) anonymous events appear before identify, and (d) after identify, historical activity is visible on the known profile.
  8. Only then build triggers/segments off the events.
    Create segments like “Added to Cart in last 2 hours AND no Order Completed” or “Viewed Product 3+ times in 7 days AND never purchased.” Build campaigns once you trust the data.

When Should You Use This Feature

SDK event tracking is worth the effort when you need behavioral precision and fast reaction time. If you’re relying on batch order imports alone, you’ll always be late to cart recovery and you’ll struggle to personalize discovery.

  • Cart recovery: trigger within 30–90 minutes of Checkout Started or Added to Cart, suppress if Order Completed fires, and personalize with the cart items.
  • Browse abandonment / product discovery: use Product Viewed and category affinity to send “still thinking about…” or “here are alternatives” messages that don’t feel random.
  • Repeat purchase and replenishment: use Order Completed items + timestamps to estimate replenishment windows (e.g., 21/30/45 days) and trigger reminders only for relevant SKUs.
  • Reactivation: define inactivity based on absence of key events (no app_open, no product_view, no purchase) and tailor winbacks based on last category viewed or last purchased collection.

Operational Considerations

Most teams get the SDK “working” and still miss retention targets because the data doesn’t hold up under real segmentation and orchestration. The difference is usually in identity rules, event hygiene, and how you handle edge cases.

  • Segmentation depends on consistency: if one platform sends added_to_cart and another sends Added to Cart, you’ll fragment audiences and undercount intent. Pick one naming convention and enforce it.
  • Identity stitching is the silent killer: if a user browses anonymously, then identifies later, your recovery flow should still see the cart/browse events. Audit this monthly—SDK changes and auth refactors often break merges.
  • Event volume vs signal: don’t pipe every UI interaction. In most retention programs, we’ve seen better results with fewer events that map directly to lifecycle decisions (view, cart, checkout, purchase, subscription actions).
  • Orchestration reality: cart recovery needs suppression logic across channels. That means your Order Completed event must arrive quickly and reliably, or you’ll send “complete your order” after they already paid.
  • Data flow ownership: decide who owns the schema (growth/retention) and who ships it (engineering). Without a single owner, events drift and segments rot.

Implementation Checklist

If you want this to translate into revenue, treat this like a production system—not a one-off integration. This checklist is what we use to keep tracking stable while campaigns evolve.

  • SDK installed and initializing correctly in all environments
  • Canonical event names agreed and documented
  • Required properties defined per event (SKU/product_id/variant_id/price/currency/category)
  • Anonymous tracking enabled before login/email capture
  • identify called at the earliest stable identity moment
  • Anonymous activity successfully merged into known profiles
  • Order Completed event includes order_id + full order payload
  • Validation done in Customer.io Activity Logs for both anonymous and identified flows
  • Suppression logic designed (purchase cancels cart/browse flows)
  • Event naming and payload parity confirmed across iOS/Android/web

Expert Implementation Tips

These are the practical details that usually separate “events are coming in” from “retention automations are reliable and profitable.”

  • Track intent at the right granularity: for browse, track Product Viewed and Collection Viewed—not every scroll. Then add a property like source (search, recommendation, paid landing) so you can tailor follow-ups.
  • Use stable IDs, not names: product titles change. Your payload should include immutable IDs (product_id, variant_id, sku) and optionally the current display name for personalization.
  • Design for suppression first: build your event plan so every “nag” message has a clean exit (purchase, subscription started, cart emptied). If you can’t suppress confidently, you’ll burn trust fast.
  • Make duplicate events harmless: mobile apps retry network calls. Include idempotency keys where possible (order_id for purchases, cart_id for cart events) so downstream logic can dedupe.
  • Instrument login/logout explicitly: if shared devices are a thing (tablets, family phones), you need clean identity transitions or you’ll message the wrong person.

Common Mistakes to Avoid

Most retention “bugs” aren’t campaign issues—they’re tracking issues that show up as weird audience sizes, mis-timed messages, or personalization that feels wrong.

  • Identifying too late: waiting until purchase confirmation to identify means you lose the highest-value recovery window (cart/checkout).
  • Not merging anonymous activity: you’ll see lots of anonymous carts and no way to recover them once the user identifies later.
  • Inconsistent event naming across platforms: segments miss users, and you end up duplicating workflows per platform.
  • Sending “purchase” from the client only: client-side purchase events can fail (app closes, network drops). In practice, this tends to break suppression and causes post-purchase spam. If possible, backstop purchases with a server-side source of truth.
  • Missing currency/price normalization: if price is sometimes a string, sometimes a number, your segmentation and reporting get messy fast.
  • Tracking PII in event properties: keep emails/phone numbers in identity fields, not sprinkled into event payloads.

Summary

If you want Customer.io to perform like a retention engine, your SDK tracking has to be identity-safe, consistent, and built around a small set of high-signal commerce events.

Get anonymous tracking + identify/merge right first, then build cart recovery, repeat purchase, and winback flows on top of data you actually trust.

Implement Track Events with Propel

Once the SDK is wired up, the real work is making sure your event schema and identity stitching hold up under real-world edge cases—guest checkout, app reinstalls, shared devices, and multi-channel suppression. If you’re implementing or cleaning up Customer.io tracking and want an operator-grade plan (events, payloads, identity rules, and QA), start with Customer.io context and book a strategy call to pressure-test what you’re about to ship.

That usually saves weeks of “why is this segment empty?” and prevents the classic mistake: building beautiful recovery flows on top of unreliable data.

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