Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Events Firing for Phishing Detection Settings #1012

Merged
merged 1 commit into from
Oct 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading