Skip to content

Report THEOads interstitial errors as failed ads to Conviva - #128

Open
tvanlaerhoven wants to merge 2 commits into
mainfrom
feature/conviva/interstitialerror
Open

Report THEOads interstitial errors as failed ads to Conviva#128
tvanlaerhoven wants to merge 2 commits into
mainfrom
feature/conviva/interstitialerror

Conversation

@tvanlaerhoven

@tvanlaerhoven tvanlaerhoven commented Aug 12, 2026

Copy link
Copy Markdown
Member

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/aderror is 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

  • Ad break info comes from a calculateInterstitialAdBreakInfo() helper that reports POD_POSITION (derived from the interstitial start time: pre-roll at 0, post-roll at negative/infinite, else mid-roll), POD_DURATION and POD_INDEX. The pod index shares the same sequential counter as regular ad breaks.
  • Ad metadata shared between the successful and failed ad paths (c3.csid, contentAssetName) is collected by a single collectBaseAdMetadata() helper.
  • The ad technology is reported as "Server Guided" via one shared constant (SGAI isn't officially supported by Conviva yet). reportAdBreakStarted itself reports SERVER_SIDE on Android/iOS where the parameter is enum-typed.
  • Shipped as a new THEOplayer-Connector-Conviva/THEOads CocoaPods subspec; SPM builds compile the code out via canImport since the THEOads integration isn't an SPM dependency.

devin-ai-integration Bot and others added 2 commits August 12, 2026 11:37
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>
@tvanlaerhoven
tvanlaerhoven requested a review from Dev1an August 13, 2026 19:39
@tvanlaerhoven tvanlaerhoven added the enhancement New feature or request label Aug 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant