Skip to content

Commit

Permalink
Add settings toggled event
Browse files Browse the repository at this point in the history
  • Loading branch information
not-a-rootkit committed Oct 9, 2024
1 parent 4e6a8da commit c64130a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Sources/PhishingDetection/PhishingDetectionEvents.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import PixelKit
public extension PixelKit {
enum Parameters: Hashable {
public static let clientSideHit = "client_side_hit"
public static let settingToggledTo = "setting_toggled_to"
}
}

Expand All @@ -30,6 +31,7 @@ public enum PhishingDetectionEvents: PixelKitEventV2 {
case visitSite
case iframeLoaded
case updateTaskFailed48h(error: Error?)
case settingToggled(to: Bool)

public var name: String {
switch self {
Expand All @@ -41,6 +43,8 @@ public enum PhishingDetectionEvents: PixelKitEventV2 {
return "phishing_detection_iframe-loaded"
case .updateTaskFailed48h:
return "phishing_detection_update-task-failed-48h"
case .settingToggled:
return "phishing_detection_setting-toggled"
}
}

Expand All @@ -54,6 +58,8 @@ public enum PhishingDetectionEvents: PixelKitEventV2 {
return [:]
case .updateTaskFailed48h(let error):
return error?.pixelParameters
case .settingToggled(let state):
return [PixelKit.Parameters.settingToggledTo: String(state)]
}
}

Expand All @@ -67,6 +73,8 @@ public enum PhishingDetectionEvents: PixelKitEventV2 {
return nil
case .iframeLoaded:
return nil
case .settingToggled:
return nil
}
}

Expand Down

0 comments on commit c64130a

Please sign in to comment.