Triggering Referral Prompts at the Perfect Moment with Amply

Stan

02 Mar 2025

You built a referral program. You added a "Share with friends" button somewhere in the settings menu. Maybe you even offered a reward. And yet, your K-factor barely budges. Your customer acquisition cost keeps climbing, and organic growth remains a dream on a roadmap slide. Sound familiar?

Here's the uncomfortable truth: the problem isn't your referral program. It's when you ask. Research shows that 77% of users discover new apps through friend recommendations — but showing an invite screen at the wrong moment means it gets dismissed, ignored, or worse, creates friction that drives users away.

In this article, we'll walk through how to trigger referral prompts at the exact moment users are most likely to say yes — and how to wire it all up with Amply's event-driven campaign engine. No guesswork, no static timers, just behavioral precision.


The Science of Perfect Timing

When do people recommend things they love? Not when you interrupt them. Not when you pop up a modal during onboarding. They recommend things at emotional peaks — the moment right after something genuinely good happens.

Behavioral psychology calls this the "peak-end rule": people judge experiences primarily by how they felt at the most intense moment and at the end. If you surface a referral prompt during one of those peaks, you're riding a wave of positive emotion rather than fighting against indifference.

Showing an invite screen immediately after a positive experience increases referral conversion by 3-4x compared to random or time-based prompts.

The challenge is identifying these peaks programmatically. That's where event-driven triggering comes in — and it's exactly what Amply was built for.


Identifying "Positive Moments" in Your App

Every app has moments where users feel a surge of accomplishment, satisfaction, or delight. The key is mapping those moments explicitly and instrumenting them as trackable events. Here are examples across different app categories:

  • Gaming: Beating a boss, unlocking a rare item, completing a level streak
  • Fitness: Hitting a 7-day workout streak, setting a personal record, reaching a weight goal
  • E-commerce: Successful order delivery, receiving a discount reward, earning loyalty points
  • Finance: Completing a savings goal, first successful investment return, bill paid on time
  • Productivity: Finishing all daily tasks, hitting a usage milestone, completing a project

The common thread? Each of these is a concrete, detectable event that correlates with positive user sentiment. In Amply, you'll track all of them under a unified PositiveMoment event with parameters that describe the specific trigger.


Building Event-Driven Referral Campaigns with Amply

Traditional referral implementations are static: a button in the menu, maybe a banner on the home screen. Amply flips this model by letting you define campaigns that react to user behavior in real time. Here's how a referral campaign works:

Step 1: Define the Trigger Event

In the Amply dashboard, set your campaign trigger to the PositiveMoment event. This means the referral prompt will only appear immediately after your app fires that event — not on a timer, not on a screen load, but at the exact moment the user feels good.

Step 2: Set the Deeplink Action

Configure the campaign action as a deeplink to happens://invite-friends. When the campaign triggers, Amply's SDK delivers this deeplink to your app, and your deeplink handler opens the referral screen. No hardcoded navigation paths, no feature flags to manage — just a clean event-to-screen pipeline.

Step 3: Configure Impression Limits

You don't want to bombard users with referral prompts after every single achievement. In Amply, set the impression limit to 1 per device after the trigger event. You can also add a minimum time interval between impressions to keep things non-intrusive. One well-timed ask is worth more than ten annoying ones.


Targeting the Right Users

Not every user who hits a positive moment is the right candidate for a referral prompt. A first-session user who just completed the tutorial hasn't built enough loyalty to recommend your app. Someone who already invited friends doesn't need to see the prompt again. Amply's targeting rules let you be precise:

  1. Session count > 5: Only target users who have returned to your app at least five times. These are engaged users who have demonstrated genuine interest — not casual downloaders who might churn tomorrow.
  2. Negative event targeting (hasn't done "InviteSent"): Amply lets you target users who have not performed a specific event. By excluding users who have already sent an invite, you avoid redundant prompts and focus on untapped referral potential.
  3. Event parameter matching: Want to only trigger for specific achievement types? You can match on event parameters — for example, only show the referral prompt when the PositiveMoment type is achievement and the name matches 7_day_streak.

This combination ensures your referral prompt reaches exactly the right audience: loyal users who are emotionally primed and haven't been asked before. That precision is what separates a 2% invite rate from a 15% one.


Code Implementation

Let's get into the code. The Amply SDK integration for a referral campaign requires three pieces: tracking positive moments, tracking invite completions, and handling the deeplink.

Track Positive Moments

Fire the PositiveMoment event wherever your app detects a peak experience. Include parameters so you can filter campaigns by achievement type in the Amply dashboard:

// When user completes a 7-day streak
AmplySDK.track("PositiveMoment", mapOf(
    "type" to "achievement",
    "name" to "7_day_streak"
))

// When user completes a successful purchase
AmplySDK.track("PositiveMoment", mapOf(
    "type" to "transaction",
    "name" to "purchase_complete"
))

// When user beats a game level
AmplySDK.track("PositiveMoment", mapOf(
    "type" to "achievement",
    "name" to "level_cleared"
))

Track Invite Completions

When a user actually sends a referral, track the InviteSent event. This is what Amply's negative targeting uses to suppress the prompt for users who have already invited friends:

// After user successfully shares a referral link
AmplySDK.track("InviteSent")

Handle the Referral Deeplink

Register a deeplink handler with the Amply SDK. When the campaign fires, the SDK delivers the happens://invite-friends deeplink, and your handler navigates to the referral screen:

AmplySDK.setDeeplinkHandler { url ->
    if (url.contains("invite-friends")) {
        showReferralScreen()
    }
}

That's it — three small integration points. The campaign logic, targeting rules, impression limits, and timing are all managed in the Amply dashboard. No app update required to adjust when, how often, or to whom the referral prompt appears.


Results You Can Expect

Teams that switch from static referral prompts to event-driven, behaviorally-targeted campaigns consistently see dramatic improvements:

  • Invitation rate up 50%+: When you ask at the right moment, users say yes far more often. The emotional peak does the heavy lifting.
  • Lower CAC through organic growth: Every successful referral is a user you didn't pay to acquire. As your K-factor improves, your reliance on paid channels decreases.
  • Higher quality referred users: Users who arrive through friend recommendations have 37% higher retention rates and higher lifetime value compared to users acquired through ads.
  • Zero user annoyance: With impression limits and negative targeting, users never see the referral prompt more than once, and only after a positive experience. No interruptions, no spam.
The best referral programs don't feel like marketing. They feel like a natural extension of a great experience.

Conclusion

Your referral program isn't broken — its timing is. The difference between a referral prompt that gets ignored and one that drives viral growth comes down to a single question: did you ask when the user was feeling great about your app?

With Amply, you can stop guessing and start targeting. Track your app's positive moments as events, set up a campaign that triggers on those events, target loyal users who haven't invited friends yet, and let the SDK handle the rest. The result is a referral engine that works with user psychology instead of against it.

Ready to turn your happiest moments into your best growth channel? Set up your first event-driven referral campaign in the Amply dashboard today.