Authentication (SDK) for Customer.io: getting identity right so retention automation 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’re running Customer.io off app events, authentication is the difference between “we sent the cart flow” and “we sent it to the wrong profile (or not at all).” If you want a second set of eyes on your identity plan before you scale spend and messaging, book a strategy call—most retention issues we see come down to stitching mistakes, not copy.

In practice, authentication is about making sure your SDK events land on the same person record over time: anonymous browsing → login → purchase → reinstall → winback. When that chain breaks, your segments drift, frequency controls fail, and you start paying for messages that don’t convert.

How It Works

At a high level, the Customer.io SDK collects device/app activity and ties it to a “person” in Customer.io. Authentication is the moment you stop treating someone as anonymous and start treating them as a known customer—so future events, attributes, and device tokens attach to the correct profile.

  • Anonymous state: The SDK can track events before a user logs in (product views, add-to-cart, checkout started). These events are associated with an anonymous identifier on the device.
  • Identify on auth: When the user logs in or you otherwise know who they are (email/phone/customer ID), you call identify in the SDK. This creates/updates the person in Customer.io and associates the current device with that person.
  • Event tracking after identify: Events you track after identify (purchase, subscription started, reorder) reliably land on the known profile—this is what powers cart recovery suppression, post-purchase cross-sell, and winback timing.
  • Identity stitching: The key operational goal is to merge the anonymous history into the known profile. If you don’t stitch, you’ll see “ghost carts” (carts on anonymous profiles) and “missing purchasers” (purchases tracked on a different profile than the email/SMS subscriber).

D2C scenario: A shopper browses in your app, adds a bundle to cart, then creates an account at checkout. If you don’t identify at account creation (and stitch the anonymous activity), your cart abandonment flow might fire anyway, because Customer.io never sees the purchase on the same profile that had the cart.

Step-by-Step Setup

The cleanest implementations treat identity like a contract: one stable customer identifier, consistent identify timing, and event payloads that make segmentation predictable. Set this up once and your retention automations stop leaking.

  1. Install the Customer.io SDK for your app
    Add the SDK for your platform (iOS/Android/React Native/Flutter, etc.) and confirm it initializes on app start. Don’t move on until you can see basic SDK activity landing in Customer.io.
  2. Pick your canonical identifier (and stick to it)
    Use a stable internal customer_id if you have one. Email can work, but it’s more brittle (users change it, typos, multiple emails). Whatever you choose, use the same value everywhere you identify.
  3. Track pre-login events as anonymous
    Instrument key browsing and cart events before login (e.g., product_viewed, added_to_cart, checkout_started). Keep payloads consistent: product IDs, quantity, value, currency, cart ID.
  4. Call identify immediately after authentication
    Trigger identify right after login/signup succeeds (not when the login screen opens). Send core traits you’ll segment on: email/phone (if you collect them), first/last name, marketing opt-in flags, and any loyalty tier.
  5. Stitch anonymous activity into the known profile
    Make sure your implementation merges the anonymous session/device history with the identified person. This is the piece that prevents duplicate profiles and makes “cart before login” usable for recovery.
  6. Track purchase + fulfillment events on the identified profile
    Fire order_completed (or equivalent) after payment confirmation, not when checkout starts. Include order_id for deduping, total, line items, discount codes, and shipping method.
  7. Handle logout intentionally
    On logout, reset the SDK identity so the next user on the same device doesn’t inherit the previous user’s device token or events. This matters more than teams think for shared devices/tablets.
  8. Validate with a real test loop
    Do a full run: anonymous browse → add to cart → signup → purchase → uninstall/reinstall → login. Confirm it’s one person in Customer.io with a clean event timeline.

When Should You Use This Feature

If your retention program depends on behavioral triggers, authentication isn’t optional—it’s the foundation. The teams that skip it usually end up “fixing” performance with discounts because they can’t trust their targeting.

  • Cart recovery in-app + email/SMS: When carts often happen before login, stitching ensures the cart flow triggers on the same profile that can actually receive messages.
  • Post-purchase cross-sell and replenishment: Accurate identity keeps reorder timing and product-based recommendations tied to the buyer, not an anonymous session.
  • Reactivation / winback: If a customer reinstalls your app, you want their device token and activity to reconnect to their historical profile so you don’t treat them like a new user.
  • Frequency control across channels: Without consistent identity, you’ll cap email but still hammer push, because Customer.io thinks they’re different people.

