Closed Bug 1875533 Opened 2 years ago Closed 2 years ago

Exposure event: Hidden exposures are overcounted

Categories

(Firefox :: Address Bar, defect, P2)

defect

Tracking

()

RESOLVED FIXED
124 Branch
Tracking Status
firefox124 --- fixed

People

(Reporter: adw, Assigned: adw)

References

Details

(Whiteboard: [sng])

Attachments

(1 file)

Via Wil: The higher-placement sponsored experiment revealed that hidden exposures are recorded much more often than visible exposures. We seem to be recording hidden exposures for results that ultimately would not have been shown. Wil and I took a look at the relevant code and think we found two problematic call sites:

  1. Here: The result would not have been shown until this line a little farther down is reached
  2. Here: Similarly, the result wouldn't have been shown until this line farther down is reached

When fixing this, we'll need to be careful to prevent hidden exposures from affect the view. The second call site in particular has some logic (seenMisplacedResult, newVisibleSpanCount) before determining whether the newly created result can be shown.

I'd also like to try writing a test that exercises every possible code path with exposures shown vs. hidden to make sure hidden exposures are recorded exactly when visible exposures are.

Whiteboard: [snt]
Whiteboard: [snt] → [sng]

This fixes the two #addExposure() calls in UrlbarView.#updateResults() so
that hidden exposures are properly counted. Right now we overcount them because
we record them in cases where the result would not have been shown anyway.

The new test tries to cover all possible UrlbarView.#updateResults() paths:

  • When the view is full and a new result can't replace any of the old rows, the
    new result is appended and hidden. If the query is then canceled, the new row
    will never be shown
  • When the vew isn't full, a new row can be appended and visible immediately
  • When a new row replaces an old row, it can be visible immediately
Pushed by dwillcoxon@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/dbbe4b876890 Properly count hidden urlbar result exposures. r=mak,wstuckey
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 124 Branch
Regressions: 1886175
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: