From 851e9fcf6de5b02253ab88e38e8ed9d093852d3b Mon Sep 17 00:00:00 2001 From: Jeroen Veltmans Date: Fri, 29 Nov 2024 11:39:37 +0100 Subject: [PATCH] Improve calculateAdTypeAsString --- .../android/connector/analytics/conviva/ads/AdReporter.kt | 5 +---- .../android/connector/analytics/conviva/utils/Utils.kt | 3 +++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/connectors/analytics/conviva/src/main/java/com/theoplayer/android/connector/analytics/conviva/ads/AdReporter.kt b/connectors/analytics/conviva/src/main/java/com/theoplayer/android/connector/analytics/conviva/ads/AdReporter.kt index 0787437..559abd8 100644 --- a/connectors/analytics/conviva/src/main/java/com/theoplayer/android/connector/analytics/conviva/ads/AdReporter.kt +++ b/connectors/analytics/conviva/src/main/java/com/theoplayer/android/connector/analytics/conviva/ads/AdReporter.kt @@ -263,10 +263,7 @@ class AdReporter( // - `c3.csid`: the content’s sessionID; // - `contentAssetName`: the content's assetName. val contentAssetName = convivaHandler.contentAssetName - val adTechnology = - if (ad.integration == AdIntegrationKind.THEO_ADS) "Server Guided" else calculateAdTypeAsString( - ad - ) + val adTechnology = calculateAdTypeAsString(ad) var adMetadata = collectAdMetadata(ad) + mapOf( "c3.csid" to convivaVideoAnalytics.sessionId.toString(), "contentAssetName" to contentAssetName, diff --git a/connectors/analytics/conviva/src/main/java/com/theoplayer/android/connector/analytics/conviva/utils/Utils.kt b/connectors/analytics/conviva/src/main/java/com/theoplayer/android/connector/analytics/conviva/utils/Utils.kt index 5cf2df6..250fa2e 100644 --- a/connectors/analytics/conviva/src/main/java/com/theoplayer/android/connector/analytics/conviva/utils/Utils.kt +++ b/connectors/analytics/conviva/src/main/java/com/theoplayer/android/connector/analytics/conviva/utils/Utils.kt @@ -31,6 +31,9 @@ fun calculateAdType(adBreak: AdBreak): ConvivaSdkConstants.AdType { } fun calculateAdTypeAsString(ad: Ad): String { + if (ad.integration == AdIntegrationKind.THEO_ADS) { + return "Server Guided" + } return when (calculateAdType(ad)) { ConvivaSdkConstants.AdType.SERVER_SIDE -> "Server Side" ConvivaSdkConstants.AdType.CLIENT_SIDE -> "Client Side"