feat(ads): rotate real campaigns on a slotless /api/ads/motd - #162
Merged
Merged
Conversation
A bare `curl https://crawlproof.com/api/ads/motd` could only ever return the house ad: serving needs a slot, because the impression row is what a later click resolves back to, so no slot meant no paid fill. Add ADS_DEFAULT_SLOT_ID — the slot credited when a request names none. Anonymous terminal traffic is the network's own inventory, so it points at CrawlProof's own publisher slot, and the endpoint now rotates real campaigns on every load. Unset, behaviour is unchanged (house ad). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
vu1nz Security Review0 finding(s) in PR #? No security issues found. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
curl https://crawlproof.com/api/ads/motdwith no?slot=could only ever return the house ad. Serving requires a slot — the impression row is what a later click resolves back to — so a slotless request had nothing to meter against and fell straight through tohouseFill.Adds
ADS_DEFAULT_SLOT_ID: the slot credited when a serving request names none. Anonymous terminal traffic is the network's own inventory, so it points at CrawlProof's own publisher slot, and the bare URL now rotates real campaigns (bid-weighted lottery, so a different ad on each load). Unset, behaviour is unchanged.Note this means clicks from the bare URL are billed to the advertiser and credited to the default slot, exactly like any other placement.
🤖 Generated with Claude Code