When users press the back button to exit the app, a Rewarded Interstitial Ad is shown. This is a longer-duration ad that can't be skipped immediately, maximizing ad revenue from exit attempts.
- Longer Duration: 15-30 seconds (vs 5 seconds for regular interstitial)
- Non-Skippable Initially: User must watch for several seconds before skip button appears
- Higher Revenue: Typically pays 2-5x more than regular interstitials
- User-Friendly: Only shows when user is already leaving the app
// Test Ad Unit ID (in useExitAd.ts)
const TEST_AD_UNIT_ID = TestIds.REWARDED_INTERSTITIAL;
// Test ID Value: ca-app-pub-3940256099942544/5354046379- User presses back button on main screen
- Exit ad loads (if not already loaded)
- Ad shows immediately (full-screen rewarded interstitial)
- User watches ad (15-30 seconds, can't skip initially)
- Ad closes → App exits
Back Button Press
↓
Check if ad loaded?
↓ YES
Show Rewarded Interstitial
↓
User watches/closes ad
↓
BackHandler.exitApp()
Back Button Press
↓
Check if ad loaded?
↓ NO
Load ad for next time
↓
Allow immediate exit
hooks/useExitAd.ts- Exit ad hook with back button handling
App.tsx- Integrated useExitAd hook
import { useExitAd } from './hooks/useExitAd';
// In your App component
export default function App() {
// Enable exit ad on back button
useExitAd({ enabled: true });
// ... rest of your app
}useExitAd({
enabled: true, // Enable/disable exit ads
adUnitId: 'custom-id' // Optional: custom ad unit ID
});-
Build the app (native build required)
eas build --profile development --platform android
-
Install on device
-
Open the app
-
Press back button (hardware back button)
-
Expected behavior:
- Full-screen ad appears
- Ad plays for 15-30 seconds
- Skip button appears after ~5 seconds
- Closing ad exits the app
adb logcat | grep -i "exit ad\|rewarded"Expected logs:
✅ Exit ad (Rewarded Interstitial) loaded successfully
🚪 Back button pressed (attempt 1), showing exit ad...
🎁 User earned reward: [reward details]
🚪 Exit ad closed
- Go to AdMob Console
- Select your app
- Click Ad units → Add Ad Unit
- Select Rewarded Interstitial
- Name it: "Exit Ad - Rewarded Interstitial"
- Copy the ad unit ID
In hooks/useExitAd.ts:
// Replace this:
const TEST_AD_UNIT_ID = TestIds.REWARDED_INTERSTITIAL;
// With your production ID:
const PRODUCTION_AD_UNIT_ID = 'ca-app-pub-XXXXXXXXXXXXXXXX/YYYYYYYYYY';
// Update usage:
const adUnitId = options?.adUnitId || PRODUCTION_AD_UNIT_ID;Before going live:
- Add your device as test device in AdMob console
- Build with production ad unit ID
- Test that ad shows correctly
- Never click your own ads!
Assumptions:
- 1,000 daily active users
- 50% exit via back button = 500 exit ad impressions
- $5 CPM for rewarded interstitial (higher than regular)
Calculation:
- Daily: 500 impressions / 1,000 × $5 = $2.50/day
- Monthly: $2.50 × 30 = $75/month
Combined with other ads:
- Banner ads: ~$300/month
- Regular interstitials: ~$100/month
- Exit ads: ~$75/month
- Total: ~$475/month
- Load Early: Ad loads on app start, ready for back button
- High Fill Rate: Test ads ensure it always loads
- Non-Intrusive: Only shows when user is leaving anyway
- User-Friendly: Doesn't disrupt normal app usage
- Only shows when user is exiting (not intrusive)
- Doesn't interrupt app usage
- Higher revenue per impression
- Still allows exit (ad can be closed)
- Slightly delays app exit
- User might find it annoying if happening too often
- Must balance revenue vs user retention
- Don't Abuse It: Only show on actual exit attempts
- Quick Exit Path: Allow closing after a few seconds
- Test Frequency: Monitor if users uninstall due to exit ads
- A/B Testing: Test with/without to measure retention impact
// In App.tsx
useExitAd({ enabled: false }); // Disable exit adsCurrently shows every time user presses back button. To reduce frequency:
// In useExitAd.ts, modify the back handler:
if (isLoaded && rewardedInterstitial && Math.random() < 0.5) {
// Only show 50% of the time
rewardedInterstitial.show();
return true;
}Show ad only after multiple back presses:
const MIN_ATTEMPTS_BEFORE_AD = 2;
if (exitAttempts.current >= MIN_ATTEMPTS_BEFORE_AD && isLoaded) {
// Show ad only after 2nd back press
rewardedInterstitial.show();
exitAttempts.current = 0; // Reset
return true;
}Check:
- Is the app built natively? (Not Expo Go)
- Are you using test ad unit ID?
- Check console for "Exit ad loaded" message
- Is internet connected?
Fix:
# Check logs
adb logcat | grep -i "exit ad"
# Expected:
# ✅ Exit ad (Rewarded Interstitial) loaded successfullyIssue: Ad UI might be stuck
Fix:
- Wait 30 seconds (max ad duration)
- Check for close button (usually top-right)
- Restart app and try again
Issue: Back handler might be conflicting
Fix:
// Disable temporarily to debug
useExitAd({ enabled: false });- Exit ad loads on app start
- Back button triggers ad
- Ad plays for reasonable duration
- Skip button appears
- Closing ad exits app
- Ad reloads for next exit attempt
- No crashes or freezes
- Logs show successful loading/showing
- Production ad unit ID configured
- Test device added to AdMob
- Ad shows with real content
- Revenue tracking in AdMob dashboard
- User retention metrics stable
- No user complaints about excessive ads
- Show Rate: % of back presses that show ad
- Completion Rate: % of users who watch full ad
- Skip Rate: % of users who skip ad
- Revenue Per User: Average earnings per active user
- Retention Impact: User retention before/after exit ads
Monitor in AdMob console:
- Impressions (should match exit attempts)
- Click-through rate (CTR)
- Revenue per 1000 impressions (RPM)
- Fill rate (should be ~100% with test ads)
A: Possibly, but it only shows when they're leaving anyway. Monitor retention metrics.
A: Rewarded interstitials typically earn $3-7 CPM, so $50-100/month for 1000 daily users.
A: Yes, they can skip after a few seconds or close the ad.
A: Yes, with iOS test ad unit ID. Currently only Android is configured.
A: Currently every exit attempt. Consider reducing to 50% or after 2 presses.
A: App exits normally. Ad loads for next time.
✅ Implemented: Rewarded interstitial ad on back button press ✅ Test Mode: Using Google's test ad unit ID ✅ User Flow: Back button → Ad → Exit ✅ Revenue Boost: Additional $50-100/month estimated
Next Steps:
- Build and test the app
- Verify exit ad shows on back button
- Monitor user feedback
- Create production ad unit when ready
- Update with production ID
Implementation Date: 2025-10-18
Status: ✅ Ready for Testing
Test Ad Unit: TestIds.REWARDED_INTERSTITIAL