Track events with the Customer.io SDK (for retention that actually works)

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 drive repeat purchase and recovery flows, the SDK event layer has to be clean—otherwise you’ll end up “optimizing” campaigns that are targeting the wrong people. If you want a second set of eyes on your tracking plan before you ship it, book a strategy call and we’ll pressure-test identity stitching, event naming, and what you actually need for retention.

In D2C, event tracking isn’t about collecting everything. It’s about capturing a small set of high-intent behaviors (viewed product, added to cart, started checkout, purchased) with consistent IDs so Customer.io can segment accurately and trigger the right message at the right time.

How It Works

On the SDK side, you’re doing three jobs: initializing the SDK, identifying the person behind the device/session, and sending events with enough context to be useful in segmentation and message personalization.

  • Install + initialize the SDK in your app (iOS/Android/React Native/etc.) or web client. This establishes the device/session context Customer.io uses for delivery (especially push) and attribution.
  • Identify the user as soon as you have a stable identifier (email, customer ID, or your internal user ID). This is where most retention programs win or lose—if identify happens late, your “anonymous” cart activity won’t attach to the eventual customer profile.
  • Track events for behaviors you want to trigger off of or segment by. Events should include a small payload (SKU, product name, category, cart value, currency, etc.) so your recovery and upsell messages can be specific without needing extra lookups.
  • Stitch anonymous to known by using a consistent identifier strategy. In practice, this tends to break when teams track events anonymously, then create a new profile at login/checkout instead of merging activity into the same person.

Real D2C scenario: a shopper browses in your app, adds a moisturizer to cart, then bounces. If your SDK tracked Product Viewed and Added to Cart anonymously, and you call identify() when they later enter email at checkout (or login), Customer.io can stitch that earlier intent onto the known profile—so your cart recovery push/email isn’t missing half your abandoners.

Step-by-Step Setup

The fastest path is to implement the SDK, then immediately lock down identity rules and an event taxonomy before your team starts building automations. You’re aiming for “boring and consistent,” not clever.

  1. Pick your primary person identifier.
    Use one stable ID across platforms (ideally your internal customer/user ID). If you rely on email, be disciplined about updates (people change emails; IDs don’t).
  2. Install the appropriate Customer.io SDK(s).
    Implement the SDK for your app platform (iOS/Android/React Native/Flutter/Expo) and/or web. Initialize it as early as possible in app start so session/device context is reliable.
  3. Implement identify() at the earliest “known” moment.
    Common triggers: account creation, login, email capture, or the first step of checkout where you have a verified identifier. Don’t wait until purchase confirmation if you want cart recovery to work.
  4. Send a minimal retention event set.
    Start with 6–10 events you’ll actually use. Typical D2C baseline:
    • Product Viewed (include product_id, name, category, price)
    • Collection Viewed (include collection)
    • Added to Cart (include cart_id, product_id, quantity, cart_value)
    • Checkout Started (include cart_id, cart_value, shipping_country)
    • Purchased (include order_id, revenue, currency, items)
    • Subscribed/Opted In (if you’re capturing SMS/push permissions in-app)
  5. Standardize naming and payloads.
    Use consistent casing and field names across platforms (web vs app). If iOS sends productId and Android sends product_id, segmentation and Liquid personalization get messy fast.
  6. Validate in Customer.io activity logs.
    Before building automations, confirm: events arrive, properties show up as expected, and the same person profile contains both pre-login and post-login activity (identity stitching).
  7. Only then build triggers/segments.
    Once the data is stable, wire journeys off the events. Otherwise you’ll constantly “fix the campaign” when the real issue is tracking.

When Should You Use This Feature

SDK event tracking is the right move when you need behavioral signals that your ecommerce platform doesn’t reliably provide—especially in mobile apps where “cart” and “browse” behavior often never hits your backend.

  • Cart recovery in-app + cross-channel.
    Trigger a push 30–60 minutes after Checkout Started without Purchased, then follow with email/SMS if the user stays inactive.
  • Product discovery → conversion loops.
    If someone views the same PDP twice in 48 hours but doesn’t add to cart, route them into a “help me choose” message with reviews, UGC, or a comparison chart.
  • Repeat purchase timing based on real usage signals.
    For consumables, track Purchased plus the item type/size and use that to estimate replenishment windows (e.g., 21–35 days) instead of blasting everyone at day 30.
  • Reactivation based on app inactivity + intent.
    Combine “last seen in app” with historical category interest to send a reactivation offer that’s relevant (not generic “we miss you”).

