Personalized Ad Targeting - How It Works
Overview
The ad targeting system analyzes user behavior, interests, and activity to show them the most relevant ads. Similar to Facebook/Google ads, it builds a comprehensive user interest profile and matches ads based on that profile.
How User Interests Are Determined
1. Favorite Species (High Weight)
- Source:
UserFavoriteSpeciestable - Analysis: What fish species the user has marked as favorites
- Example: User favorites "Bass" → Shows ads for bass fishing gear
2. Most Caught Species (High Weight)
- Source:
CatchDetailsfromFishingLogEntries - Analysis: What species the user actually catches most often
- Example: User catches 50 bass vs 5 trout → Bass-related ads prioritized
3. Gear Brand Preferences (Very High Weight)
- Source:
GearSetups→Rod,Reel,Lure→Brand - Analysis: What brands the user actually uses in their setups
- Example:
- User has 3 setups with Shimano reels → Shows Shimano ads
- User uses Rapala lures → Shows Rapala ads
- User has St. Croix rods → Shows St. Croix ads
4. Fishing Methods (Medium Weight)
- Source:
FishingLogEntry.FishingMethod - Analysis: What fishing methods the user uses most (Trolling, Casting, Fly Fishing, etc.)
- Example: User mostly trolls → Shows trolling-specific gear ads
5. Location/Geography (Medium Weight)
- Source:
UserProfile.HomeWater,UserProfile.Location,FishingLogEntrycoordinates - Analysis: Where the user fishes most often
- Example: User fishes Lake Michigan → Shows ads for Great Lakes fishing gear
6. Social Engagement (Low-Medium Weight)
- Source:
PostLikes,Comments,PostHashtags - Analysis: What content the user engages with (hashtags, topics)
- Example: User likes posts about "ice fishing" → Shows ice fishing gear ads
7. User Role & Activity Level (Low Weight)
- Source:
User.Role,CharterCaptain,TournamentRegistrations - Analysis: Is user a charter captain? Tournament angler? How active?
- Example: Charter captain → Shows commercial fishing gear ads
8. Marketplace Activity (Low Weight)
- Source:
MarketplaceListings(purchased/sold items) - Analysis: What products they buy/sell
- Example: User buys used rods → Shows rod ads
Relevance Scoring System
When selecting an ad, the system calculates a relevance score (0-100):
Scoring Breakdown:
-
Species Match (30 points)
- Do ad's target species match user's favorites/most caught?
- Example: Ad targets "Bass", user catches bass → +30 points
-
Brand Match (25 points)
- Does ad's brand match brands user uses?
- Example: Shimano ad, user uses Shimano gear → +25 points
-
Fishing Method Match (20 points)
- Does ad's target method match user's preferred methods?
- Example: Ad for trolling gear, user trolls → +20 points
-
Location Match (15 points)
- Does ad's target location match where user fishes?
- Example: Ad targets "Great Lakes", user fishes Lake Michigan → +15 points
-
User Role Match (10 points)
- Does ad target user's role (charter captain, tournament angler)?
- Example: Ad for charter captains, user is charter captain → +10 points
Minimum Score: Ads need at least 30 points to be shown (prevents irrelevant ads)
Example: How Rapala Ad Gets Shown to User
User Profile:
- Favorite Species: Bass, Walleye
- Most Caught: Bass (45 catches), Walleye (12 catches)
- Gear Brands: Shimano (reels), St. Croix (rods), Rapala (lures) ← Key!
- Fishing Methods: Trolling, Casting
- Location: Lake Michigan, Michigan
- Role: Tournament Angler
Rapala Campaign:
- Target Species: "Bass, Walleye"
- Brand: Rapala
- Target Methods: "Trolling, Casting"
- Target Locations: "US, Michigan, Great Lakes"
- Target Roles: "TournamentAngler"
Matching Process:
- Species Match: ✅ User catches bass/walleye, ad targets bass/walleye → +30 points
- Brand Match: ✅ User uses Rapala lures, ad is for Rapala → +25 points
- Method Match: ✅ User trolls/casts, ad targets trolling/casting → +20 points
- Location Match: ✅ User fishes Lake Michigan, ad targets Great Lakes → +15 points
- Role Match: ✅ User is tournament angler, ad targets tournament anglers → +10 points
Total Score: 100/100 → Perfect match! This ad will be prioritized.
Real-World Scenarios
Scenario 1: New User (No Data)
- Profile: Empty (just signed up)
- Ads Shown: Generic ads with no targeting, or ads targeting "All Users"
- Score: ~50 points (neutral)
Scenario 2: Bass Angler
- Profile:
- Catches bass 80% of the time
- Uses Abu Garcia reels
- Fishes small lakes in Texas
- Ads Shown:
- ✅ Bass fishing gear (high score)
- ✅ Abu Garcia products (high score)
- ✅ Texas fishing gear (medium score)
- ❌ Saltwater gear (low score - filtered out)
Scenario 3: Charter Captain
- Profile:
- Charter captain
- Catches salmon, trout
- Uses Penn reels
- Fishes Lake Superior
- Ads Shown:
- ✅ Commercial fishing gear (high score)
- ✅ Penn products (high score)
- ✅ Great Lakes gear (high score)
- ✅ Charter boat equipment (high score)
Scenario 4: Gear Enthusiast
- Profile:
- Has 10+ gear setups
- Uses multiple brands (Shimano, Daiwa, St. Croix)
- Catches various species
- Ads Shown:
- ✅ Ads for brands they use (high score)
- ✅ Premium gear ads (they're gear-focused)
- ✅ New product launches (they're early adopters)
Frequency Capping
To prevent ad fatigue, the system limits how often a user sees the same ad:
- Lifetime Cap: Max impressions per user per campaign (e.g., 10 times)
- Daily Cap: Max impressions per user per day (e.g., 3 times per day)
Example: User sees Rapala ad 3 times today → Won't see it again today, but might tomorrow.
Privacy & Consent
- Anonymous Users: Only see generic ads (no targeting)
- Logged-in Users: See personalized ads based on their data
- Opt-out: Users can disable personalized ads (future feature)
- Data Usage: Only uses data user has consented to share
Performance Optimization
Caching
- User interest profiles are cached (rebuild daily)
- Reduces database queries during ad serving
- Improves response time
Batch Processing
- Interest profiles rebuilt nightly
- Campaign relevance scores pre-calculated
- Real-time updates for recent activity
Future Enhancements
- Lookalike Audiences: Find users similar to existing customers
- Retargeting: Show ads to users who visited advertiser's website
- Behavioral Signals: Track clicks, views, time spent on content
- Machine Learning: Use ML to improve relevance scoring
- A/B Testing: Test different ad creatives to see what works best
- Conversion Tracking: Track when ads lead to purchases/signups
API Usage
Get Personalized Ad
GET /api/ad-serving/next?placement=Feed&userId={userId}
What Happens:
- System builds/retrieves user interest profile
- Finds active campaigns
- Filters by basic targeting (location, demographics)
- Calculates relevance scores for each campaign
- Selects campaign with highest score
- Returns ad creative
- Records impression
Example Response
{
"adCreativeId": "creative-id",
"headline": "New Rapala X-Rap - Catch More Bass!",
"primaryText": "Perfect for trolling Lake Michigan",
"imageUrl": "https://cdn.rapala.com/banner.jpg",
"destinationUrl": "rapala.com/products/xrap",
"clickTrackingUrl": "/api/ad-serving/click/{creativeId}",
"format": "Banner"
}
Summary
The system creates a 360-degree view of each user by analyzing:
- ✅ What they like (favorite species)
- ✅ What they catch (fishing logs)
- ✅ What gear they use (gear setups)
- ✅ Where they fish (location data)
- ✅ How they fish (fishing methods)
- ✅ What they engage with (social activity)
- ✅ Who they are (role, activity level)
Then it matches ads based on relevance scores, ensuring users see ads that are:
- Relevant to their interests
- Useful for their fishing style
- From brands they already use or might like
- Not repetitive (frequency capping)
This creates a win-win: Users see relevant ads, advertisers reach the right audience, and you make more money from higher-performing ads! 🎣💰