Summarize this documentation using AI
Overview
If you’re upgrading from 1.x to 2.x, you’re really upgrading your tracking reliability—identity stitching, event consistency, and the “do we trust this trigger?” question that decides whether your retention automations work. Done right, your Customer.io journeys stop leaking users due to duplicate profiles, missing device tokens, or anonymous activity that never merges. If you want a second set of eyes on the migration plan (especially if you’re mid-scale and can’t afford a week of broken cart recovery), book a strategy call.
In most retention programs, we’ve seen the 1.x → 2.x upgrade pay off fastest in mobile push + email orchestration—because the SDK becomes the source of truth for “who is this user right now?” and “what did they just do?”
How It Works
The 2.x SDK changes how you initialize the SDK, how you identify users, and how you record events and device state. The practical impact for retention is that you’ll get cleaner person profiles (fewer duplicates), better anonymous-to-known merging, and more dependable event triggers for time-sensitive flows like cart abandonment.
- Initialization becomes stricter: you’ll typically rework the SDK boot sequence (app start) so the SDK has the right site/workspace credentials and environment settings before any tracking happens.
- Identity is more intentional: you’ll want a single, consistent place in your app where you call
identify()after login/account creation, and a matchingclear/reseton logout. This is where most “ghost carts” and duplicate profiles come from. - Anonymous activity matters more: the upgrade is your chance to ensure anonymous browsing and cart-building events are captured and then merged when the user identifies (email capture, login, checkout). If you skip this, cart recovery will undercount and your “Viewed Product” audience will look anemic.
- Device token + push state needs to be rock solid: 2.x migrations often surface gaps where teams weren’t reliably registering push tokens or updating notification permission state—leading to silent push drop-offs and skewed channel performance.
Real D2C scenario: a shopper adds items to cart on mobile, gets distracted, then logs in later on desktop to check shipping. If your app-side SDK doesn’t merge anonymous cart events into the known profile at login, Customer.io can’t reliably trigger the mobile push reminder (because the cart event lives on an anonymous profile) and your cart recovery sequence becomes email-only and delayed.
Step-by-Step Setup
Treat this like a tracking migration, not a “library bump.” The fastest path is to run 2.x in a staging environment, validate identity + event parity against your 1.x payloads, then cut over with tight monitoring on duplicate profiles and trigger volumes.
- Inventory what 1.x is sending today
- List current
identifyfields (id/email, traits/attributes). - List events that drive retention:
Viewed Product,Added to Cart,Started Checkout,Purchased,Subscribed, etc. - Document where they fire in the app (screen load, button tap, API success).
- List current
- Upgrade the SDK dependency to 2.x
- Update your iOS/Android/Web package versions per your platform’s package manager.
- If you support multiple app flavors (dev/stage/prod), confirm each environment points to the right Customer.io credentials.
- Rebuild the initialization sequence
- Initialize as early as possible (app launch), but don’t fire user-specific events until after identity is known.
- Decide what you want tracked pre-login (anonymous) vs post-login (identified) and keep that consistent.
- Implement a single source of truth for identity
- On login/account creation: call
identify()once, with your canonical user identifier. - On logout: call the SDK’s reset/clear method so the next user on the device doesn’t inherit the previous profile.
- If you collect email before account creation (newsletter popup, early checkout), decide whether you identify immediately or keep it anonymous until verified—this affects merge behavior.
- On login/account creation: call
- Re-implement event tracking with parity checks
- Fire events on confirmed actions (e.g., after “add to cart” API success), not just UI taps—this reduces false positives that inflate abandonment flows.
- Keep event names stable unless you’re intentionally migrating your taxonomy (renames break triggers and historical reporting).
- Send the properties your segmentation relies on (SKU, variant, price, category, cart value, currency).
- Validate push token and permission tracking (mobile)
- Ensure the device token is registered and updated on token refresh.
- Track notification permission status changes; it’s a key segment filter for push eligibility.
- Run a dual-validation window
- In staging: compare 1.x vs 2.x event volume and payload shape.
- In production: roll out gradually (feature flag or phased release) and watch duplicates, anonymous merges, and trigger entry counts.
When Should You Use This Feature
You do the 1.x → 2.x upgrade when tracking accuracy is limiting revenue—usually before you add more journeys. If your team is about to build more segmentation-heavy flows (VIP tiers, replenishment, winback), upgrading first prevents weeks of “why is this segment empty?” debugging.
- Cart recovery is underperforming on mobile: push audience is smaller than expected, or abandonment triggers feel delayed/inconsistent.
- Duplicate profiles are creeping up: the same customer shows up as multiple people, splitting purchase history and breaking LTV-based targeting.
- Anonymous browsing isn’t converting into identifiable audiences: you have traffic and PDP views, but “Viewed Product” segments are tiny because anonymous activity never merges.
- You’re expanding orchestration: adding in-app messages, push, and SMS alongside email requires clean device + identity state.
Operational Considerations
The SDK upgrade is only “done” when your segments and journeys behave the same—or better—under real traffic. Most issues aren’t code compilation issues; they’re data flow issues that show up as broken entry conditions, suppressed sends, or inflated audiences.
- Segmentation depends on stable identifiers: if you change the primary identifier (e.g., moving from email-based to internal user ID), plan the migration so historical profiles don’t fragment. Identity stitching is where retention programs tend to break when multiple IDs exist across app, web, and ESP.
- Event timing affects orchestration: firing
Added to Cartbefore the backend confirms the cart update will over-trigger abandonment messages and erode trust (“I got a cart reminder but my cart is empty”). - Anonymous-to-known merge rules impact journey entry: if a user enters a cart abandonment journey anonymously and then identifies, you need to know whether the journey continues on the merged profile or strands the user in the wrong state.
- Cross-platform consistency: if you track web with one taxonomy and app with another, your segments will skew toward one channel and your holdouts/A-B tests won’t be clean.
- Monitoring is part of the build: set up a simple dashboard/check (events per day, identify calls per day, duplicate rate proxy, push token registration rate) so you catch regressions after app releases.
Implementation Checklist
If you want this to be a clean cutover, treat the checklist below as “release criteria.” The goal is that your highest-leverage retention flows (cart recovery, post-purchase, winback) don’t lose signal during the migration.
- SDK 2.x installed and initializing correctly in dev/stage/prod
- Canonical
identify()location implemented (login + account creation) - Logout/reset clears the profile/device state reliably
- Anonymous events captured pre-login where relevant (PDP view, add-to-cart)
- Anonymous activity merges into known users after identify (validated with test accounts)
- Event names unchanged (or journey triggers updated everywhere if renamed)
- Core retention events include required properties (SKU, price, cart value, currency)
- Mobile push token registration + refresh handling verified
- Key Customer.io segments still populate at expected rates post-upgrade
- Cart abandonment and post-purchase journeys have stable entry counts week-over-week
Expert Implementation Tips
The difference between an “upgrade” and a retention lift is usually a handful of operator decisions around identity and event hygiene. These are the moves that keep your journeys dependable when the app team ships fast.
- Gate high-stakes events on backend truth: for
PurchasedandAdded to Cart, track after the API confirms success. It reduces false triggers and improves recovery message relevance. - Standardize your event payloads across app + web: keep property keys identical (e.g.,
product_id,variant_id,price,currency). This makes segments portable and avoids duplicating journey logic. - Track “cart state” snapshots, not just actions: alongside
Added to Cart, sendcart_valueandcart_item_count. Then you can suppress reminders for $0 carts or send a stronger incentive above a threshold. - Be deliberate about pre-login identification: if you identify on email capture (before account creation), decide how you’ll handle typos and multiple emails on the same device—this is a common source of duplicates.
- Create a QA script for retention flows: one test user, one device, one sequence (view → add → abandon → login → purchase) and validate the profile timeline in Customer.io before you declare victory.
Common Mistakes to Avoid
Most migration pain comes from subtle identity bugs that don’t show up until you look at segment counts and revenue attribution. These are the ones that repeatedly bite D2C teams.
- Calling
identify()multiple times with different IDs: this is how you split purchase history and break LTV segmentation. - Forgetting to reset on logout: shared devices (tablets, family phones) will contaminate profiles and cause “why did my partner get my replenishment reminder?” moments.
- Renaming events during the upgrade without updating journeys: cart recovery triggers silently stop firing, and you only notice when revenue dips.
- Tracking UI intent instead of confirmed actions: over-triggered abandonment messages train customers to ignore you.
- Not validating anonymous merge behavior: you think you’re capturing top-of-funnel behavior, but it never attaches to known customers—so personalization and retargeting segments stay weak.
- Ignoring payload property drift: even if the event fires, missing
product_idorvariantkills dynamic content and product-specific follow-ups.
Summary
Upgrading Customer.io SDK 1.x to 2.x is mainly about fixing identity and event trust so your retention automations run on clean signal. Prioritize identify/reset, anonymous merging, and backend-verified events. If cart recovery and post-purchase flows keep stable entry counts after rollout, you’re in a good place.
Implement 2.x Upgrade with Propel
If you’re treating this upgrade as the foundation for better cart recovery, repeat purchase, and winback, it helps to run it like a retention project—not just an engineering ticket. We’ll typically map your current 1.x tracking to the segments/journeys it powers in Customer.io, then validate identity stitching and event parity before you roll out broadly. If you want us to sanity-check your plan or help QA the migration against revenue-critical flows, book a strategy call.