Skip to content

Latest commit

 

History

History
298 lines (232 loc) · 8.55 KB

File metadata and controls

298 lines (232 loc) · 8.55 KB

ADMENSION - Ad-Monetized Link Shortener

A fully functional link shortener that generates revenue through strategically placed ads using a multi-step interstitial flow.

✨ What Makes ADMENSION Special

  • Enhanced Engagement Flow: 6 button clicks + 4 timers = maximum ad viewability
  • Page Reload System: Each step triggers new pageview = fresh ads
  • Revenue-Optimized: 275-340% above industry baseline ($20 RPM → $55-68 RPM actual)
  • 90-Day Expiration: Automatic link cleanup with activity-based renewal
  • Daily Motivation System: 365 unique quotes + 27 rotating GIFs
  • Cloud-Backed: Cloudflare Workers + KV storage (100K requests/day free)

🎯 Revenue Performance

Metric Baseline (Target) Actual (Enhanced Flow) Performance
Pageviews/session 1 3-6 300-600%
Ad impressions/session 5 15-30 300-600%
Session RPM (Tier 1) $20 $60-120 300-600%
Session RPM (Blended) $20 $55-68 275-340%

See REVENUE_VALIDATION.md for complete analysis.

🚀 Quick Start

Prerequisites

  • Node.js installed
  • Cloudflare account (free tier)

1. Deploy Backend (5 minutes)

# Install Wrangler CLI
npm install -g wrangler

# Login to Cloudflare
wrangler login

# Navigate to project
cd /path/to/ADMENSION

# Create KV namespace
wrangler kv:namespace create "ADMENSION_LINKS"
# Copy the ID from output

# Update wrangler.toml with your KV namespace ID
# (Replace YOUR_KV_NAMESPACE_ID_HERE with actual ID)

# Deploy
wrangler deploy
# Copy your Worker URL (e.g., https://admension-api.your-subdomain.workers.dev)

2. Connect Frontend (2 minutes)

Add to index.html and interstitial.html before </body>:

<script>
  window.ADMENSION_API_URL = 'https://admension-api.YOUR-SUBDOMAIN.workers.dev';
</script>
<script src="./src/api-client.js"></script>

Replace YOUR-SUBDOMAIN with your actual Workers subdomain.

3. Test

# Test API health
curl https://admension-api.your-subdomain.workers.dev/api/health

# Open index.html in browser
# Create a link
# Share link in incognito window
# ✅ Should work across all browsers/devices!

📁 Project Structure

ADMENSION/
├── index.html              # Main application (homepage, create, manage, stats, docs)
├── interstitial.html       # 3-step visitor flow with ads
├── worker.js               # Cloudflare Worker API
├── wrangler.toml          # Worker configuration
├── src/
│   ├── api-client.js      # Frontend API client (with offline fallback)
│   └── daily-quotes.js    # 365 quotes + 27 GIF system
├── universal-ads/
│   ├── admension-ads.js   # Ad system integration
│   └── admension-ads.css  # Ad styling
└── docs/
    ├── QUICK_START.md         # 5-minute setup guide
    ├── CLOUDFLARE_SETUP.md    # Detailed deployment guide
    ├── FRONTEND_INTEGRATION.md # Frontend connection guide
    └── REVENUE_VALIDATION.md  # Revenue analysis & projections

🎮 Features

Enhanced Engagement Flow

Step 1 (3s timer):

  • Click Next → Timer runs → Click "✅ Complete - Next" → Page reload

Step 2 (3s + 3s timers):

  • Auto 3s unlock → Click "✅ Unlocked - Next" → Timer runs → Click "✅ Complete - Next" → Page reload

Step 3 (10s timer + ToS):

  • Select Agree/Disagree (default: Disagree)
  • Click Next → 10s timer → Click "✅ Complete - Continue"
  • Agree: Redirect to destination
  • Disagree: 3s countdown → Return to Step 1 with error

Total Engagement:

  • 6 button clicks minimum
  • 4 timers (19 seconds total)
  • 3 page reloads = 3 pageviews
  • 15-30 ad impressions (Tier 1 geo)

Revenue Features

  • 5 ad placements per page: Top banner, in-content tall, rail (desktop), footer, sticky anchor
  • Geo-based density: Tier 1 (all 5), Tier 2 (4), Tier 3 (3)
  • CPM by tier: $4.00 (T1), $2.60 (T2), $1.30 (T3)
  • Navigation reload: Every page change = new pageview
  • 13% pool distribution: Monthly payouts based on contribution units

