Summarize this documentation using AI
Overview
If your app is still on the 3.4x Customer.io SDK, the 4.x upgrade is less about “new features” and more about protecting the data your retention program runs on—identity stitching, event consistency, and reliable device messaging. This matters because one broken identify call or a renamed event can quietly tank cart recovery and repeat purchase journeys for weeks before anyone notices.
This guide translates the 3.4x → 4.x upgrade into the moves that actually keep revenue flows stable in Customer.io. If you want a second set of eyes on your tracking plan before you ship, you can book a strategy call and we’ll pressure-test the identity + event layer against your live automations.
How It Works
In practice, most SDK upgrades “work” from an engineering perspective but still break retention because the tracking semantics change: users get logged as anonymous longer than expected, events fire before identification, or device tokens stop attaching to the right profile. The 4.x SDK is designed to be more consistent across platforms, but you still need to be deliberate about how you initialize, identify, and track events.
- Initialization comes first. The SDK needs to boot early in app lifecycle so events and push tokens don’t get lost (or attributed to the wrong person).
- Identity stitching is the real upgrade risk. Your retention flows depend on a stable person identifier (usually your internal
customer_id) and a predictable moment when anonymous activity merges into the known profile (typically at login/account creation or email capture). - Event tracking needs to stay backwards-compatible. Journeys, segments, and campaign triggers are usually keyed off event names + properties. Even “minor” changes like
productViewed→Product Viewedor changingskutoproduct_idcan strand users outside automations. - Device messaging depends on correct device registration. If tokens aren’t associated to the identified profile, push campaigns will look healthy in Customer.io but under-deliver on device.
Real D2C scenario: you run a 2-step cart abandonment flow: push at +30 minutes, email at +4 hours. If the 4.x upgrade shifts the timing so track("cart_updated") fires before identify() on first-time shoppers, Customer.io records the cart event under an anonymous profile. Your push/email never sends because the anonymous profile has no deliverable email and no token attached to the eventual logged-in user.
Step-by-Step Setup
The cleanest upgrades follow one rule: keep your tracking contract stable while you swap the SDK underneath it. That means you upgrade the library, then validate identify + core events end-to-end before you touch naming, schemas, or new instrumentation.
- Inventory your current “contract.”
- List your current
identifyidentifier (e.g.,customer_id) and the attributes you set at identify time (email, phone, marketing opt-in, timezone, etc.). - Export the event names that power retention: cart events, checkout started, purchase, product viewed, subscription created/canceled, etc.
- Note which events are used as triggers in Customer.io campaigns/segments.
- List your current
- Upgrade the SDK to 4.x in your app.
- Follow Customer.io’s 3.4x → 4.x migration steps for your platform (iOS/Android/React Native/etc.).
- Do the upgrade in a feature branch and ship to internal QA first—don’t mix this with other analytics refactors.
- Re-implement initialization as early as possible.
- Initialize on app start (not after login) so anonymous sessions still get captured.
- Confirm the environment keys/workspace settings match your production Customer.io workspace.
- Lock down
identify()timing and identifier.- Call
identifyimmediately after you have a stable user ID (login, account creation, or verified email capture). - Use the same identifier you used in 3.4x (do not switch from email → internal ID mid-upgrade unless you’re prepared to reconcile duplicates).
- Set critical attributes at identify time:
email,phone,first_name,marketing_opt_in,country,language.
- Call
- Confirm anonymous → known merge behavior.
- Run a test: open app anonymously → view product → add to cart → then log in → then trigger cart abandonment.
- Verify in Customer.io Activity Logs that pre-login events appear on the identified profile (not stranded on an anonymous profile).
- Re-validate core retention events.
- Fire your top 5–10 revenue-driving events and confirm names + properties match what your campaigns expect.
- Specifically validate:
cart_updated/checkout_started/order_completedand any subscription lifecycle events.
- Re-check device token registration for push.
- Install app fresh, accept push permission, then log in.
- Confirm the device/token is attached to the identified profile (not only to anonymous).
- Release with a staged rollout and monitoring.
- Ship to 5–10% first, monitor event volumes and campaign entry rates.
- Then ramp to 50% and finally 100% once tracking parity holds.
When Should You Use This Feature
You upgrade to 4.x when retention performance depends on app-side behavior and the current SDK is either limiting accuracy or creating identity drift. The upgrade is especially worth it when app events are the source of truth for flows (not Shopify webhooks alone).
- Cart recovery relies on app events. If “add to cart” and “checkout started” happen primarily in-app, you need 4.x tracking to be stable so abandoners actually enter journeys.
- Repeat purchase depends on product engagement. If you personalize replenishment or cross-sell based on viewed categories/collections, you need consistent
product_viewedevents tied to the right person. - Reactivation is push-led. If winback is driven by push notifications, token association and identity stitching become non-negotiable.
- You’re seeing duplicate profiles. In most retention programs, we’ve seen older SDK setups create duplicates when teams identify by email in one place and internal ID in another. Upgrading is a good forcing function to standardize.
Operational Considerations
SDK upgrades don’t fail in code—they fail in orchestration. The biggest risk is that the data feeding Customer.io segments and campaign triggers subtly changes, and your program stops targeting the right people.
- Segmentation stability: Audit segments that reference app events or device attributes. If a segment is “Viewed Product in last 7 days” and that event stops merging post-login, your engaged audiences shrink overnight.
- Data flow ordering: Ensure the app doesn’t send key events before identification in flows where you expect stitching (login, email capture, checkout). If ordering is unavoidable, you need to confirm anonymous merge is working as expected.
- Cross-device identity: If a shopper browses on mobile, then purchases on desktop, your retention program depends on a shared identifier (internal customer ID) across sources. Keep that consistent during the upgrade or you’ll split lifecycle history.
- Campaign orchestration realities: If you have “cart abandonment” running from app events and “order completed” coming from your backend/Shopify, mismatched identifiers create phantom abandoners who already purchased.
Implementation Checklist
Before you call the upgrade “done,” you want proof that identity stitching and the core revenue events behave exactly like they did on 3.4x—only more reliable.
- SDK 4.x installed and initializing on app launch
identify()uses the same primary identifier as 3.4x- Anonymous pre-login events merge into the identified profile
- Top retention events validated: product view, add to cart, checkout started, purchase
- Event properties match what Customer.io campaigns/segments expect
- Push token/device correctly attached to the identified profile
- Staged rollout plan + monitoring dashboard for event volume and campaign entry rates
Expert Implementation Tips
These are the small operator moves that prevent the “everything looks fine” upgrade that still costs you revenue.
- Create a tracking parity report before/after. Compare daily counts for your 10 most important events and campaign entry rates. If
checkout_starteddrops 20% after release, treat it like a production incident. - Instrument a “post-identify heartbeat” event. Fire a lightweight event right after
identify()(e.g.,session_identified) so you can quickly segment profiles that never properly identify. - Guard against double-identify. Repeated identify calls with different IDs is how duplicates explode. Make identify idempotent: only call when the ID changes.
- Keep event naming boring. Don’t rename events during the migration. If you want a new schema, do it in a second release with dual-tracking and a planned cutover.
Common Mistakes to Avoid
Most teams don’t notice these mistakes until cart recovery or winback performance dips and nobody can explain why.
- Tracking cart events before identity is established and assuming Customer.io will “figure it out.” Verify the merge in Activity Logs with real devices.
- Changing the primary identifier (email → internal ID, or vice versa) during the upgrade, creating duplicates and breaking historical segmentation.
- Accidentally changing event names/casing so triggers stop firing. Customer.io treats event names as exact matches.
- Not validating push token attachment after login/logout flows. Push looks “sent” but never arrives on device.
- Skipping staged rollout monitoring. If you ship 100% and event volume drops, you’re stuck doing forensics under pressure.
Summary
Upgrade to Customer.io SDK 4.x when app-side behavior is a primary driver of retention and you can’t afford identity drift or missing events.
Do the upgrade like an operator: preserve your tracking contract, validate anonymous merge, and monitor campaign entry rates—not just whether the app builds.
Implement 4.x Upgrade with Propel
If you’re treating this upgrade as a retention reliability project (not a library bump), it helps to validate the full chain: app events → identity stitching → segments → campaign entry → message delivery. That’s usually where things break in practice, especially around anonymous-to-known merges and push token attachment.
We work with D2C teams running Customer.io to ship SDK upgrades without disrupting cart recovery, repeat purchase, and reactivation flows. If you want a tight implementation plan and a QA checklist mapped to your live automations, book a strategy call.