Get started with the Customer.io SDK (for retention teams who need clean data)

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 your retention program lives or dies on cart recovery, repeat purchase, and reactivation, your tracking layer matters more than your subject lines. Customer.io works best when your app and site reliably send identity + events in the same way every time—so your segments don’t drift and your automations don’t misfire. If you want a second set of eyes on your tracking plan before you wire it into production, book a strategy call and we’ll pressure-test it like an operator would.

At a high level, SDK setup is about three things: (1) installing the SDK, (2) identifying the person at the right moment, and (3) tracking the events that actually drive retention decisions—add to cart, checkout started, purchase, subscription pause, etc. The “getting started” docs cover the platform steps; this guide translates that into what you should implement app-side so your retention workflows aren’t built on shaky data.

How It Works

In practice, Customer.io becomes your retention brain only after your app/web client consistently sends two streams of data: people updates (attributes) and behavioral events. The SDK is the cleanest way to do this on mobile (and often on web), because it can also manage device context and help you avoid common identity gaps.

  • Install the SDK and initialize it early so sessions and events don’t get dropped on cold starts or deep links.
  • Track anonymous behavior first (product views, add-to-cart) and then identify the user when you actually know who they are (login, account creation, email capture, checkout).
  • Identity stitching happens when you connect pre-login activity to a known profile. This is the difference between “cart abandonment works” and “cart abandonment misses half our carts.”
  • Send events with the right properties (SKU, category, price, cart value, currency, order_id). Those properties become the levers you’ll use in segmentation and message personalization.

A realistic D2C scenario: someone browses in your app, adds a product to cart, gets distracted, then logs in later. If you only start tracking after login, you’ll never trigger a cart recovery flow for that first cart. If you track anonymously and then identify at login, you can stitch the session and still recover the revenue.

Step-by-Step Setup

The goal here isn’t “send some data to Customer.io.” The goal is “make sure every retention-critical action is trackable, attributable to a person, and consistent across platforms.” Set this up once, and your cart recovery + repeat purchase programs stop breaking every time the app team ships UI changes.

  1. Create your workspace and confirm channel basics
    Even though this is an SDK guide, you want your workspace ready so you can validate events immediately in Activity Logs and build segments off real data.
  2. Choose your SDK surface area (mobile, web, or both)
    If you have a mobile app, start there—push + in-app + device identity tends to drive the biggest retention lift. If you also have web checkout, plan for consistent event names across app and web.
  3. Install the Customer.io SDK in your app
    Initialize it on app launch. Most retention programs we’ve seen lose 5–15% of events simply because initialization happens too late (after routing, after auth checks, etc.).
  4. Define your identity rules before writing code
    Pick the canonical identifier (usually your internal user_id). Decide when you’ll call identify (login, signup, email capture, checkout). Decide what you’ll do on logout (typically reset/clear the identified user so the next person on that device doesn’t inherit the wrong profile).
  5. Implement identify and attribute updates
    Send stable attributes that matter for retention segmentation: email, phone (if you use SMS), country, timezone, first_order_date, last_order_date, lifetime_value (if you compute it), subscription_status, preferred_category.
  6. Track retention-critical events with properties
    At minimum for D2C: Product Viewed, Added to Cart, Checkout Started, Order Completed, Subscription Started, Subscription Canceled. Include properties like sku, product_id, variant, price, currency, quantity, cart_value, order_id.
  7. Validate in Customer.io before you build automations
    Use Activity Logs to confirm: events arrive, properties are populated, and the person profile shows the correct identifiers. Don’t build your cart flow until you’ve confirmed the “anonymous → identify → stitched cart event” path works.
  8. Only then build segments and orchestration
    Once the data is clean, you can safely create segments like “Added to Cart in last 2 hours AND no Order Completed” without constant false positives/negatives.

When Should You Use This Feature

SDK work is worth it when you need accuracy and identity stitching—not when you’re just sending a newsletter. If you’re serious about retention, SDK tracking is usually the foundation that makes every other program measurable and scalable.

  • Cart recovery that actually catches app carts: trigger off Added to Cart and suppress on Order Completed, with cart value-driven branching.
  • Repeat purchase orchestration: send replenishment nudges based on Order Completed + SKU/category (e.g., “30 days after protein powder purchase”).
  • Reactivation with real behavioral context: target “Viewed product in last 7 days but no purchase in 60 days” instead of generic “inactive users.”
  • Cross-device continuity: stitch mobile browsing to web checkout (or vice versa) so you don’t double-message or miss the conversion.

