Summarize this documentation using AI
Overview
If you’re running retention in Customer.io, authentication is the difference between “we sent the right message” and “we spammed the wrong profile.” When identity stitching is clean, cart recovery, replenishment, and winback flows all trigger off the same customer record instead of fragmenting across anonymous sessions and duplicate profiles. If you want a second set of eyes on your tracking plan before you scale spend, you can book a strategy call and we’ll sanity-check the identity model end-to-end.
In most D2C apps, the messy moment is login: customers browse anonymously, add to cart, then authenticate at checkout. If your SDK identify call is late, inconsistent, or uses the wrong identifier, you’ll see classic symptoms—abandoned cart emails going to the wrong person, push notifications firing twice, and “reactivation” hitting customers who purchased yesterday on another device.
How It Works
At the SDK level, authentication is really about when and how you move a person from anonymous tracking to a known profile, and how you keep that identity stable across devices and sessions.
- Anonymous session tracking starts first. Your mobile/web SDK can capture events (product viewed, add to cart) before the user logs in. That pre-auth activity is valuable for recovery and personalization, but only if you later attach it to the right person.
- Identify is the “stitch” moment. When the customer logs in (or you otherwise know who they are), you call the SDK’s
identifywith a stable customer identifier (typically your internal customer ID). That tells Customer.io: “this device/session belongs to this person.” - Events after identify inherit the identity. Once identified, every subsequent
trackevent lands on the same person profile, which is what makes Journeys and campaign triggers reliable for repeat purchase and reactivation. - Logout should reset identity. If you support logout or account switching, you need to explicitly clear/reset the identified user in the SDK. Otherwise, the next person using the device can accidentally “inherit” the previous customer’s retention flows.
Practical D2C scenario: a shopper browses your app anonymously, adds a moisturizer to cart, then logs in to apply loyalty points. If you identify at login and your SDK merges the pre-login cart events to the authenticated profile, you can trigger a cart recovery push/email if they bounce. If you identify too late (or with an email that changes), that same shopper might get no recovery at all—or worse, recovery goes to a duplicate profile that never purchases.
Step-by-Step Setup
The goal here is simple: Customer.io should see one durable person per real customer, and your app should send events consistently before and after login. This is where most retention programs quietly break, so set it up once and keep it boring.
- Install the appropriate Customer.io SDK (mobile/web) early in app initialization.
Do this before you fire any product or cart events so you don’t lose the top-of-funnel behavioral data that powers browse/cart recovery. - Decide your canonical identifier (don’t wing this).
Use a stable, internalcustomer_id(or equivalent) that never changes. Avoid using email as the primary key if customers can update it. - Track key anonymous events before login.
At minimum for D2C retention:Product Viewed,Collection Viewed,Add to Cart,Checkout Started. Keep payloads consistent (SKU, price, currency, quantity). - Call
identifyimmediately on authentication.
Trigger it right after you confirm the user session (login, magic link, SSO), not after checkout completes. Include core attributes you’ll segment on (e.g.,email,phone,first_name,loyalty_tier). - Confirm identity stitching by validating event ownership.
In Customer.io, verify that pre-login events appear on the same person profile after identify. If you see duplicates (one anonymous-heavy profile, one purchase-heavy profile), your identify timing or identifiers are off. - Track post-auth conversion events with clean naming.
For retention:Order Completed,Subscription Created,Refund Issued,Replenishment Reminder Eligible. These events should always be tied to the identified customer. - Handle logout/account switching explicitly.
Reset/clear the identified user in the SDK on logout. This prevents cross-account contamination on shared devices (common on tablets in retail, shared family iPads, etc.).
When Should You Use This Feature
You’ll feel the need for SDK-level authentication any time you’re relying on behavioral triggers and want them to land on the same profile that ultimately purchases. That’s most retention programs once you get past basic newsletters.
- Cart recovery in an app-first funnel. If “Add to Cart” happens pre-login, identity stitching is what ensures the recovery message targets the real buyer, not a ghost profile.
- Repeat purchase and replenishment. You need purchases and product affinity on one profile to time replenishment correctly (e.g., 21 days after the last cleanser order) and suppress customers who already repurchased on another device.
- Reactivation with accurate last activity. If browsing happens anonymously but purchases happen authenticated, you’ll mislabel customers as “inactive” unless you stitch sessions properly.
- Multi-device customers. D2C buyers often browse on mobile and purchase on desktop. A consistent identifier strategy is how you avoid double-sending and conflicting journeys.
Operational Considerations
Once the SDK is sending clean identity and events, the operational work is making sure segmentation and orchestration don’t drift as the product changes. This is where retention teams get surprised six weeks later.
- Segmentation depends on stable identifiers. Build segments off your canonical
customer_idand durable attributes (lifetime orders, last order date, subscription status). If you key off email and it changes, your “VIP” segment silently fractures. - Data flow timing affects message timing. If identify fires after checkout, your cart abandonment journey may trigger on an anonymous profile and never reach the buyer. Align event timing to the decision points in your flows (add-to-cart, checkout-start, payment-failed, order-complete).
- Orchestration needs suppression rules that assume identity is correct. In practice, you’ll want global suppressions like “don’t send cart recovery if Order Completed in the last X hours.” Those only work if both events land on the same person.
- Versioning matters. SDK updates and app releases can change event payloads. Treat tracking like an API: document it, test it, and don’t let random engineers rename
Add to CarttoAddedToCartwithout telling marketing.
Implementation Checklist
If you want this to hold up under real traffic (and not just in a QA sandbox), run through this checklist before you rely on it for revenue-critical flows.
- SDK installed and initialized before any behavioral events fire
- Canonical identifier chosen (internal customer ID) and used consistently in
identify identifytriggered immediately on login/magic link/SSO success- Anonymous pre-login events captured for browse/cart/checkout
- Post-login purchase events always tied to the identified profile
- Logout/account switch clears the identified user in the SDK
- Customer.io profile audit confirms no systematic duplicates for active buyers
- Key journeys (cart recovery, post-purchase, winback) have suppression rules that reference the same stitched profile
Expert Implementation Tips
These are the small operator moves that keep identity clean as you scale channels and complexity.
- Identify earlier than you think. If you have “soft auth” moments (entering email for shipping, loyalty lookup, or saved cart), consider identifying there—then update attributes later when the account is fully created.
- Standardize event payloads for merchandising logic. For example, always send
sku,product_id,category,price,currency. This is what powers “viewed but didn’t buy” and cross-sell without brittle mapping. - Use one naming convention and enforce it. Retention teams lose weeks to “why didn’t the journey trigger?” and it’s often a casing mismatch or renamed event in the app.
- Audit identity stitching with real customer stories. Pick 10 recent purchasers and trace their timeline: anonymous browse → login → add to cart → purchase. If any step lands on a different profile, fix that before you optimize creative.
Common Mistakes to Avoid
Most issues show up as revenue leakage (missed recoveries) or brand damage (wrong-person messaging). These are the repeat offenders.
- Using email as the primary identifier. Emails change, get mistyped, and can be shared. Your internal customer ID is the safer spine for retention.
- Calling identify only after purchase. That’s too late for cart recovery and checkout drop-off flows—the highest leverage automations in D2C.
- Not clearing identity on logout. This is how you end up sending “your order is on the way” to the next person who logs in on the same device.
- Letting anonymous and authenticated profiles coexist for the same person. If you see this pattern, you’ll double-send winbacks and undercount LTV segments.
- Inconsistent event schemas across platforms. If iOS sends
productIdand Android sendsproduct_id, segmentation and personalization become a mess fast.
Summary
If you’re serious about cart recovery, repeat purchase, and reactivation in Customer.io, SDK authentication is foundational—not optional.
Identify early, use a stable customer ID, stitch anonymous behavior to the authenticated profile, and reset identity on logout. Once that’s solid, every downstream journey becomes easier to trust and optimize.
Implement Auth with Propel
If you’re tightening up identity stitching for Customer.io, treat it like revenue infrastructure: one clean ID, predictable identify timing, and event schemas you can segment on without guesswork. If you want us to review your current SDK implementation (and how it impacts cart recovery and winback performance), book a strategy call and we’ll walk through the tracking plan and the failure points we typically see in production.