Skip to content

feat(ads-client): add reason parameter to report_ad per MARS /v1/t spec#7268

Merged
Almaju merged 7 commits intomozilla:mainfrom
Almaju:ads-client-report-ad
Apr 8, 2026
Merged

feat(ads-client): add reason parameter to report_ad per MARS /v1/t spec#7268
Almaju merged 7 commits intomozilla:mainfrom
Almaju:ads-client-report-ad

Conversation

@Almaju
Copy link
Copy Markdown
Contributor

@Almaju Almaju commented Mar 12, 2026

The /v1/t tracking endpoint requires a reason query parameter for report interactions. Add MozAdsReportReason enum with Inappropriate, NotInterested, and SeenTooManyTimes variants and thread it through the full stack, appending it to the callback URL before the request.

Pull Request checklist

  • Breaking changes: This PR follows our breaking change policy
    • This PR follows the breaking change policy:
      • This PR has no breaking API changes, or
      • There are corresponding PRs for our consumer applications that resolve the breaking changes and have been approved
  • Quality: This PR builds and tests run cleanly
    • Note:
      • For changes that need extra cross-platform testing, consider adding [ci full] to the PR title.
      • If this pull request includes a breaking change, consider cutting a new release after merging.
  • Tests: This PR includes thorough tests or an explanation of why it does not
  • Changelog: This PR includes a changelog entry in CHANGELOG.md or an explanation of why it does not need one
    • Any breaking changes to Swift or Kotlin binding APIs are noted explicitly
  • Dependencies: This PR follows our dependency management guidelines
    • Any new dependencies are accompanied by a summary of the due diligence applied in selecting them.

@Almaju Almaju force-pushed the ads-client-report-ad branch from 9dfccc0 to 4dfc45d Compare March 18, 2026 21:20
Almaju added 3 commits April 2, 2026 13:50
The /v1/t tracking endpoint requires a `reason` query parameter for
report interactions. Add MozAdsReportReason enum with Inappropriate,
NotInterested, and SeenTooManyTimes variants and thread it through
the full stack, appending it to the callback URL before the request.
…gration tests against prod

Switch integration tests from staging to production. Add tests that
request tile ads and use the returned callback URLs to verify
record_impression, record_click, and report_ad each return 200.
@Almaju Almaju force-pushed the ads-client-report-ad branch from 3b715db to 934eb44 Compare April 2, 2026 17:56
Almaju added 2 commits April 2, 2026 14:55
… URLs

Add `add_placement_info_to_report_callbacks` on `AdResponse`, mirroring
the existing `add_request_hash_to_callbacks` pattern. Called right after
it in `request_ads`, it appends `placement_id` and 0-based `position`
to each ad's report URL at parse time so `report_ad` sends all three
params required by the MARS /v1/t spec without any API change.
@Almaju Almaju marked this pull request as ready for review April 2, 2026 19:12
Copy link
Copy Markdown

@copyrighthero copyrighthero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed to be working locally; there is a unit test unrelated to our change failing as an FYI; if those two comments turned out to be non-issue then we can proceed with the merge! 🎊 Great works!

Comment thread components/ads-client/src/client/ad_response.rs
Comment thread components/ads-client/src/client.rs
@Almaju Almaju enabled auto-merge April 8, 2026 16:12
Copy link
Copy Markdown

@copyrighthero copyrighthero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nicely done! 🙌

@Almaju Almaju added this pull request to the merge queue Apr 8, 2026
Merged via the queue into mozilla:main with commit 47fa0cf Apr 8, 2026
15 checks passed
@Almaju Almaju deleted the ads-client-report-ad branch April 8, 2026 17:18
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.

2 participants