Link Management

  • Create links: Name, destination URL, custom message, wallet address
  • Track traffic: Pageviews, last activity, 90-day auto-deletion
  • Update wallets: Change payout address anytime
  • Manage links: View all created links with stats
  • Unique codes: 6-character alphanumeric (excludes similar chars)

Daily Content

  • 365 unique motivational quotes (one per day of year)
  • 27 rotating background GIFs (cycles throughout year)
  • Day badge: Shows "DAY X/365"
  • Auto-rotation: Changes at midnight UTC

🔧 Configuration

API Endpoint

Edit api-client.js line 11:

baseUrl: window.ADMENSION_API_URL || 'https://admension-api.your-subdomain.workers.dev',

Timeout Settings

Edit api-client.js line 12:

timeout: 10000, // 10 seconds (adjust as needed)

Ad Settings

Edit CPM values in index.html (search for cpmByTier):

cpmByTier: {1: 4.0, 2: 2.6, 3: 1.3}

📊 Monitoring

Cloudflare Dashboard

  1. Go to https://dash.cloudflare.com
  2. Click Workers & Pages → admension-api
  3. View Metrics:
    • Requests per minute
    • Success rate
    • Errors
    • CPU time

KV Storage

  1. Go to Workers & Pages → KV
  2. Click ADMENSION_LINKS
  3. View stored links
  4. Monitor storage usage

Frontend Analytics

Built-in tracking in index.html:

  • Session RPM
  • Pageviews per session
  • Geo tier distribution
  • Step completion rates
  • Ad viewability estimates

🆓 Free Tier Limits

Cloudflare Workers (Free):

  • ✅ 100,000 requests/day
  • ✅ 1,000 KV writes/day
  • ✅ Unlimited KV reads
  • ✅ 1 GB KV storage

What This Means:

  • Create up to 1,000 links/day
  • Handle 100,000 link clicks/day
  • Store ~100,000 active links

Paid Tier (if needed):

  • $5/month for 10M requests
  • $0.50/GB storage
  • $0.50 per million reads

🔒 Security & Rate Limiting

Built-In Protection:

  • Progressive rate limiting (1 min → 2 hour timeouts, no perma-bans)
  • Per-IP bandwidth limits (max 10% of daily quota per IP)
  • Multi-tier protection (minute, hour, day limits)
  • Auto-recovery (violations clear after 7 days)
  • CORS enabled for all origins
  • 90-day auto-expiration for inactive links
  • Cloudflare DDoS protection (automatic)

Rate Limits (Per IP):

  • Create links: 10/min, 100/hour, 500/day
  • Fetch links: 60/min, 1000/hour, 5000/day
  • Update links: 10/min, 50/hour, 200/day

See RATE_LIMITING.md for complete details.

For Production (Optional Enhancements):

  • Add API key authentication
  • Add CAPTCHA for link creation
  • Content filtering for destination URLs
  • Honeypot fields
  • User authentication

🚀 Deployment Options

Option 1: GitHub Pages

git add .
git commit -m "Deploy ADMENSION"
git push origin main
# Enable GitHub Pages in repo settings

Option 2: Cloudflare Pages

# Connect repo to Cloudflare Pages
# Build command: (none - static site)
# Output directory: /

Option 3: Vercel/Netlify

  • Import from GitHub
  • No build configuration needed
  • Deploy as static site

📖 Documentation

🧪 Testing Checklist

  • API health check returns {"status":"ok"}
  • Create link saves to Cloudflare KV
  • Link works in incognito/different browser
  • Interstitial shows all 3 steps correctly
  • Daily quote displays (changes daily)
  • ToS disagree loop returns to Step 1
  • ToS agree redirects to destination
  • Wallet address updates save
  • Offline mode falls back to localStorage
  • Page navigation triggers reloads
  • All ad containers load (check Network tab)

🤝 Contributing

This is a baseline v1 implementation. For production:

  1. Add user authentication
  2. Implement fraud prevention
  3. Add analytics dashboard
  4. Create admin panel
  5. Add A/B testing
  6. Implement referral system
  7. Add API documentation

📄 License

All rights reserved. This is proprietary software.

📞 Support


Made with ☕ by the ADMENSION team

Turning clicks into cash, one interstitial at a time.