VAST tracking events / Linear
timeSpentViewing VAST tracking event
Short answer: Existed only in VAST 4.0. Removed in 4.1. Introduced in VAST 4.0. Removed in VAST 4.1.
When it fires
A 4.0-only event for time spent viewing. It did not survive into 4.1. A 4.1 tag that still emits it is silently ignored. Prefer quartiles and progress.
One version, then gone
timeSpentViewing existed in VAST 4.0 and was removed in 4.1. A 4.1 or later player does not call it. The URL in a 4.1 document is silently ignored, which looks like a tracker outage if you only watch the report.
The replacement is not a renamed event. Use the quartile set and progress, which survived, and overlayViewDuration for a NonLinear unit. A 4.0-only integration can keep timeSpentViewing. The version attribute on the document decides which of those is live.
Migrating a 4.0 template
Replace timeSpentViewing with the quartile set and with progress offsets at the seconds you actually report. There is no single event that carries a duration integer for linear video after 4.0. If a vendor column was built by parsing that one URL, the vendor integration has to change. Leaving the element in a 4.1 tag keeps the column empty.
For a NonLinear unit, overlayViewDuration is the event that carries time in view, and it survived past 4.0. Do not point a linear timeSpentViewing replacement at overlayViewDuration. The containers differ, and a linear player will not fire the overlay event.
When the column stays empty
timeSpentViewing was removed in VAST 4.1. A document at that version can still contain the element, and the player has no handler, so the URL is never requested.
Each wrapper hop may include its own timeSpentViewing URL. The player requests every one of them when the event happens, so a chain of four hops produces four calls for one playback. An http URL on an https page is dropped by the browser before the ad server sees a miss. The event name can be right and the scheme can still zero the column.
Where it is valid
| 2.0 | 3.0 | 4.0 | 4.1+ |
|---|---|---|---|
| No | No | Yes | Removed |
Legal containers: Linear. An event in the wrong container is not a player error. It is a URL nobody calls.
Using it in a tag
Put it in a Linear TrackingEvents block. It is not valid on the other creative types, and a player does not fire a tracker in the wrong container.
<Linear>
<TrackingEvents>
<Tracking event="timeSpentViewing">
<![CDATA[https://track.example.com/timeSpentViewing]]>
</Tracking>
</TrackingEvents>
</Linear>VAST XML fragment only. This excerpt belongs inside a complete VAST document, so standalone validation will fail until it is wrapped in a full <VAST>response.
Related vastlint rules
- VAST-4.1-tracking-event-value: Tracking event attribute not in the valid set for this VAST version
Related events
- progress: Fires at a declared offset. The only tracking event that takes a parameter.
- complete: Fires when linear playback reaches the end of Duration.
- overlayViewDuration: Fires with how long a NonLinear overlay was in view. VAST 4.0+.
Check the XML, then confirm the beacons fire
Validate the event names and containers on the document. Test a live URL when the XML is clean and reporting is still empty.