diff --git a/.changeset/three-cherries-swim.md b/.changeset/three-cherries-swim.md new file mode 100644 index 00000000..4bcc4f31 --- /dev/null +++ b/.changeset/three-cherries-swim.md @@ -0,0 +1,5 @@ +--- +"@theoplayer/conviva-connector-web": minor +--- + +Added 'Server Guided' ad technology. diff --git a/conviva/src/integration/ads/AdReporter.ts b/conviva/src/integration/ads/AdReporter.ts index c375d670..29392c18 100644 --- a/conviva/src/integration/ads/AdReporter.ts +++ b/conviva/src/integration/ads/AdReporter.ts @@ -5,6 +5,7 @@ import { calculateCurrentAdBreakInfo, collectAdMetadata, collectPlayerInfo, + isServerGuidedAd, updateAdMetadataForGoogleIma } from '../../utils/Utils'; @@ -67,7 +68,8 @@ 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(currentAd); + // SGAI isn't officially supported by conviva yet, overwrite with our own string for now. + adMetadata['c3.ad.technology'] = isServerGuidedAd(currentAd) ? 'Server Guided' : calculateAdType(currentAd); this.convivaAdAnalytics.setAdInfo(adMetadata); this.convivaAdAnalytics.reportAdLoaded(adMetadata); diff --git a/conviva/src/utils/Utils.ts b/conviva/src/utils/Utils.ts index ac8c2a04..7448c838 100644 --- a/conviva/src/utils/Utils.ts +++ b/conviva/src/utils/Utils.ts @@ -28,6 +28,10 @@ export function collectDeviceMetadata(): ConvivaDeviceMetadata { }; } +export function isServerGuidedAd(adOrBreak: Ad | AdBreak) { + return adOrBreak.integration === 'theoads'; +} + export function calculateAdType(adOrBreak: Ad | AdBreak) { switch (adOrBreak.integration) { case 'theoads': { diff --git a/conviva/test/pages/main_esm.html b/conviva/test/pages/main_esm.html index 8fd06d34..36b03565 100644 --- a/conviva/test/pages/main_esm.html +++ b/conviva/test/pages/main_esm.html @@ -3,8 +3,10 @@ Connector test page - - + + + +
@@ -15,7 +17,7 @@ ui: { fluid: true }, - libraryLocation: '/node_modules/theoplayer/', + libraryLocation: './../../../node_modules/theoplayer/', license: "CUSTOMER_LICENSE_GOES_HERE" }); diff --git a/conviva/test/pages/main_umd.html b/conviva/test/pages/main_umd.html index d3146abf..e9e7b47b 100644 --- a/conviva/test/pages/main_umd.html +++ b/conviva/test/pages/main_umd.html @@ -3,9 +3,10 @@ Connector test page - - - + + + + @@ -16,7 +17,7 @@ ui: { fluid: true }, - libraryLocation: '/node_modules/theoplayer/', + libraryLocation: './../../../node_modules/theoplayer/', license: "CUSTOMER_LICENSE_GOES_HERE" });