In-app Event Listeners (SDK) in Customer.io

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 want in-app messages to actually move revenue (not just look pretty), your tracking has to be tight—especially around identity and the exact moments people hesitate or convert. With Customer.io in-app event listeners, you wire your mobile/web app to listen for user actions and then use those events to trigger, suppress, and personalize in-app experiences; if you want a second set of eyes on your tracking plan, you can book a strategy call.

In most retention programs, we’ve seen in-app fall apart for one reason: teams trigger messages off “page viewed” type events, but they don’t stitch identity correctly—so the user sees the wrong message, at the wrong time, or sees it twice across devices.

How It Works

Think of in-app event listeners as the bridge between what a customer is doing inside your product and what Customer.io can react to in real time. Your app emits events (and updates identity), Customer.io receives them, and your in-app messages and Journeys use those signals to decide who sees what, when.

  • SDK initializes in your app and starts capturing app context (like screen views) and any custom events you send.
  • You identify the user (or keep them anonymous) so Customer.io can attach events to the right profile and stitch activity when they log in or enter an email.
  • You track events like product_viewed, added_to_cart, checkout_started, order_completed, or retention-specific moments like replenishment_reminder_opened.
  • In-app messages listen for those events as triggers and use additional rules (segments, frequency caps, suppression events) to avoid spamming and to stay relevant.
  • Identity stitching is the make-or-break: anonymous browsing becomes known behavior after login/submit-email, so cart and product interest don’t get lost.

Real D2C scenario: a shopper adds a skincare bundle to cart on mobile, gets distracted, and comes back later. If you track added_to_cart anonymously but never merge that activity when they enter email at checkout, your “complete your cart” in-app prompt won’t fire (or fires on the wrong profile). Proper identify + merge keeps the cart recovery experience intact.

Step-by-Step Setup

The goal here isn’t “send more events.” It’s to instrument the handful of events that map cleanly to retention outcomes—cart recovery, second purchase, replenishment, winback—and make sure every event lands on the right person.

  1. Install the right Customer.io SDK for your app
    Add the Customer.io SDK for iOS/Android (or your wrapper like React Native/Flutter). Confirm you’re using the same workspace/environment you’ll build in-app messages and Journeys in.
  2. Initialize the SDK at app start
    Do this early in the app lifecycle so you don’t miss first-session events (especially app_opened, landing screen views, and first product discovery).
  3. Decide your identity strategy (anonymous first vs known first)
    If users browse before login, start anonymous and then call identify when you capture a stable identifier (email, customer ID). If users authenticate immediately, identify on login.
  4. Call identify with a stable ID and key attributes
    Send a single, durable identifier (e.g., customer_id) and keep it consistent across platforms. Add attributes that matter for retention logic: first_order_date, last_order_date, subscription_status, loyalty_tier, skin_type, etc.
  5. Track your “money events” with clean naming and payloads
    Instrument events that support decisions, not vanity. For D2C, the baseline set usually includes:
    • product_viewed (include product_id, category, price)
    • added_to_cart (include cart_id, items, value)
    • checkout_started (include cart_id, value)
    • order_completed (include order_id, value, items)
  6. Implement merge behavior for anonymous → known users
    In practice, this tends to break when the app creates a new profile on identify instead of merging anonymous activity. Validate that pre-login events appear on the final known profile after identify.
  7. Configure in-app message triggers based on tracked events
    Example: trigger an in-app message when added_to_cart fires, but only if order_completed hasn’t happened within X hours and the user hasn’t dismissed the message recently.
  8. QA with real devices and real flows
    Run through: anonymous browse → add to cart → background app → return → login/enter email → purchase. Confirm events, identity, and message eligibility behave exactly once.

When Should You Use This Feature

In-app event listeners earn their keep when timing and context matter—when an email is too slow or too detached from what the customer is doing right now. You’re using the SDK to catch intent signals and respond before the customer leaves the app.

  • Cart recovery inside the session: show a reminder or incentive only after checkout_started and a period of inactivity, and suppress if order_completed fires.
  • Second-purchase acceleration: after order_completed, listen for product_viewed events in the next 7–14 days and surface a “pairs well with” in-app module for high-LTV categories.
  • Replenishment + reactivation: if a user opens the app after 45 days and views the same category they previously bought, trigger an in-app nudge tied to their last purchased SKU family.
  • Subscription save: listen for manage_subscription_opened or cancel_clicked and show a save offer or education flow before they churn.

