Summarize this documentation using AI
Overview
If you want in-app messaging and push to actually move retention metrics, you need clean, real-time behavioral data flowing into Customer.io—and that starts with in-app event listeners wired through your SDK. When teams get this right, cart recovery and repeat purchase automations stop guessing and start reacting to what customers actually did in the app. If you want a second set of eyes on your tracking plan before you ship it, book a strategy call.
In practice, “event listeners” just means your app listens for meaningful moments (viewed product, added to cart, started checkout, purchased) and sends those events—plus the right user identity—into Customer.io so you can trigger journeys, suppress irrelevant messages, and personalize offers.
How It Works
Most retention programs live or die on two things: event accuracy and identity stitching. The SDK sits inside your mobile/web app, captures user actions as events, and forwards them to Customer.io with a person identifier. Customer.io then uses those events to build segments and trigger campaigns (push/in-app/email), but only if your events are consistent and tied to the right profile.
- Install the SDK in your iOS/Android/web app so you can send events directly from the client.
- Identify the user as soon as you have a stable identifier (login, account creation, or verified email/phone). This is the difference between “anonymous noise” and usable retention triggers.
- Attach event listeners to real UI/business moments (not button clicks for the sake of it). When the moment happens, you track an event with properties.
- Stitch pre-login behavior to the known user once they identify. This is where cart recovery often breaks: the cart was built anonymously, but the recovery message targets a logged-in profile.
- Use event properties (SKU, category, cart value, currency, quantity, variant, discount eligibility) to drive segmentation and dynamic content.
Real D2C scenario: A customer browses on your app during a commute, adds a bundle to cart, then closes the app. If your SDK tracks product_viewed and added_to_cart with item-level properties—and you’ve stitched identity correctly—you can send an in-app message next open (“Still thinking about the bundle? Free shipping ends tonight”) and suppress email if they purchase in the meantime.
Step-by-Step Setup
The goal here isn’t “send more events.” The goal is to send the minimum set of high-signal events that reliably power cart recovery, repeat purchase, and reactivation—without identity gaps.
- Define your retention-critical event taxonomy.
Start with:product_viewed,added_to_cart,checkout_started,purchase_completed, and one post-purchase event likeorder_shippedororder_deliveredif your system can emit it. - Install the Customer.io SDK in your app.
Do this per platform (iOS/Android/web). Align versions across platforms so event payloads stay consistent. - Implement
identifyimmediately after authentication.
Use the same stable identifier everywhere (typically your internal user ID). Pass key attributes you’ll segment on: email/phone (if available), acquisition source, first order date, VIP tier, etc. - Track anonymous events before login (carefully).
Track browsing and cart-building even when the user is anonymous, but make sure your app later merges/stitches that activity to the identified profile after login/signup. - Attach event listeners to business moments.
Examples:- On PDP load: track
product_viewedwithsku,category,price,variant. - On add-to-cart success: track
added_to_cartwithsku,quantity,cart_value. - On checkout start: track
checkout_startedwithcart_value,items(array),shipping_country. - On order confirmation: track
purchase_completedwithorder_id,revenue,items,discount_code.
- On PDP load: track
- Validate in Customer.io Activity Logs.
Confirm events appear on the right person profile, with expected properties, in the right order. - Build one “proof” journey before scaling.
Start with a cart abandonment journey that triggers oncheckout_startedand exits onpurchase_completed. This forces you to confirm identity stitching and event timing.
When Should You Use This Feature
In-app event listeners are worth the effort when you need Customer.io to respond to behavior that happens inside the app—not just what your ecommerce platform sends hours later. If you’re serious about retention, this is how you stop blasting generic promos and start orchestrating around intent.
- Cart recovery that actually suppresses correctly: Trigger on
checkout_started, exit onpurchase_completed, and suppress if the cart value drops below a threshold. - Product discovery → repeat purchase loops: Track
product_viewedandadded_to_cartto build “interested in category X” segments for replenishment and cross-sell. - Reactivation based on “silent churn” signals: If someone stops viewing products or stops adding to cart for 21–30 days, you can trigger a winback that’s tied to their last category affinity.
- Post-purchase experience that drives second order: Use
purchase_completed+ in-app events likereview_startedorsubscription_skippedto time offers and education.
Operational Considerations
Most teams don’t fail because they can’t send events—they fail because the data is inconsistent, late, or tied to the wrong identity. Treat this like infrastructure for orchestration, not a one-off tracking task.
- Segmentation depends on property hygiene: If one platform sends
cart_valueand another sendscartValue, you’ll end up with broken segments and confusing reporting. - Identity stitching is the retention unlock: Make sure anonymous browsing/cart events merge into the known profile after login. Otherwise, your abandonment flows will miss high-intent users who browse logged-out.
- Event timing affects message timing: Client-side events are fast, but purchases sometimes get confirmed server-side later. Decide which source of truth triggers “purchase completed” so you don’t send a nudge after someone paid.
- Orchestration reality: Your journey should have explicit exit criteria (purchase, unsubscribe, suppression) and guardrails (frequency caps) because in-app events can fire often.
- Debugging workflow: When something looks off, check (1) app logs, (2) Customer.io person profile activity, (3) campaign trigger conditions, (4) exit conditions.
Implementation Checklist
If you want this to drive revenue, you need a tight checklist that engineering and retention both agree on. This keeps you from shipping “tracking” that doesn’t map to any real campaign.
- SDK installed on all relevant platforms (iOS/Android/web) and versioned
identifycalled on login/signup with a stable user ID- Anonymous event capture enabled where it matters (browse/cart)
- Anonymous-to-known stitching validated with a real test account
- Core retention events implemented:
product_viewed,added_to_cart,checkout_started,purchase_completed - Event properties standardized (names, types, currency formatting, arrays)
- At least one journey built to validate end-to-end (trigger + exit + suppression)
- QA plan includes edge cases: app kill/reopen, offline mode, login after cart
Expert Implementation Tips
In most retention programs, we’ve seen the same pattern: the “basic events” are easy, but the money is in the details—especially around identity and suppression.
- Prefer “business outcome” events over UI events: Track
added_to_cartwhen the cart update succeeds, not when the button is tapped. - Send item arrays consistently: If you include
itemsoncheckout_startedandpurchase_completed, you can personalize recovery and post-purchase cross-sell without extra integrations. - Build suppression into the data model: Add properties like
is_first_order,subscription_active, ordiscount_eligibleso you’re not doing brittle logic in every journey. - Use a single canonical user ID: Email changes; phone changes. Your internal ID should not.
- Test with “messy” customer behavior: Add to cart logged-out, login, remove item, add different variant, purchase on another device. That’s where stitching and event ordering get exposed.
Common Mistakes to Avoid
These are the mistakes that create phantom abandonment, duplicate sends, and broken segments—usually discovered after you’ve already scaled spend.
- Tracking without identity: Events fire, but never attach to a real profile, so journeys don’t trigger (or trigger on the wrong person).
- Inconsistent event/property naming across platforms: iOS sends
productId, Android sendsproduct_id, and now your “viewed product” segment misses half your users. - No exit criteria: Cart recovery journeys that don’t exit on
purchase_completedwill keep nudging buyers and burn trust. - Double-counting purchases: Tracking
purchase_completedboth client-side and server-side without deduplication inflates revenue metrics and breaks frequency logic. - Over-instrumenting low-signal events: Too many events makes segmentation noisy and slows down debugging when something breaks.
Summary
If you want Customer.io to run real retention orchestration, in-app event listeners are the foundation. Get identity stitching right, standardize your event schema, and validate with one revenue-critical journey (cart recovery) before expanding. The best implementations stay simple but extremely consistent.
Implement In App Actions with Propel
Once your SDK events are clean, the next step is using them to drive in-app actions that feel timely instead of spammy—cart nudges that suppress correctly, post-purchase cross-sells based on what they actually bought, and winbacks tied to real category intent. If you’re building this on Customer.io and want an operator-level review of your tracking + orchestration plan, book a strategy call.