Operational Considerations

Most retention issues aren’t campaign strategy problems—they’re data flow and orchestration problems. Treat event tracking like production infrastructure, because every journey you build sits on top of it.

  • Segmentation depends on property hygiene.
    If you want segments like “Added to cart (category = skincare) in last 4 hours,” you need consistent category values and a predictable event schema.
  • Identity stitching is the difference between 30% and 70% recoverable abandoners.
    Call identify() early, and don’t create multiple profiles for the same person across devices. In most retention programs, we’ve seen duplicate profiles quietly kill performance because frequency caps and exclusions stop working.
  • Event deduplication matters for revenue attribution.
    If your app retries network calls, you can easily send duplicate Purchased events. Use stable IDs like order_id and implement dedupe logic where possible.
  • Orchestration across channels needs a single source of truth.
    If web sends Added to Cart but app sends Cart Updated, you’ll build parallel automations and they’ll collide. Align taxonomy before scaling.
  • Privacy/consent gates aren’t optional.
    Make sure your SDK tracking respects ATT/consent requirements and your internal policies—especially for push tokens and advertising identifiers.

Implementation Checklist

If you want this to hold up once you’re running multiple recovery and upsell journeys, lock in the basics below before you call it “done.”

  • Primary identifier chosen (internal user/customer ID preferred) and documented
  • identify() implemented at login/email capture (not only post-purchase)
  • Event taxonomy finalized (names, required properties, allowed values)
  • Baseline retention events implemented: viewed product, added to cart, checkout started, purchased
  • Purchase event includes order_id, revenue, currency, and line items (as applicable)
  • Anonymous-to-known stitching validated on a real device (not just in unit tests)
  • Duplicates checked (especially purchase/checkout events)
  • Customer.io activity logs reviewed for 5–10 real sessions end-to-end
  • Segments built only after properties are stable and consistent

Expert Implementation Tips

These are the operator moves that keep your retention program from degrading as volume and complexity ramp up.

  • Track “intent strength,” not just actions.
    Send properties like view_count or track repeated views as a separate event (e.g., Product Revisited) so you can prioritize higher-intent shoppers in recovery.
  • Make cart events deterministic.
    Always include a cart_id and keep it stable through the session. It makes exclusions and “resume checkout” deep links far easier.
  • Use a single canonical product ID across systems.
    If marketing uses Shopify variant IDs but the app uses an internal SKU, your personalization will drift. Pick one and map everything to it.
  • Instrument “permission moments.”
    If you ask for push permissions after add-to-cart (common in D2C apps), track that prompt and the response. It helps you understand why push underperforms and who to shift to email/SMS.

Common Mistakes to Avoid

These show up constantly when teams move fast and then wonder why journeys feel leaky.

  • Identifying too late.
    If you only identify after purchase, most cart recovery and browse abandonment will never attach to a profile you can message.
  • Inconsistent event names across platforms.
    “Added To Cart” vs “AddToCart” becomes two segments, two triggers, and twice the maintenance.
  • Missing required properties.
    A cart recovery email without item name/image/price is basically a generic promo. If you want specificity, you need those fields in the event payload.
  • Duplicate purchase events.
    This inflates revenue, breaks post-purchase suppression, and can trigger “thank you” flows multiple times.
  • No clear ownership.
    If nobody owns the tracking plan, it slowly drifts as engineers add one-off events for random requests.

Summary

If you’re serious about cart recovery, repeat purchase, and reactivation in Customer.io, SDK event tracking is the foundation. Get identity stitching right, keep your event taxonomy tight, and validate data quality before you scale journeys.

Implement Track Events with Propel

When teams ask why retention automations underperform, the answer is usually in the first week of implementation: late identify() calls, inconsistent payloads, and events that don’t match how you actually segment. If you’re building on Customer.io and want an operator-led tracking plan that maps cleanly to recovery and repeat-purchase journeys, book a strategy call—we’ll help you ship an event layer that stays reliable as you add channels and complexity.

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