Summarize this documentation using AI
Overview
If you’re upgrading your Customer.io SDK from 3.x to 4.x, the real risk isn’t “does the app compile?”—it’s whether your identity stitching and event stream stay clean enough to keep cart recovery, replenishment, and winback automations firing correctly. If you want a second set of eyes on the migration plan (especially around anonymous-to-known merge behavior), book a strategy call and we’ll pressure-test it like an operator would.
In most retention programs, we’ve seen upgrades go sideways when teams treat the SDK as a dev-only task. The SDK is the source of truth for mobile/web behavior, and small tracking changes can quietly tank segments, suppress sends, or inflate “new user” counts.
How It Works
The 3.x → 4.x upgrade is mostly about moving to the newer SDK surface area and making sure your app keeps sending the same identities and events Customer.io uses to drive campaigns. The goal is simple: preserve the person profile, preserve device association, and preserve the event names/properties your workflows depend on.
- Installation changes: you’ll update to the 4.x package versions for your platform (iOS/Android/React Native/etc.) and align initialization/configuration with the new SDK pattern.
- Identity stitching stays the centerpiece: you still need a consistent identify call when a user becomes known (login/account creation), and you need to handle the anonymous phase so pre-login events (like
Viewed ProductorAdded to Cart) don’t get stranded on an anonymous profile. - Event tracking must remain compatible: your retention automations don’t care that you upgraded—your “Cart Abandonment” journey still expects something like
Added to Cartwithsku,price,cart_id, etc. If event names/properties drift during the upgrade, segments stop matching and sends drop. - Device + push tokens: if you use push, the SDK upgrade must keep device registration and token updates stable. Otherwise you’ll see deliverability issues that look like “push is down” but are really “tokens aren’t attached to the right profile.”
Real D2C scenario: a shopper adds items to cart while anonymous, then logs in to check shipping. If your 4.x upgrade changes when/where you call identify (or you forget to merge anonymous activity), your cart recovery flow will either (a) message the wrong profile, (b) not message at all because the known profile never recorded Added to Cart, or (c) double-message because both anonymous and known profiles qualify.
Step-by-Step Setup
Run the upgrade like a retention-critical release: lock down the tracking contract first, then change code, then validate end-to-end in Customer.io with real devices. The steps below assume you already have campaigns depending on SDK events.
- Inventory your tracking contract (before touching code).
Export or document:- All event names used in campaigns/segments (cart, browse, purchase, subscription, app engagement).
- Required properties per event (e.g.,
sku,product_id,cart_value,currency,order_id). - Your identity rules: when you call
identify, what identifier you use, and how you handle logout.
- Upgrade SDK dependencies to 4.x.
Update your package manager entries (CocoaPods/SPM/Gradle/npm) to the 4.x SDK versions for your platform and remove any deprecated 3.x modules you no longer need. - Update initialization to the 4.x pattern.
Make sure the SDK is initialized once, early enough to capture first-session events, and configured for the environments you actually run (dev/stage/prod). Keep keys/workspace IDs environment-specific so you don’t pollute production data with staging events. - Re-implement (or confirm) your identity flow.
At minimum:- Call
identifyimmediately after login/account creation with your stable customer identifier (usually your internal user ID; email can work but is riskier if it changes). - Ensure anonymous pre-login events are associated to the identified profile (either via the SDK’s merge behavior or your explicit handoff logic).
- On logout, reset identity in a way that prevents the next user on the same device from inheriting the previous user’s events.
- Call
- Port event tracking calls 1:1.
Keep event names and property keys identical unless you’re intentionally migrating the taxonomy. If you do change anything, plan a dual-write period (old + new) so workflows don’t go dark mid-release. - Verify device registration and push token updates.
Confirm that push tokens are registered/updated after permission prompts and app reinstalls, and that they attach to the identified profile after login. - QA in Customer.io, not just in logs.
Use a real test device and:- Create an anonymous session → fire
Viewed Product,Added to Cart. - Log in → confirm the same profile now shows both anonymous events and identified attributes.
- Trigger a test campaign (cart recovery/push) and confirm the person qualifies and receives the message.
- Create an anonymous session → fire
- Release with monitoring.
Watch event volumes and segment counts for 24–72 hours. The first sign of trouble is usually a sudden drop in “cart abandoners” or a spike in “anonymous users.”
When Should You Use This Feature
You do the 4.x upgrade when you need the newer SDK behavior, platform support, or reliability improvements—but the retention reason is usually about keeping your tracking stack modern without accumulating “silent breakage” risk.
- You’re seeing identity fragmentation. Duplicate profiles, anonymous events not merging, or push tokens tied to the wrong person will drag down recovery and repeat purchase flows.
- You’re expanding mobile-first retention. If push/in-app is becoming a bigger revenue lever, you want the latest SDK patterns so device + identity handling stays predictable.
- You’re rebuilding your event taxonomy. The upgrade is a forcing function to standardize events like
Added to Cart,Checkout Started,Order Completed, and keep properties consistent across web + app. - You’re planning a reactivation program based on app engagement. If you’re going to target “no app open in 14 days” or “viewed category but didn’t purchase,” you need accurate session/activity tracking.
Operational Considerations
SDK upgrades fail operationally when the data changes but the orchestration doesn’t. Treat this like a data pipeline change that impacts segmentation and message eligibility.
- Segmentation dependencies: audit segments that reference SDK events/attributes (e.g., “Added to Cart in last 4 hours AND not Purchased”). If event names/properties change, these segments quietly go to zero.
- Data flow timing: mobile events can arrive late (backgrounding, flaky networks). If your cart recovery journey assumes events arrive instantly, consider adding small buffers (e.g., wait 10–20 minutes before evaluating abandonment) to reduce false positives.
- Cross-platform consistency: if you track cart on web and app, align identifiers like
cart_idandproduct_idso you can suppress duplicates and avoid double-sending across channels. - Orchestration realities: during rollout, you may have a mixed population (some users on 3.x, some on 4.x). In practice, this tends to break when teams change event schemas in 4.x and forget that half the audience is still sending the old shape.
- Identity stitching edge cases: shared devices, guest checkout → account creation, and “login after browsing” are where your revenue flows live. QA those, not just a clean login path.
Implementation Checklist
If you run this list before release, you’ll catch 90% of the issues that show up as “Customer.io stopped working” after an SDK upgrade.
- 4.x SDK installed and initialized once per app lifecycle (no double-init).
- Environment keys separated (staging data never enters production workspace).
identifycalled on login/account creation with a stable customer ID.- Anonymous pre-login events merge into the identified profile (validated in Customer.io UI).
- Logout resets identity correctly (next user doesn’t inherit prior user’s events).
- Event names and property keys match the pre-upgrade tracking contract.
- Purchase event includes required fields (
order_id, value, currency, line items if you use them in messaging). - Push token registration works pre- and post-login; tokens attach to the right person.
- Key segments (cart abandoners, active buyers, lapsed buyers) show expected counts post-release.
- At least one end-to-end journey test passes (event → segment qualify → message send).
Expert Implementation Tips
The difference between a smooth upgrade and a revenue-impacting one is usually how you handle identity and schema drift during rollout.
- Dual-write when changing taxonomy. If you must rename events/properties, send both old and new for 1–2 release cycles. Then migrate segments/campaigns, then turn off the old names.
- Prefer internal user IDs over email for identify. Emails change; IDs don’t. You can still store email as an attribute for messaging.
- Gate “cart abandoned” on a stable cart identifier. If your app generates a new cart object per session, your abandonment logic will overfire. Track a persistent
cart_idand update it consistently. - Add a small delay before evaluating abandonment. Mobile event delivery isn’t real-time in the way web is. A short buffer reduces false abandoners and improves message relevance.
- QA with real user paths, not dev shortcuts. Test: browse → add to cart → background app → reopen → login → remove item → purchase. That’s where stitching and event ordering issues show up.
Common Mistakes to Avoid
Most mistakes aren’t “wrong code”—they’re mismatched expectations between what the SDK sends and what Customer.io workflows are built to receive.
- Changing event names during the upgrade. Your cart recovery journey is hard-coded to an event name. Rename it and the journey stops enrolling.
- Calling identify too late. If you identify after key events fire (add-to-cart, checkout-start), those events may stay on the anonymous profile and never qualify the known user for recovery.
- Not resetting identity on logout. Shared devices create cross-account contamination—messages go to the wrong person, and suppression logic breaks.
- Mixing staging and production data. One misconfigured API key can inflate active users, distort conversion rates, and ruin holdout tests.
- Assuming push “just works” after upgrade. Token registration often changes subtly; if you don’t validate tokens on real devices, you’ll only notice after push revenue drops.
- Skipping a mixed-version plan. During rollout, you’ll have 3.x and 4.x in the wild. If schemas differ, segmentation becomes inconsistent and attribution gets messy.
Summary
Upgrade to Customer.io SDK 4.x like it’s a retention infrastructure change, not a library bump. Keep identity stitching stable, keep event names/properties consistent, and validate in Customer.io with real devices and real journeys.
If you can’t prove “anonymous add-to-cart → login → recovery send” still works end-to-end, you’re not done.
Implement 4.x Upgrade with Propel
If you’re already running meaningful revenue through Customer.io, it’s worth treating the 4.x upgrade as a tracked release: schema freeze, identity QA, and post-launch monitoring tied to segment counts and message eligibility. That’s the part teams usually underestimate.
If you want help mapping your current 3.x tracking to a 4.x-safe contract (and validating it against cart recovery + repeat purchase flows), book a strategy call and we’ll walk through the migration plan and the QA path.