Operational Considerations

Once the SDK is live, the hard part becomes operational: keeping events consistent, segments stable, and orchestration clean across in-app + email + SMS. The teams that win treat tracking like a product surface, not a one-time integration.

  • Segmentation depends on event quality: if added_to_cart sometimes fires without value or items, your “high-intent cart” segment will be noisy and your in-app offers will leak margin.
  • Identity stitching across devices: shoppers browse on mobile and buy on desktop. Use the same identifier everywhere (web + app) so “already purchased” suppression works and you don’t show cart recovery after conversion.
  • Event volume and deduping: screen events can explode volume and create accidental triggers. Prefer explicit business events (cart, checkout, purchase) and dedupe with IDs like cart_id and order_id.
  • Orchestration realities: decide which channel owns the moment. If in-app handles “save the cart now,” email/SMS should pivot to “still thinking?” later—driven by the same events, not separate logic.
  • Latency and offline behavior: mobile events may queue and arrive late. Build triggers with small buffers (minutes, not seconds) and use suppression events to prevent stale prompts.

Implementation Checklist

Before you build clever in-app experiences, lock the fundamentals. This checklist is what we use to avoid the classic “it works in staging” trap.

  • SDK installed and initialized early in app lifecycle
  • identify implemented with a stable cross-platform identifier
  • Anonymous → known merge validated with a real user journey
  • Core retention events tracked: product_viewed, added_to_cart, checkout_started, order_completed
  • Event payloads standardized (IDs, value, currency, items array)
  • Suppression events defined (at minimum order_completed and message dismissal)
  • Frequency caps set for in-app messages to prevent repeat exposure
  • QA plan covers edge cases: background/foreground, reinstall, logged-out browsing, multi-device

Expert Implementation Tips

Most teams don’t lose performance because their creative is weak—they lose it because the tracking semantics don’t match how people actually shop. Tighten the semantics and your in-app program gets easier to scale.

  • Track intent, not just navigation: product_viewed is fine, but size_selected, quiz_completed, or delivery_date_checked often predicts purchase better for D2C.
  • Use IDs everywhere: include product_id, variant_id, cart_id, order_id. Without them, dedupe and suppression become guesswork.
  • Design for suppression first: build the “stop conditions” (purchase, unsubscribe, dismissed, already redeemed) before you launch the trigger.
  • Make one event the source of truth for purchase: if you have both client-side and server-side purchase events, pick a primary and use the other for reconciliation—otherwise you’ll double-trigger post-purchase flows.
  • Version your event names: when you inevitably change payload shape, add a new event (e.g., added_to_cart_v2) and migrate triggers deliberately instead of breaking live campaigns.

Common Mistakes to Avoid

The fastest way to burn trust with in-app is to show messages that ignore what the customer just did. These are the mistakes that usually cause that.

  • Calling identify too late: if you only identify after purchase, all the pre-purchase intent is stranded on an anonymous profile.
  • Using email as the only identifier: emails change and aren’t always available on mobile. Use a durable internal customer ID and attach email as an attribute.
  • Triggering off noisy screen events: you’ll fire messages repeatedly and end up adding aggressive frequency caps that kill legitimate opportunities.
  • No dedupe keys: without cart_id/order_id, you can’t reliably prevent repeated prompts when events fire multiple times.
  • Not testing anonymous merge: everything looks fine for logged-in QA accounts, then real shoppers (who browse anonymously) never qualify.
  • Channel conflicts: in-app says “10% off now” while SMS says “free shipping” because each channel runs off different triggers and timing.

Summary

If you want in-app to drive repeat purchase and recovery, implement the SDK with a retention-first event plan and a ruthless focus on identity stitching. Track a small set of high-signal events, build suppression rules before triggers, and QA anonymous-to-known flows like a revenue-critical checkout path.

Implement In App Actions with Propel

Once your SDK events and identity are solid, the next step is operationalizing them into clean orchestration—so in-app, email, and SMS all react to the same truth without stepping on each other. If you’re building this on Customer.io and want an operator’s take on event design, merge behavior, and trigger/suppression patterns, you can book a strategy call.

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