Repository navigation
feat(ads): send registered flag to the ad server - #6957
Merged
Merged
Conversation
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.
|
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
Internal ad requests (
/v1/a,/v1/a/post,/v1/a/squads_directory) now sendregistered=true|falseso 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_PARAMSmetadata, and ad setREQUEST_METADATAtargeting (dailydotdev/skadi#304) matches them. To target a group, give the ad set aREQUEST_METADATAtargeting with payload{"registered":"false"}(anonymous) or{"registered":"true"}(registered).lib/ads.ts: adds an optionalregisteredoption andappendRegisteredParam, wired through every placement. The sponsor strip is unchanged.useAdQuery/useFetchAd: derive the flag fromAuthContext. It is sent only onceisAuthReady, so a logged-in user is never reported as anonymous during boot.useAdQueryaddsisLoggedInto its query key, so signing in replaces an anonymous-only ad.ads.spec.tscovers every placement. TheFeed.spec.tsxnock URLs include the new param.Notes
registeredtargeting. Untargeted campaigns are unaffected.Testing
ads.spec,Feed.spec,FeedHero,PostSidebarAdWidget,SimilarSquadsWidget,SquadJoinSuggestionsandfetchSponsorStripAdsall 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