From e279de1f22212538403a04786d97610dbb5b6c40 Mon Sep 17 00:00:00 2001 From: Gilles Moris Date: Wed, 28 Aug 2024 14:05:18 +0200 Subject: [PATCH 1/4] Report slate --- conviva/src/utils/Utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conviva/src/utils/Utils.ts b/conviva/src/utils/Utils.ts index a1496621..393eaeff 100644 --- a/conviva/src/utils/Utils.ts +++ b/conviva/src/utils/Utils.ts @@ -178,7 +178,7 @@ export function collectAdMetadata(ad: Ad): ConvivaMetadata { // [Preferred] A boolean value that indicates whether this ad is a Slate or not. // Set to "true" for Slate and "false" for a regular ad. By default, set to "false" - adMetadata['c3.ad.isSlate'] = 'false'; + adMetadata['c3.ad.isSlate'] = `${Boolean(ad.isSlate)}`; // [Preferred] Only valid for wrapper VAST responses. // This tag must capture the "first" Ad Id in the wrapper chain when a Linear creative is available or there is From 5f00e298704c1e8215f33c76c02bfe375ff9bc8f Mon Sep 17 00:00:00 2001 From: Gilles Moris Date: Wed, 28 Aug 2024 15:21:19 +0200 Subject: [PATCH 2/4] Base CSAI vs SSAI conviva reporting on ad(break) integration --- conviva/src/integration/ads/AdReporter.ts | 6 +++--- conviva/src/utils/Utils.ts | 22 ++++++++++++++++++++-- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/conviva/src/integration/ads/AdReporter.ts b/conviva/src/integration/ads/AdReporter.ts index 43cd8697..c375d670 100644 --- a/conviva/src/integration/ads/AdReporter.ts +++ b/conviva/src/integration/ads/AdReporter.ts @@ -35,7 +35,7 @@ export class AdReporter { private readonly onAdBreakBegin = (event: any) => { this.currentAdBreak = event.ad as AdBreak; this.convivaVideoAnalytics.reportAdBreakStarted( - calculateAdType(this.player), + calculateAdType(this.currentAdBreak), Constants.AdPlayer.CONTENT, calculateCurrentAdBreakInfo(this.currentAdBreak, this.adBreakCounter) ); @@ -67,7 +67,7 @@ export class AdReporter { this.contentInfo()[Constants.ASSET_NAME] ?? this.player.source?.metadata?.title ?? 'NA'; // [Required] The ad technology as CLIENT_SIDE/SERVER_SIDE - adMetadata['c3.ad.technology'] = calculateAdType(this.player); + adMetadata['c3.ad.technology'] = calculateAdType(currentAd); this.convivaAdAnalytics.setAdInfo(adMetadata); this.convivaAdAnalytics.reportAdLoaded(adMetadata); @@ -80,7 +80,7 @@ export class AdReporter { this.convivaAdAnalytics.reportAdMetric(Constants.Playback.BITRATE, (currentAd as GoogleImaAd).bitrate || 0); // Report playing state in case of SSAI. - if (calculateAdType(this.player) === Constants.AdType.SERVER_SIDE) { + if (calculateAdType(currentAd) === Constants.AdType.SERVER_SIDE) { this.convivaAdAnalytics.reportAdMetric(Constants.Playback.PLAYER_STATE, Constants.PlayerState.PLAYING); } }; diff --git a/conviva/src/utils/Utils.ts b/conviva/src/utils/Utils.ts index 393eaeff..48598129 100644 --- a/conviva/src/utils/Utils.ts +++ b/conviva/src/utils/Utils.ts @@ -25,8 +25,26 @@ export function collectDeviceMetadata(): ConvivaDeviceMetadata { }; } -export function calculateAdType(player: ChromelessPlayer) { - return player.source?.ads?.length ? Constants.AdType.CLIENT_SIDE : Constants.AdType.SERVER_SIDE; +export function calculateAdType(adOrBreak: Ad | AdBreak) { + switch (adOrBreak.integration) { + case 'theoads': { + // TODO: THEOads is a Server-Guided Ad Insertion (SGAI) solution, which can't be reported to Conviva as such yet. + return Constants.AdType.SERVER_SIDE; + } + case undefined: + case '': + case 'csai': + case 'theo': // Deprecated + case 'google-ima': + case 'spotx': + case 'freewheel': { + return Constants.AdType.CLIENT_SIDE; + } + default: { + // CustomAdIntegrationKinds are server side ad connectors. + return Constants.AdType.SERVER_SIDE; + } + } } export function calculateVerizonAdBreakInfo(adBreak: VerizonMediaAdBreak, adBreakIndex: number): ConvivaAdBreakInfo { From d0e86c99c94def8253247ec4e217d98683915fbb Mon Sep 17 00:00:00 2001 From: Gilles Moris Date: Wed, 28 Aug 2024 15:24:24 +0200 Subject: [PATCH 3/4] Add changeset --- .changeset/chilled-knives-relax.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/chilled-knives-relax.md diff --git a/.changeset/chilled-knives-relax.md b/.changeset/chilled-knives-relax.md new file mode 100644 index 00000000..99633e30 --- /dev/null +++ b/.changeset/chilled-knives-relax.md @@ -0,0 +1,5 @@ +--- +"@theoplayer/conviva-connector-web": minor +--- + +Added reporting of slate for THEOads. From 34521b2e166b371426852cefdcef59a7b7c08c7e Mon Sep 17 00:00:00 2001 From: Gilles Moris Date: Fri, 6 Sep 2024 15:31:55 +0200 Subject: [PATCH 4/4] Bump theoplayer version --- package-lock.json | 10 +++++----- package.json | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 68c77267..aa94e0b1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -33,7 +33,7 @@ "prettier": "^3.2.4", "rimraf": "^5.0.5", "rollup": "^4.14.0", - "theoplayer": "^7.4.1", + "theoplayer": "^7.12.0", "ts-jest": "^29.1.2", "ts-node": "^10.9.2", "tslib": "^2.6.2", @@ -96,7 +96,7 @@ }, "nielsen": { "name": "@theoplayer/nielsen-connector-web", - "version": "1.1.2", + "version": "1.2.0", "license": "MIT", "peerDependencies": { "theoplayer": "^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0" @@ -7880,9 +7880,9 @@ "license": "MIT" }, "node_modules/theoplayer": { - "version": "7.4.1", - "resolved": "https://registry.npmjs.org/theoplayer/-/theoplayer-7.4.1.tgz", - "integrity": "sha512-sNR2lN6J/KkHlT3AIcTlledz+bKB7VLogXtzgs1fplwperohYnoqIfSeUjQk7jmCs0xJO5AxvSqR8yL5lGzQ7Q==" + "version": "7.12.0", + "resolved": "https://registry.npmjs.org/theoplayer/-/theoplayer-7.12.0.tgz", + "integrity": "sha512-Vikb20iermLQz0IZRnzwzuvzGTbpxxmIYXHJPuiwRGfP8EtaS43+94GPlxgMGYrFlvwXIa7zi1qFF+M/mCvTdQ==" }, "node_modules/tmp": { "version": "0.0.33", diff --git a/package.json b/package.json index 2676258a..df3825a6 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,7 @@ "prettier": "^3.2.4", "rimraf": "^5.0.5", "rollup": "^4.14.0", - "theoplayer": "^7.4.1", + "theoplayer": "^7.12.0", "ts-jest": "^29.1.2", "ts-node": "^10.9.2", "tslib": "^2.6.2",