Admob Setup
Google AdMob Setup Guide
Overview
AdMob provides banner, interstitial, and rewarded video ads for free users.
Step 1: Create AdMob Account
- Go to https://admob.google.com
- Sign in with your Google account
- Accept terms and conditions
- Complete account setup
Step 2: Create Apps in AdMob
iOS App
- Click "Apps" → "Add App"
- Platform: iOS
- "Is the app listed on a supported app store?": Yes (after published) or No (during development)
- App Name:
Civix - Save and note the App ID:
ca-app-pub-XXXXXXXXXXXXXXXX~YYYYYYYYYY
Android App
- Click "Apps" → "Add App"
- Platform: Android
- App Name:
Civix - Save and note the App ID
Step 3: Create Ad Units
For each platform (iOS and Android), create these ad units:
Banner Ad
- In your app, click "Ad Units" → "Add Ad Unit"
- Select "Banner"
- Name:
civix_banner - Save and note the Ad Unit ID
Interstitial Ad
- Select "Interstitial"
- Name:
civix_interstitial - Save and note the Ad Unit ID
Rewarded Ad
- Select "Rewarded"
- Name:
civix_rewarded - Reward settings:
- Reward amount:
1 - Reward item:
bonus_quiz
- Reward amount:
- Save and note the Ad Unit ID
Step 4: Update App Configuration
Update app.json
Replace the placeholder IDs:
{
"expo": {
"plugins": [
[
"react-native-google-mobile-ads",
{
"androidAppId": "ca-app-pub-XXXXXXXX~YYYYYYYY",
"iosAppId": "ca-app-pub-XXXXXXXX~YYYYYYYY"
}
]
]
}
}
Update lib/ads.ts
export const AD_UNIT_IDS = {
ios: {
banner: "ca-app-pub-XXXXX/XXXXX", // Your iOS banner ID
interstitial: "ca-app-pub-XXXXX/XXXXX", // Your iOS interstitial ID
rewarded: "ca-app-pub-XXXXX/XXXXX", // Your iOS rewarded ID
},
android: {
banner: "ca-app-pub-XXXXX/XXXXX", // Your Android banner ID
interstitial: "ca-app-pub-XXXXX/XXXXX", // Your Android interstitial ID
rewarded: "ca-app-pub-XXXXX/XXXXX", // Your Android rewarded ID
},
};
Step 5: App-ads.txt (Required for Production)
After your app is published, add app-ads.txt to your website:
- Create a website or use your app's landing page
- Add file at:
https://yourwebsite.com/app-ads.txt - Content:
google.com, pub-XXXXXXXXXXXXXXXX, DIRECT, f08c47fec0942fa0
(Replace with your publisher ID from AdMob)
Step 6: Ad Policies
Content Guidelines
- No incentivizing ad clicks
- No placing ads that interfere with app functionality
- No showing ads during gameplay interruptions without user consent
- Rewarded ads must give actual rewards
Placement Best Practices
- Banner: Bottom of home screen (non-intrusive)
- Interstitial: After quiz completion (natural break point)
- Rewarded: User-initiated "Watch ad for bonus quiz"
Step 7: Testing
Test Mode (Development)
The app uses test ad unit IDs in __DEV__ mode automatically:
- Banner:
ca-app-pub-3940256099942544/2934735716 - Interstitial:
ca-app-pub-3940256099942544/4411468910 - Rewarded:
ca-app-pub-3940256099942544/1712485313
Production Testing
- Add your device as a test device in AdMob
- Or use AdMob's built-in mediation test suite
- Never click your own production ads!
Ad Frequency Settings
Current settings in lib/ads.ts:
export const AD_CONFIG = {
interstitialFrequency: 3, // Show after every 3 quizzes
bannerRefreshRate: 60, // Refresh banner every 60 seconds
};
Checklist
- AdMob account created
- iOS app created in AdMob
- Android app created in AdMob
- Banner ad unit created (iOS + Android)
- Interstitial ad unit created (iOS + Android)
- Rewarded ad unit created (iOS + Android)
-
app.jsonupdated with App IDs -
lib/ads.tsupdated with Ad Unit IDs - Test ads working in development
- app-ads.txt prepared for production