From e6e39d1a1d49732a98f89e3b29a5aaf1e1207577 Mon Sep 17 00:00:00 2001 From: Maxim Tsoy Date: Tue, 15 Oct 2024 12:19:04 +0200 Subject: [PATCH 1/2] Revert commit f166fbddeb8c368f82b0c150a7fa0ff06031196d --- .../AdClickAttributionDetection.swift | 10 ++-------- .../AdClickAttribution/AdClickAttributionEvents.swift | 1 - .../AdClickAttribution/AdClickAttributionLogic.swift | 8 ++------ .../PrivacyConfig/Features/PrivacyFeature.swift | 1 - 4 files changed, 4 insertions(+), 16 deletions(-) diff --git a/Sources/BrowserServicesKit/ContentBlocking/AdClickAttribution/AdClickAttributionDetection.swift b/Sources/BrowserServicesKit/ContentBlocking/AdClickAttribution/AdClickAttributionDetection.swift index ccbf5ba2f..3677b2744 100644 --- a/Sources/BrowserServicesKit/ContentBlocking/AdClickAttribution/AdClickAttributionDetection.swift +++ b/Sources/BrowserServicesKit/ContentBlocking/AdClickAttribution/AdClickAttributionDetection.swift @@ -42,20 +42,17 @@ public class AdClickAttributionDetection { private let tld: TLD private let eventReporting: EventMapping? private let errorReporting: EventMapping? - private let cpmExperimentOn: Bool? public weak var delegate: AdClickAttributionDetectionDelegate? public init(feature: AdClickAttributing, tld: TLD, eventReporting: EventMapping? = nil, - errorReporting: EventMapping? = nil, - cpmExperimentOn: Bool? = nil) { + errorReporting: EventMapping? = nil) { self.attributionFeature = feature self.tld = tld self.eventReporting = eventReporting self.errorReporting = errorReporting - self.cpmExperimentOn = cpmExperimentOn } // MARK: - Public API @@ -146,12 +143,9 @@ public class AdClickAttributionDetection { domainDetection = "none" } - var parameters = [AdClickAttributionEvents.Parameters.domainDetection: domainDetection, + let parameters = [AdClickAttributionEvents.Parameters.domainDetection: domainDetection, AdClickAttributionEvents.Parameters.domainDetectionEnabled: attributionFeature.isDomainDetectionEnabled ? "1" : "0", AdClickAttributionEvents.Parameters.heuristicDetectionEnabled: attributionFeature.isHeuristicDetectionEnabled ? "1" : "0"] - if let cpmExperimentOn { - parameters[AdClickAttributionEvents.Parameters.cpmExperiment] = cpmExperimentOn ? "1" : "0" - } eventReporting?.fire(.adAttributionDetected, parameters: parameters) } } diff --git a/Sources/BrowserServicesKit/ContentBlocking/AdClickAttribution/AdClickAttributionEvents.swift b/Sources/BrowserServicesKit/ContentBlocking/AdClickAttribution/AdClickAttributionEvents.swift index e97926672..46f24a87c 100644 --- a/Sources/BrowserServicesKit/ContentBlocking/AdClickAttribution/AdClickAttributionEvents.swift +++ b/Sources/BrowserServicesKit/ContentBlocking/AdClickAttribution/AdClickAttributionEvents.swift @@ -25,7 +25,6 @@ public enum AdClickAttributionEvents { public static let heuristicDetectionEnabled = "heuristicDetectionEnabled" public static let domainDetectionEnabled = "domainDetectionEnabled" public static let count = "count" - public static let cpmExperiment = "cpmExperiment" } case adAttributionDetected diff --git a/Sources/BrowserServicesKit/ContentBlocking/AdClickAttribution/AdClickAttributionLogic.swift b/Sources/BrowserServicesKit/ContentBlocking/AdClickAttribution/AdClickAttributionLogic.swift index eb8e32104..dd3d8b532 100644 --- a/Sources/BrowserServicesKit/ContentBlocking/AdClickAttribution/AdClickAttributionLogic.swift +++ b/Sources/BrowserServicesKit/ContentBlocking/AdClickAttribution/AdClickAttributionLogic.swift @@ -207,15 +207,11 @@ public class AdClickAttributionLogic { } } - public func onRequestDetected(request: DetectedRequest, cpmExperimentOn: Bool? = nil) { + public func onRequestDetected(request: DetectedRequest) { guard registerFirstActivity, BlockingState.allowed(reason: .adClickAttribution) == request.state else { return } - var parameters: [String: String] = [:] - if let cpmExperimentOn { - parameters[AdClickAttributionEvents.Parameters.cpmExperiment] = cpmExperimentOn ? "1" : "0" - } - eventReporting?.fire(.adAttributionActive, parameters: parameters) + eventReporting?.fire(.adAttributionActive) registerFirstActivity = false } diff --git a/Sources/BrowserServicesKit/PrivacyConfig/Features/PrivacyFeature.swift b/Sources/BrowserServicesKit/PrivacyConfig/Features/PrivacyFeature.swift index d49e7dd1e..16fd070f8 100644 --- a/Sources/BrowserServicesKit/PrivacyConfig/Features/PrivacyFeature.swift +++ b/Sources/BrowserServicesKit/PrivacyConfig/Features/PrivacyFeature.swift @@ -123,7 +123,6 @@ public enum AutoconsentSubfeature: String, PrivacySubfeature { } case onByDefault - case filterlistExperiment } public enum PrivacyProSubfeature: String, Equatable, PrivacySubfeature { From 24a9bfc3cf5d174f22d86b671b041e07a1f9b448 Mon Sep 17 00:00:00 2001 From: Maxim Tsoy Date: Tue, 15 Oct 2024 12:35:54 +0200 Subject: [PATCH 2/2] Add a new CPM experiment subfeature --- .../PrivacyConfig/Features/PrivacyFeature.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Sources/BrowserServicesKit/PrivacyConfig/Features/PrivacyFeature.swift b/Sources/BrowserServicesKit/PrivacyConfig/Features/PrivacyFeature.swift index 16fd070f8..a55aea837 100644 --- a/Sources/BrowserServicesKit/PrivacyConfig/Features/PrivacyFeature.swift +++ b/Sources/BrowserServicesKit/PrivacyConfig/Features/PrivacyFeature.swift @@ -123,6 +123,7 @@ public enum AutoconsentSubfeature: String, PrivacySubfeature { } case onByDefault + case filterlistExperiment2 } public enum PrivacyProSubfeature: String, Equatable, PrivacySubfeature {