Operational Considerations

Most “Customer.io isn’t working” complaints come from data flow realities: duplicate profiles, late identify calls, and events firing in the wrong order. Solve these and your segments start matching what your business thinks is happening.

  • Segmentation depends on event order: If order_completed can arrive before identify, you’ll create edge cases where purchasers don’t enter post-purchase journeys. Queue or delay events until identity is established when possible.
  • Duplicate people are a retention tax: If you identify sometimes by email and sometimes by internal ID, you’ll split a customer into multiple profiles. That breaks suppression (e.g., “don’t send cart recovery if purchased”).
  • Anonymous-to-known stitching impacts revenue reporting: If cart and purchase live on different profiles, your journey conversion metrics undercount and you’ll optimize the wrong steps.
  • Device management matters for push: Make sure device tokens attach to the identified user after login, and detach/reset on logout. Otherwise you’ll send winbacks to whoever currently holds the phone.
  • Orchestration across systems: If web checkout completes outside the app, decide which system is source of truth for purchase events (server-side is usually safest) and ensure the same identifier is used so Customer.io stitches cleanly.

Implementation Checklist

Before you build journeys, lock down identity and event hygiene. This checklist is what we run through when we’re trying to stop a leaky cart recovery program from spamming discounts.

  • SDK initializes reliably on app open (and you can see events arriving in Customer.io)
  • Canonical identifier chosen (customer_id preferred) and used consistently
  • identify fires immediately after login/signup success
  • Anonymous events tracked pre-login with consistent schemas
  • Anonymous activity is stitched/merged into the identified person
  • Purchase events include order_id and are deduped
  • Logout resets identity and device association
  • Test loop validated: anonymous → identify → purchase → reinstall → login = one profile

Expert Implementation Tips

Once the basics are in, small execution choices make a big difference in how clean your segments stay over months of iteration.

  • Identify once, update often: Treat identify as the moment you bind the device to the person. Use attribute updates for things like loyalty tier changes or subscription status so you’re not re-identifying with inconsistent IDs.
  • Use a single event as your “purchase truth”: Pick one event name and contract (order_completed) and force every platform to conform. Nothing breaks post-purchase flows faster than purchase on iOS and order on Android.
  • Build suppression off IDs, not timestamps: For cart recovery, suppress using order_id / cart_id relationships where possible. Timestamp-only logic gets messy when events arrive late or offline.
  • Plan for offline/queued events: Mobile events can arrive delayed. In most retention programs, we’ve seen late-arriving purchases cause “sorry you left something behind” emails after someone already bought—add short delays and purchase checks before sending.

Common Mistakes to Avoid

These are the identity issues that quietly tank retention performance while everything “looks” implemented.

  • Calling identify with different IDs over time: Email one day, internal ID the next = duplicate profiles and broken suppression.
  • Identifying too late: If you identify after checkout completes, the highest-value events land on an anonymous profile and your post-purchase journeys miss.
  • Not resetting on logout: Shared devices become a nightmare—wrong push notifications, wrong in-app messages, and support tickets you can’t explain.
  • Tracking “cart created” but not “cart updated”: You end up recovering the wrong items/values and your dynamic cart content looks broken.
  • No dedupe strategy for purchases: Retries and network issues can send the same order multiple times; without order_id, you’ll overcount revenue and mis-trigger flows.

Summary

If your SDK identity is clean, Customer.io becomes a reliable retention engine: cart recovery suppresses correctly, post-purchase journeys personalize, and winbacks target the right people.

If identity is messy, you’ll spend your time patching segments and discounting your way out of targeting problems.

Implement Auth with Propel

When teams ask us to troubleshoot underperforming cart recovery or winback, the fix is usually upstream: identify timing, stitching, and event contracts. If you’re building or cleaning up your Customer.io SDK implementation and want an operator’s review of your identity plan, book a strategy call—it’s the fastest way to prevent duplicate profiles and get your retention automations back to trustworthy.

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