Skip to content

feat(ads): send registered flag to the ad server - #6957

Merged
rebelchris merged 4 commits into
mainfrom
feat/ads-registered-flag
Oct 19, 2026
Merged

rebelchris merged 4 commits into
mainfrom
feat/ads-registered-flag

Conversation

@rebelchris

@rebelchris rebelchris commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Changes

Internal ad requests (/v1/a, /v1/a/post, /v1/a/squads_directory) now send registered=true|false so Skadi can tell signed-in viewers from anonymous ones. The use case is separate internal fallback promos for each group: sign up for anonymous viewers, and extension/app/briefing/agents for registered users.

No Skadi change is needed. Skadi already forwards non-reserved query params as QUERY_PARAMS metadata, and ad set REQUEST_METADATA targeting (dailydotdev/skadi#304) matches them. To target a group, give the ad set a REQUEST_METADATA targeting with payload {"registered":"false"} (anonymous) or {"registered":"true"} (registered).

  • lib/ads.ts: adds an optional registered option and appendRegisteredParam, wired through every placement. The sponsor strip is unchanged.
  • useAdQuery / useFetchAd: derive the flag from AuthContext. It is sent only once isAuthReady, so a logged-in user is never reported as anonymous during boot. useAdQuery adds isLoggedIn to its query key, so signing in replaces an anonymous-only ad.
  • Tests: ads.spec.ts covers every placement. The Feed.spec.tsx nock URLs include the new param.

Notes

  • Anonymous visitors mostly see post pages, so the main surfaces are the post sidebar and comment ads.
  • A request made before auth is ready has no flag, so it matches neither registered targeting. Untargeted campaigns are unaffected.

Testing

ads.spec, Feed.spec, FeedHero, PostSidebarAdWidget, SimilarSquadsWidget, SquadJoinSuggestions and fetchSponsorStripAds all pass (103/103). Lint is clean, and tsc reports no new errors.


Opened by Smith (AI) on behalf of @rebelchris.

Preview domain

https://feat-ads-registered-flag.preview.app.daily.dev

Skadi already matches any request query param against ad set
REQUEST_METADATA targeting, so passing registered=true|false lets
campaigns (e.g. internal fallback promos) target signed-in or
anonymous viewers separately.
@vercel

vercel Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
daily-webapp Ready Ready Preview Oct 19, 2026 2:20pm UTC
storybook Ready Ready Preview Oct 19, 2026 2:20pm UTC

Request Review

@rebelchris
rebelchris merged commit 907db73 into main Oct 19, 2026
13 checks passed
@rebelchris
rebelchris deleted the feat/ads-registered-flag branch October 19, 2026 14:27

This branch was successfully deployed

2 active deployments
Preview – daily-webapp — bfde7b18 Deployed Oct 19, 2026 by vercel[bot]
Preview – storybook — bfde7b18 Deployed Oct 19, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant