Created
August 3, 2025 12:00
-
-
Save jacobsapps/31fe9c56a580169fb4ccf16f806f77aa to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Mixpanel | |
final class MixpanelAnalyticsService: AnalyticsService { | |
func track(event: String, properties: [String: Any]? = nil) { | |
var enrichedProperties = performanceService.getAllMetrics() | |
if let customProperties = properties { | |
enrichedProperties.merge(customProperties) { (_, new) in new } | |
} | |
let mixpanelProperties = enrichedProperties.compactMapValues { $0 as? MixpanelType } | |
mixpanelInstance.track(event: event, properties: mixpanelProperties) | |
} | |
// ... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment