Report THEOads interstitial errors as failed ads to Conviva - #128
Conversation
Co-Authored-By: benny.tepfer <benny.tepfer@dolby.com>
- Report the correct POD_POSITION for failed THEOads ad breaks by deriving it from the interstitial start time, adding Post-roll handling instead of defaulting everything non-preroll to Mid-roll. - Use one shared sequential adBreakCounter for POD_INDEX in both the adBreakBegin and failed ad break paths, aligned with the web and Android connectors (previously adBreakBegin reported the time offset in seconds, and failed breaks used a separate counter). - Extract collectBaseAdMetadata() for the c3.csid and contentAssetName tags shared by successful and failed ad reporting, and replace the scattered "Server Guided" literals with the sgaiAdTechnology constant. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
|
||
| /// The position of a THEOads interstitial based on its start time. | ||
| static func calculateInterstitialAdBreakPosition(startTime: Double) -> String { | ||
| if startTime == 0 { |
There was a problem hiding this comment.
Not sure if this is enough to determine an interstitial as a preroll. Some live streams don't start at 0, and some interstitials will still behave as prerolls when presented upon joining a live stream. In that case startTime can be > 0.
There was a problem hiding this comment.
I don't think pre-roll is a "concept" for a live stream tbh with THEOads.
@tvanlaerhoven how was this concluded for web?
There was a problem hiding this comment.
@Danesz true, in practice it will always be a midroll I guess. The other cases could be omitted, or we could merge calculateCurrentAdBreakPosition and calculateInterstitialAdBreakPosition together in a later PR.
It doesn't feel like an issue to me currently. On web, the same logic is maintained.
Problem
A THEOads (SGAI) ad break can fail before any ad exists - e.g. an empty VAST response makes the ad request fail before an ad break is created. In that case no
adbreakbegin/adbegin/aderroris dispatched, only THEOads'interstitialerror, which the Conviva connector didn't listen to. Conviva therefore never saw an ad attempt, and fill rate looked like 100%.Solution
The connector now listens to interstitialerror on the THEOads integration. For ad break interstitials that fail while no ad break is active, it reports:
reportAdBreakStarted → setAdInfo → reportAdFailed(message) → reportAdBreakEnded
Errors during an ongoing break keep using the existing aderror path, so nothing is reported twice.
Implementation notes