Authentication (SDK) for Customer.io: get identity right so retention 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 retention in Customer.io, authentication is the difference between “nice flows” and flows that actually hit the right customer at the right time. When identity is messy (anonymous sessions, multiple devices, shared emails, app reinstalls), your cart recovery and repeat purchase automations quietly bleed revenue because messages fire against the wrong profile—or don’t fire at all.

If you want a second set of eyes on your tracking + identity plan before you scale spend and volume, book a strategy call. In most retention programs, we see identity stitching become the hidden bottleneck long before creative or offer strategy.

How It Works

On web and mobile, people don’t start authenticated—they browse, add to cart, maybe even start checkout, and only then log in or enter an email. The SDK needs a clean handoff from “anonymous activity” to a known customer profile so Customer.io can attribute events, build segments, and trigger journeys without splitting one shopper into multiple people.

  • Anonymous state: The SDK can track events before you know who the shopper is (product views, add-to-cart, checkout started). Those events are useful, but only if you later attach them to a real person.
  • Authentication moment: When the user logs in, creates an account, or you otherwise have a stable identifier, you call identify from the SDK with your app’s user ID (and typically email/phone as attributes).
  • Identity stitching: The SDK links the anonymous history on that device/session to the identified person going forward. Practically, this is what prevents “cart abandoner #1” and “customer@example.com” from being two separate profiles with half the data each.
  • Ongoing tracking: After identify, every event (purchase, subscription, replenishment intent) lands on the correct person, which is what makes downstream segmentation and orchestration trustworthy.

Real D2C scenario: A shopper browses on mobile web, adds a product to cart, then opens your app and logs in to check shipping. If you don’t identify correctly in the app (and stitch the anonymous activity), your “Cart Abandonment” journey may trigger on the anonymous web profile while your “Post-Purchase Cross-sell” triggers on the logged-in app profile. That’s how customers get irrelevant messages and your reporting looks inconsistent.

Step-by-Step Setup

The goal here is simple: fire identify once you have a stable user ID, track events consistently before and after login, and avoid creating duplicate people. Get this right early and your retention automations won’t require constant patchwork later.

  1. Install the Customer.io SDK for your platform(s)
    Add the SDK to your iOS/Android app (or your web app if you’re using the web SDK). Make sure you’re using the correct site/workspace credentials and environment separation (dev vs prod) so test traffic doesn’t pollute real segments.
  2. Decide your canonical identifier (don’t wing this)
    Use your internal user_id as the primary identifier. Email changes; phone changes; user_id should not. In practice, this tends to break when teams identify by email and then later introduce SMS or allow email updates.
  3. Track pre-login events as anonymous
    Send events like Product Viewed, Added to Cart, Checkout Started even when the user isn’t logged in. Include the operational payload you’ll need later (SKU, product name, category, price, cart value, currency).
  4. Call identify immediately after authentication
    As soon as the user successfully logs in / creates an account, call the SDK’s identify with user_id and set key attributes (email, phone, first_name, marketing_consent, etc.). This is the stitching moment—don’t delay it until “later in the session.”
  5. Track post-login events against the identified profile
    Continue tracking the same event names with the same schema. Consistency matters more than volume—your segments and journey triggers will be far more stable.
  6. Handle logout explicitly
    When a user logs out, reset the SDK identity (per platform guidance) so the next person using that device doesn’t inherit the previous customer’s profile. Shared devices are rare, but when it happens it creates the ugliest edge-case bugs in retention.
  7. Validate in Customer.io Activity Logs
    Before you ship, verify: anonymous events appear, identify happens once, and events after identify land on the same person. If you see multiple profiles for one human, fix identity before building more journeys.

When Should You Use This Feature

You lean on SDK authentication any time customer behavior spans anonymous browsing and logged-in actions—which is basically every modern D2C brand across web + app. The more channels you run (email, push, SMS), the more expensive identity mistakes become.

  • Cart recovery that starts anonymous but ends logged-in: capture add-to-cart on web, stitch on app login, and trigger the right reminder to the right person.
  • Repeat purchase and replenishment: if purchases happen logged-in but discovery happens anonymous, you need stitching to build accurate “last viewed category” and “next best product” segments.
  • Reactivation: winback segments depend on clean “last active” and “last purchase” signals. Duplicate profiles will undercount inactivity and suppress the wrong people.
  • Cross-device behavior: shoppers browse on one device and buy on another. Authentication is how you keep the story coherent.

