Measuring viewability starts after the creative has painted, not when the empty slot crosses into the viewport. The slot can be on screen while the auction is still open, while the iframe is blank, or while another element covers the rectangle you think you are selling. A buyer who paid for a seen ad did not pay for a div.
The industry definition is a threshold: a share of the pixels, for a stretch of time, inside the visible page. That definition is simple. The page is not. Refresh, sticky bars, lazy slots, and nested iframes all move the moment you are allowed to start the clock.
The slot is not the ad
IntersectionObserver will tell you that a rectangle intersects the viewport. It will not tell you that a creative is inside the rectangle. If you start the timer when the slot is inserted, you count the auction, the fetch, and the blank frame as time in view. On a fast connection that error is small. On a slow one you can record a "viewable" impression that the reader never saw.
Measuring viewability correctly means the clock starts when the creative has pixels, and it pauses when those pixels are covered or scrolled away. Occlusion matters. A sticky header, a consent banner, or another ad can cover half the unit while the slot element remains "intersecting." The observer on the slot is necessary. It is not sufficient.
Iframes make the same mistake in the other direction. The outer page knows the slot. The creative knows its own paint, and often cannot see the outer scroll. A measurement that lives only inside the iframe, or only outside it, is half a measurement. You need an agreement about which side owns the clock, and a way to throw the sample away when the two sides disagree.
Refresh starts a new impression
A refresh is not a continuation of the last view. The previous creative is gone. The next one has to paint, and it has to earn its own second in view. If the timer keeps running across the refresh, you will report a long view on an impression that existed for a fraction of it.
This is where refresh policy and measurement meet. Why refresh strategies fail is usually a story about asking too often. It is also a measurement story: each ask needs its own viewability sample, tied to the impression id of that ask, or the average becomes a blend of ads the reader saw and ads that were swapped underneath a timer that never reset.
The same rule applies to lazy slots. A unit that is reserved below the fold and then moved, or injected when the reader arrives, should not inherit a viewability state from the placeholder. The placeholder was not the ad.
Seen is not the same as attended
A creative can meet the pixel threshold while the reader is elsewhere. A long article with a rail unit will mark that unit viewable for as long as it sits in the viewport, including the minutes the reader spends in another tab. The metric is not wrong. It is incomplete.
Predicting viewability before render asks whether this request is likely to become a seen impression at all. Building an attention score asks whether the person is still with the page once it is seen. Measuring viewability is the check after the fact. The other two are reasons to hesitate before you spend a request on a slot the page already doubts.
High-viewability dynamic placements only help if "high viewability" was measured on the creative, not on the hole you left for it. A placement policy that opens because the slot is in view, and a measurement pipeline that agrees, are the same idea at two different times.
What to log
Log the impression id, the fraction of pixels, the continuous time in view, whether the creative had painted, and whether a covering element was present. Log the refresh index. Without the index, the first ad and the fourth ad in a session become one average.
Two clocks that disagree should not be averaged into a rate. If the outer page says the slot was in view for two seconds and the creative says it painted for a few hundred milliseconds, keep the shorter interval or keep nothing. Averaging them produces a number neither side of the impression can defend. A sample that only exists in the one browser where the callback is reliable will also make the placement look cleaner than the traffic is. Publish the rate on the impressions you could measure, and publish the unmeasured share beside it.
Do not treat a missing sample as viewable. A crossed origin, a browser that never fired the callback, a slot that was destroyed mid-count: those are unknown, and unknown is not a pass. Buyers can forgive an honest gap. They cannot forgive a rate that only moves upward.
Measuring viewability is engineering because the definition is a clock and a rectangle, and both are easy to start on the wrong object. Start them on the creative that was served for this impression. Everything else is a proxy, and proxies are how a layout that looks viewable in a screenshot sells a lot of unseen ads.
