Summarize this documentation using AI
Overview
If you’re implementing Customer.io for retention, the SDK work is where most programs either get leverage or get stuck. If you want a second set of eyes on your event plan and identity stitching before you ship it, book a strategy call—it’s usually faster than debugging a month of “why didn’t this person enter the flow?” later.
In practice, the difference between “we have data in Customer.io” and “we can reliably recover carts and drive repeat purchase” comes down to three things: installing the SDK cleanly, calling identify at the right moments, and tracking a small set of high-signal events with consistent properties.
How It Works
Customer.io’s SDKs sit in your app (mobile or web) and send two kinds of data: who the user is (profile + identifiers) and what they do (events). Retention automation depends on both—events trigger workflows, and identity stitching makes sure the right messages go to the right person across devices and sessions.
- Install the SDK so the app can send data to your Customer.io workspace. This is the plumbing: if it’s unstable, everything downstream (segments, triggers, reporting) gets noisy.
- Identify users as soon as you have a durable identifier (email, phone, internal user_id). This moves the user from “anonymous activity” to a known profile that can be messaged and segmented.
- Track events with properties that map to retention decisions (cart value, items, category, purchase count, last product viewed). Events without properties force you into blunt campaigns; events with clean properties let you build precise recovery and repeat purchase logic.
- Handle anonymous-to-known stitching by ensuring the same device/session activity gets merged into the identified profile after login/signup. In most retention programs, this is the hidden reason cart recovery underperforms: the cart event happened anonymously, but the follow-up flow targets identified users.
Real D2C scenario: a shopper browses on mobile, adds a product to cart, then creates an account at checkout. If you track Added to Cart anonymously but only call identify after purchase (or not at all), you’ll miss the highest-intent recovery window. If you identify at account creation and stitch the anonymous cart activity, you can trigger a push/SMS/email reminder within minutes with the exact item and price.
Step-by-Step Setup
Before you write code, align on the minimum event schema that actually powers retention. Shipping 50 events that nobody uses is how teams end up with brittle segments and slow iteration.
- Create your Customer.io workspace and grab credentials (site ID / API key equivalents depending on SDK). Keep these environment-specific (dev/stage/prod) so you don’t pollute production reporting.
- Install the appropriate Customer.io SDK for your platform (iOS/Android/React Native/Flutter/Web). Do this first in a sandbox build and validate network calls before you wire up business logic.
- Initialize the SDK at app start so you capture early-session events (product views, category browsing). If initialization happens late, you’ll systematically miss discovery behavior that feeds recommendation and replenishment logic.
- Implement
identify()at the right moments:- Account creation
- Login
- Email/phone capture (even pre-checkout, if you support it)
email,phone,timezone,marketing_opt_in, andpreferred_channelif you have it. - Track a tight set of retention-critical events with consistent naming and properties. A practical baseline for D2C:
Product Viewed(product_id, name, category, price)Added to Cart(cart_id, product_ids, quantities, value, currency)Checkout Started(cart_id, value, items_count)Order Completed(order_id, value, currency, items, discount_code, is_first_order)
- Verify data in Customer.io by checking a real test profile and confirming:
- Events appear with the expected properties
- The profile is identified (not anonymous) after login/signup
- Anonymous activity merges into the known profile after identify
- Build one “proof” segment and one “proof” trigger before expanding. Example: a segment for “Added to Cart in last 2 hours AND no Order Completed” and a workflow triggered by
Added to Cartwith a 30–60 minute delay.
When Should You Use This Feature
SDK tracking is the right move when your retention program depends on real-time, in-app behavior—not just order history. If you’re serious about cart recovery, browse retargeting, and post-purchase personalization, server-only data usually won’t cut it.
- Cart recovery that doesn’t guess: trigger off
Added to CartandCheckout Startedwith item-level details, then suppress instantly onOrder Completed. - Repeat purchase and replenishment: use
Order Completedplus product metadata to time replenishment reminders and cross-sells (e.g., “bought cleanser” → “send moisturizer education 10 days later”). - Reactivation based on real disengagement: define inactivity using a mix of app events (
App Opened,Product Viewed) and purchase behavior, not just “last email click.” - Channel coordination: when push/in-app is part of the mix, SDK identity + device management is what keeps your orchestration clean.
Operational Considerations
Most teams don’t fail on sending messages—they fail on data consistency and orchestration edge cases. Treat the SDK as production infrastructure, not a one-time integration.
- Segmentation depends on property hygiene: if
categoryis sometimes “Skin Care” and sometimes “skincare”, your segments will quietly undercount. Normalize values at the source. - Identity stitching is a retention multiplier: decide your primary key (internal user_id vs email) and stick to it. If you switch identifiers midstream, you’ll create duplicates and suppressions won’t behave predictably.
- Event timing matters for orchestration: cart recovery breaks when
Order Completedarrives late or from a different pipeline than the cart events. Align client + server events so suppression is reliable within minutes, not hours. - Anonymous behavior strategy: if a meaningful share of shoppers browse without logging in, plan for anonymous events and merging. Otherwise, you’ll only automate for your already-logged-in customers—which is rarely where the biggest lift is.
- Cross-device reality: app + web users will generate parallel activity. Make sure both environments identify into the same profile so you don’t message them twice or miss the conversion event that should stop the flow.
Implementation Checklist
If you want this to drive revenue quickly, ship the smallest reliable tracking surface area first, then expand. The checklist below keeps you out of the “we track everything but can’t target anything” trap.
- SDK installed and initialized on app start (prod + staging separated)
identify()implemented on signup, login, and email/phone capture- Primary identifier chosen and consistent across platforms
- Baseline events shipped: Product Viewed, Added to Cart, Checkout Started, Order Completed
- Event properties standardized (currency, value, product_id, category)
- Anonymous-to-known merge validated with a real test journey
- One cart recovery workflow built with suppression on purchase
- One repeat purchase workflow built off product/category or purchase count
Expert Implementation Tips
Once the basics are in, small operator moves make the data dramatically more usable for retention. These are the things we’ve seen reduce segment drift and campaign misfires over time.
- Design events around decisions, not screens. “Viewed PDP” is fine, but “Product Viewed” with product metadata is what powers cross-sell and browse abandon.
- Prefer stable IDs over names. Send
product_idand optionallyproduct_name. Names change; IDs shouldn’t. - Include a cart/order identifier so you can dedupe and debug. When a customer adds items across multiple sessions, cart_id is how you avoid sending irrelevant reminders.
- Set opt-in attributes at identify-time (SMS consent, push permission). Then gate messaging in Customer.io with a simple rule instead of hardcoding channel logic everywhere.
- Instrument one “debug” attribute like
tracking_versionso you can segment “users on v3 tracking” when you roll changes out gradually.
Common Mistakes to Avoid
These are the failure modes that show up after launch—usually when cart recovery looks weak or customers complain about irrelevant messages.
- Calling identify too late (post-purchase only). You lose the highest-intent window for browse/cart automation.
- Inconsistent event naming (e.g.,
add_to_cartvsAdded To Cart). You’ll build segments that miss a chunk of users and won’t notice until performance is off. - Missing suppression events. If purchase confirmation comes from a different system and isn’t tracked quickly, you’ll keep sending recovery nudges after someone already bought.
- Overloading attributes with JSON blobs that aren’t queryable. If you can’t segment on it easily, it won’t get used operationally.
- Not testing anonymous merge. Teams often validate events on a logged-in tester account and never simulate the real path: browse anonymous → add to cart → identify at checkout.
Summary
If you want Customer.io to reliably drive cart recovery, repeat purchase, and reactivation, the SDK implementation has to be identity-first and event-property clean.
Ship the smallest set of high-signal events, validate anonymous-to-known stitching, then build workflows on top of data you actually trust.
Implement 2.x with Propel
If you’re mid-implementation or cleaning up a messy tracking layer, it helps to pressure-test your identity model and event schema against the flows you want to run in Customer.io. When it’s useful, we’ll map your cart/repeat/reactivation goals to a practical SDK tracking plan and the segments that sit on top of it—book a strategy call and we’ll walk through it.