Repository navigation
feat(ads): add force_ad flag to show ads to Plus members - #7225
Merged
Merged
Conversation
Plus hides ads on every surface, so the team (mostly on Plus) never sees the ads we ship. `force_ad` (off by default) overrides that: a Plus member with it on gets ads wherever a free reader would, and every other gate (ad-free squads and sources, disableAds, viewport rules) still applies. `useIsPlusAdFree` replaces the bare `isPlus` check on the ad surfaces: feed ads and cadence, the ad template, the hero ad, the widget-rail ad, the sponsor strip, the post sidebar ad, the EX.CO player, the comment ad, engagement creatives and squad promotions. The flag is only evaluated for Plus members. The "Remove ads" upsells keep reading `isPlus`.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
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.
Changes
force_adflag, off by default. When it's on, a Plus member gets ads wherever a free reader would. The other gates still apply: ad-free squads and sources,disableAds, feed previews and viewport rules.useIsPlusAdFreehook. On the ad surfaces it replaces the plainisPluscheck, and it only evaluates the flag for Plus members. The surfaces:feed_ad_templateevaluationisPlus, so a Plus member never sees an upgrade prompt.deriveAdCadencenow takesisAdFreeinstead ofisPlus.force_adon gets ads, and a sponsor-strip test for the same case. The test fails if the override is removed.GrowthBook:
force_adis created and published. It's a boolean with defaultfalse, on in production with one force rule{"team": 1}→true. dev and api-config are off.Checks: shared and webapp
tscpass (the only shared error is the existing one inArchiveFeedPage.spec.tsx). The strict-changed guard and oxlint/oxfmt pass on the changed files. The related shared suites (125 suites) pass, and so doespnpm --filter webapp test.Events
No.
Experiment
No.
force_adis a targeting flag, not an experiment.Manual Testing
Not tested in a running app. One thing to check on a Plus account in the team after merge: the ad server may filter Plus users on its side. This PR only changes the client gates.
🤖 Opened by Smith (AI) on behalf of @idoshamun.
Preview domain
https://feat-force-ad-flag.preview.app.daily.dev