Operational Considerations

Authentication is a tracking decision that ripples into segmentation and orchestration. If you treat it like an engineering checkbox, you’ll spend the next quarter debugging why flows don’t convert.

  • Segmentation depends on identity stability: build segments off your canonical user_id profile, not off channel identifiers that can change (email/phone). Use those as attributes, not as the “person.”
  • Event schema discipline: keep event names and properties identical across platforms (iOS vs Android vs web). Otherwise you’ll end up with parallel segments like “Added to Cart (iOS)” and “Added_to_cart (Web)” and your orchestration logic becomes brittle.
  • Data flow timing: if identify happens late (after multiple screens), you’ll see anonymous cart events that never stitch, which means cart recovery triggers won’t find an email/phone to message.
  • Duplicate people resolution: if you’ve already created duplicates (common when teams identified by email first), plan a cleanup path. Customer.io has tooling around duplicate resolution, but it’s far cheaper to prevent duplicates with a consistent identify strategy.
  • Orchestration reality: your journeys should assume identity can change mid-session. For example: delay cart reminders long enough to allow a user to log in and stitch, otherwise you’ll message too early from an anonymous profile.

Implementation Checklist

Before you build or refactor retention journeys, run through this list and make sure your identity layer won’t sabotage the work.

  • SDK installed and configured correctly in each environment (dev/stage/prod).
  • Canonical user_id chosen and used consistently across platforms.
  • identify called immediately after login/account creation.
  • Logout/reset behavior implemented to prevent cross-user contamination.
  • Pre-login events tracked with a consistent schema and meaningful payloads.
  • Post-login events match pre-login naming and property conventions.
  • Validation completed in Customer.io Activity Logs for anonymous → identified stitching.
  • Key retention events covered: Viewed Product, Added to Cart, Checkout Started, Order Completed.

Expert Implementation Tips

These are the small operator moves that keep your retention engine stable when volume, channels, and complexity increase.

  • Identify once, update often: don’t spam identify on every app open. Identify on auth; then send attribute updates only when something actually changes (consent, phone, subscription status).
  • Capture intent before conversion: for cart recovery, the “Added to Cart” payload should include SKU + quantity + total cart value. Without it, your messages become generic and conversion drops.
  • Design for “email captured, not logged in”: many D2C checkouts capture email before account creation. If your app supports this, treat email capture as an identity milestone and stitch as early as your policy allows.
  • Delay triggers to let stitching happen: a 10–30 minute delay on cart abandonment often improves attribution because users frequently authenticate shortly after browsing (especially if they switch from web to app).
  • Use one event for purchase across platforms: don’t separate “In-App Purchase” and “Web Purchase” unless you truly need it. One purchase event with a source property keeps LTV segmentation sane.

Common Mistakes to Avoid

Most retention “bugs” aren’t message problems—they’re identity problems that show up as low conversion, weird suppression behavior, or missing triggers.

  • Identifying by email only: when email changes, you fragment the customer. Anchor on user_id and treat email as an attribute.
  • Calling identify too late: if users add to cart anonymously and you only identify after checkout, your cart recovery audience will be full of profiles you can’t contact.
  • Inconsistent event names: different casing/spaces between iOS/Android/web creates silent segment gaps.
  • Not resetting on logout: this creates “Frankenstein profiles” where one person’s browsing history fuels another person’s recommendations and reminders.
  • Shipping without log validation: if you don’t confirm stitching in Activity Logs, you’ll end up debugging journeys when the real issue is upstream tracking.

Summary

If you want cart recovery, winback, and repeat purchase flows to perform, you need clean SDK authentication and reliable identity stitching. Get identify timing right, keep event schemas consistent, and validate the anonymous → known handoff before you scale orchestration.

Implement Auth with Propel

If your team is juggling web + app tracking, multiple channels, and you’re seeing duplicates or “missing” events in Customer.io, it’s usually faster to tighten the identity plan first and then build journeys on top of something stable. If you want help pressure-testing your identify strategy, event schema, and the stitching edge cases (logout, reinstall, cross-device), book a strategy call and we’ll map it to the retention outcomes you care about.

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