Summarize this documentation using AI
Overview
If you’re standing up Customer.io for a D2C brand, the SDK work is where retention either gets clean and compounding—or messy and unreliable. If you want a second set of eyes on your tracking plan and identity stitching before you wire campaigns to it, book a strategy call.
The goal of this quick start isn’t “send your first message.” It’s getting app-side tracking tight enough that cart recovery, replenishment, and reactivation flows trigger off the right people at the right time—without double-counting purchases, missing anonymous carts, or fragmenting profiles across devices.
How It Works
Customer.io’s SDKs sit in your app (mobile or web) and stream two things into Customer.io: identity (who someone is) and behavior (what they did). In retention programs, the difference between a great cart recovery program and a leaky one is almost always identity stitching—making sure the anonymous “browsed + added to cart” person becomes the same profile as the “logged in + purchased” customer.
- Install the SDK in your iOS/Android/web app so you can send events and manage device tokens for push.
- Identify users as soon as you have a stable identifier (email, customer ID). This is the moment where anonymous behavior can merge into the known profile.
- Track events like
product_viewed,added_to_cart,checkout_started,purchasewith consistent properties (SKU, price, quantity, cart_id, order_id). - Update person attributes (e.g.,
first_name,phone,last_purchase_at,lifetime_value) so segmentation and message personalization don’t depend on brittle event parsing. - Stitch identities across sessions/devices by calling identify on login and clearing/resetting identity on logout so you don’t attribute one shopper’s cart to another household member.
D2C scenario: a shopper browses on mobile while commuting, adds a product to cart anonymously, then logs in at home and completes checkout. If you identify too late (or not at all), your cart abandonment flow either won’t fire or will fire to the wrong profile. If you identify correctly, you can suppress cart recovery after purchase and shift them into a post-purchase cross-sell or replenishment sequence immediately.
Step-by-Step Setup
Before you touch campaigns, get the SDK foundation in place. You’re aiming for a clean event stream and deterministic identity so your segments and triggers behave predictably under real customer behavior (multiple sessions, multiple devices, interrupted checkouts).
- Create your workspace and pick message channels you’ll actually use In practice, you’ll want email + push for app-first brands, and optionally SMS once you can reliably capture phone + consent. Don’t build flows on channels you can’t populate yet.
- Install the Customer.io SDK in your app Use the SDK for your platform (iOS/Android/React Native/Flutter, etc.). Confirm the app can reach Customer.io from production builds (not just local/dev) so you don’t “pass QA” and then go dark in the wild.
- Decide your canonical identifier and enforce it Pick one primary ID strategy (commonly
customer_idor email). The fastest way to create duplicate profiles is mixing identifiers across surfaces (email in web, numeric ID in app) without a stitching plan. - Implement identify at the right moment Call
identifyimmediately after signup/login (or once an email is captured and verified). Include stable attributes you want available for segmentation and personalization. - Implement logout/reset behavior On logout, clear the identified user in the SDK so shared devices don’t leak events across profiles. This matters more than most teams expect for family/shared iPads and store devices.
- Track the core retention event taxonomy Start with a small set of events that drive revenue workflows. Keep naming consistent across app and web if you have both.
- Minimum viable D2C events:
product_viewed,added_to_cart,checkout_started,purchase,subscription_started(if applicable),app_opened. - Include the properties you’ll need later Retention orchestration breaks when the event fires but doesn’t contain what the message needs. For example, cart recovery without
cart_items(or at least top SKU + image URL) forces generic creative and tanks conversion. - Suggested properties:
product_id,sku,variant,price,quantity,currency,cart_id,order_id,total,coupon,source(app/web),timestamp. - Validate data in Customer.io before building journeys Check that events arrive on the correct profile, attributes update as expected, and anonymous activity merges after identify. Do this with a real device and a real login flow—not just unit tests.
When Should You Use This Feature
The SDK becomes non-negotiable when retention depends on in-app behavior and timing. If you’re only sending batch newsletters off Shopify exports, you can limp along—but you’ll cap your upside fast.
- Cart recovery for app shoppers when you need triggers like “added to cart but no purchase in 1 hour” and you want to suppress immediately on purchase.
- Browse-to-buy follow-ups (e.g., viewed a category twice in 7 days, no add-to-cart) to push discovery and drive repeat sessions.
- Post-purchase orchestration where you want to branch based on what was bought (SKU-level), not just “placed order.”
- Reactivation based on real inactivity signals like “no app_opened in 21 days” combined with “last_purchase_at > 60 days.”
- Push-first retention where device token management and permission state are required to reach customers reliably.
Operational Considerations
Once the SDK is live, your biggest job is keeping data usable for segmentation and orchestration. In most retention programs, the failures aren’t “we didn’t send enough messages”—they’re “our segments are wrong” or “our purchase event fires twice and suppresses the wrong people.”
- Segmentation depends on stable fields: decide which things are person attributes (e.g.,
last_purchase_at,lifetime_value,vip_tier) vs event properties (e.g.,order_id). Attributes should be the stuff you filter on constantly. - Data flow timing matters: if purchase events arrive late (or out of order), cart recovery will keep sending after checkout. Build your orchestration with realistic delays and suppression checks.
- Identity stitching is the whole game: anonymous carts are common in D2C. Make sure your identify call merges pre-login behavior; otherwise you’ll under-trigger recovery and over-trigger “welcome back” flows.
- Cross-platform consistency: if you have web + app, align event names and key properties. Otherwise you’ll end up building the same segment twice and your reporting will never reconcile.
- Orchestration realities: build guardrails for duplicate events (especially
purchase) usingorder_idand idempotency patterns so journeys don’t branch incorrectly.
Implementation Checklist
If you want this to drive revenue quickly, treat this like a launch checklist—not an engineering “nice to have.” Once campaigns depend on these events, changing names/properties becomes expensive.
- SDK installed in production builds (not just dev) for your platforms
- Canonical identifier chosen and documented (email vs customer_id)
identifyfires on login/signup and merges anonymous behavior correctly- Logout/reset clears identity to prevent cross-user contamination
- Core events implemented:
product_viewed,added_to_cart,checkout_started,purchase,app_opened - Event properties include SKU/product identifiers + cart/order IDs
- Purchase event is deduped via
order_id(or equivalent) - Key attributes updated:
last_purchase_at,orders_count,lifetime_value(as available) - Tested end-to-end with a real device: anonymous browse → add to cart → login → purchase
Expert Implementation Tips
These are the small operator decisions that keep your retention machine from drifting over time. They’re also the things that tend to get skipped when teams rush to “turn on automations.”
- Track intent, not just pageviews: “viewed product” is fine, but “added to cart” and “checkout started” are where the money is. Prioritize accuracy and completeness there.
- Send a cart snapshot with cart events: include an array of items (SKU, name, image URL, price). That unlocks dynamic cart emails/push without a brittle backend lookup.
- Use a single source of truth for purchase: if app and backend both emit purchase, you’ll double-fire. Pick one emitter (often backend) and make everything else a secondary signal.
- Capture permission state for push: store whether push is authorized/denied so you can segment “push-enabled” audiences and avoid wasting sends.
- Version your tracking plan: when you change event schemas, note the date/version. Otherwise, segments built on old properties silently degrade.
Common Mistakes to Avoid
Most teams don’t fail because they didn’t implement the SDK—they fail because the implementation creates unreliable audiences. These are the patterns that show up repeatedly in D2C retention.
- Identifying too late: waiting until checkout to call identify means you lose the entire pre-purchase funnel for targeting and recovery.
- Mixing identifiers across surfaces: email on web, numeric ID on app, and no stitching plan leads to duplicate profiles and broken frequency control.
- Not resetting on logout: shared devices will poison your data and send the wrong cart recovery to the wrong person.
- Missing order_id/cart_id: without IDs, you can’t dedupe purchases or tie follow-ups to the right cart/order.
- Over-tracking noise: tracking every screen view but missing
added_to_cartproperties creates the illusion of “lots of data” with none of the leverage. - Building journeys before validating data: you’ll spend weeks debugging “why did this person enter?” instead of shipping improvements.
Summary
If you want Customer.io to drive repeat purchase and recovery, the SDK setup needs to prioritize identity stitching and high-signal commerce events. Get identify + purchase/cart tracking correct first, validate with real flows, then build orchestration on top of something you can trust.
Implement Quick Start Guide with Propel
If you’re already implementing the SDK and want to pressure-test your tracking plan against the retention use cases that actually move revenue (cart recovery suppression, post-purchase branching, reactivation), it’s worth getting an operator review before you scale sends in Customer.io. When you’re ready, book a strategy call and we’ll map your event taxonomy and identity rules to the journeys you’re trying to run.
The fastest wins usually come from tightening 3–5 events and 2–3 identity rules—then letting segmentation and orchestration do the work.