feat(ads-client): support content categories on ad requests (AC-109)#7390
Open
Almaju wants to merge 1 commit into
Open
feat(ads-client): support content categories on ad requests (AC-109)#7390Almaju wants to merge 1 commit into
Almaju wants to merge 1 commit into
Conversation
5b17e36 to
44bd6ae
Compare
c333f0f to
9cb7ffe
Compare
Add per-placement IAB content (taxonomy + category IDs) and a request-level `flags` object plumbed through MARSClient/AdsClient. Callers opt into flags via `MozAdsRequestOptions.flags: MozAdsRequestFlags?` (currently exposing `contextualPlacement`), with room to grow as new flags are added. The `flags` object is included in the cache key only when at least one flag opts away from its default, so non-contextual callers keep their existing cache entries.
9cb7ffe to
943fcfe
Compare
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.
Summary
Implements AC-109: support ad requests with content categories on HNT.
flags.contextual_placementflag, exposed viaMozAdsRequestOptions.contextualPlacement(defaultfalse).contentwhen unset to match the schema in the ticket exactly.Wire format produced when a caller passes both:
{ "context_id": "…", "flags": {"contextual_placement": true}, "placements": [ {"placement": "newtab_stories_v2_1", "count": 1}, {"placement": "newtab_stories_v2_3", "count": 1, "content": {"taxonomy": "IAB-3.0", "categories": ["338"]}} ] }Pull Request checklist
MozAdsRequestOptions.contextualPlacementhas a UniFFI default offalse, so existing callers compile and behave as before.cargo test -p ads-client,cargo clippy -p ads-client --all-targets -- -D warnings,cargo fmt --check).flags, mixed-content placements, flag participates in the cache hash.test_contract_image_with_categories_prod) that hits the prod MARS endpoint withiabContent+contextualPlacement: true. Run withcargo test -p ads-client-integration-tests -- --ignored.CHANGELOG.mdentry added under v153.0 → Ads Client.