Operational Considerations

Most tracking plans look fine on paper and then break in production because of identity edge cases, naming drift, or mismatched data between app and backend. You’ll save yourself weeks if you operationalize the data flow upfront.

  • Segmentation depends on event consistency: pick one event taxonomy and enforce it. “AddToCart” vs “Added to Cart” becomes a silent segment-killer.
  • Decide what is SDK-sourced vs server-sourced: purchases are often better confirmed server-side to avoid false “Order Completed” events from failed payments. If you do both, dedupe with order_id.
  • Identity stitching is a retention multiplier: make sure anonymous events are captured and then merged when the user identifies. In practice, this tends to break when login happens in a webview, or when identify is called with email sometimes and user_id other times.
  • Orchestration realities: suppression logic (e.g., “don’t send cart recovery if they purchased”) only works if events arrive in the right order and quickly enough. If your purchase event is delayed, you’ll spam converters.
  • Device management: ensure push tokens are associated to the right person and cleared on logout. Shared devices can quietly inflate complaints and unsubscribes.

Implementation Checklist

Before you call the SDK “done,” you want proof that it supports real retention workflows end-to-end. This checklist is what we use to decide whether a team is ready to scale automations without constant debugging.

  • SDK initializes on app start (cold start + warm start tested)
  • Anonymous browsing events fire (Product Viewed, Added to Cart)
  • identify fires on login/signup/checkout with a canonical ID
  • Anonymous activity stitches to the identified profile
  • Key attributes populate correctly (email/phone/timezone/country)
  • Purchase tracking is reliable (server-confirmed or deduped by order_id)
  • Event properties include SKU/category/price/cart_value/currency
  • Logout clears identity and prevents cross-user contamination
  • Segments built off events match expected counts in QA

Expert Implementation Tips

Once the basics are in, the wins come from small decisions that keep your data clean as the product evolves. These are the details that make cart recovery and post-purchase flows feel “smart” instead of spammy.

  • Standardize event names across app and web even if different teams own them. Your journeys should not care where the event came from.
  • Always include a stable dedupe key on conversion events (like order_id). Without it, retries and multi-device behavior will inflate revenue attribution and break suppression.
  • Track “Checkout Started” separately from “Added to Cart”. They behave differently operationally: checkout starters convert at a higher rate, so you can be more aggressive with timing and incentives.
  • Send category/collection metadata on product events. It unlocks retention programs like “replenish,” “cross-sell,” and “browse abandonment by category” without rebuilding your tracking later.
  • QA with real edge cases: interrupted checkout, payment failure, login after add-to-cart, account creation after browse, app reinstall. These are exactly where identity stitching usually fails.

Common Mistakes to Avoid

Most teams don’t fail because they didn’t track events—they fail because the tracking is inconsistent, ambiguous, or not tied to the right person. These are the mistakes that create phantom segments and unreliable revenue numbers.

  • Calling identify with different IDs over time (email sometimes, user_id other times), which creates duplicates and splits lifetime value across profiles.
  • Only tracking after login, which kills browse/cart abandonment coverage and makes your flows look “fine” while missing a big chunk of revenue.
  • Tracking purchases client-side only, leading to false conversions from failed payments or cancelled orders.
  • Missing event properties (no SKU, no cart value), which forces generic messaging and prevents value-based branching.
  • Not clearing identity on logout, which can result in one user receiving another user’s cart or reorder nudges—an avoidable trust breaker.

Summary

If you want retention automations you can trust, start with SDK tracking that’s consistent, stitched, and conversion-safe. Nail identity + events first, then build segments and journeys on top. If you’re seeing gaps in cart recovery or weird segment counts, it’s usually an SDK/identity issue—not a messaging issue.

Implement 2.x with Propel

If you’re implementing the Customer.io SDK as the backbone for cart recovery, repeat purchase, and reactivation, the fastest path is usually aligning the identity model and event taxonomy before engineering writes the final version. We’ll map your retention use cases to a tracking spec that holds up under real-world edge cases, then validate it inside Customer.io with the segments and suppression logic you actually need. If that would help, book a strategy call and we’ll walk through your current data flow and where it’s likely to break.

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