Skip to content

Commit

Permalink
Add parameters.
Browse files Browse the repository at this point in the history
  • Loading branch information
samsymons committed Dec 3, 2024
1 parent 08b8fbf commit d8afd9e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Core/StatisticsLoader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ public class StatisticsLoader {

if let data = response?.data, let atb = try? self.parser.convert(fromJsonData: data) {
self.requestExti(atb: atb, completion: completion)
self.fireInstallPixel()
} else {
completion()
}
Expand All @@ -102,12 +101,19 @@ public class StatisticsLoader {
self.statisticsStore.atb = atb.version
self.returnUserMeasurement.installCompletedWithATB(atb)
self.createATBFileMarker()
self.fireInstallPixel()
completion()
}
}

private func fireInstallPixel() {
pixelFiring.fire(.appInstall, withAdditionalParameters: [:], includedParameters: [.appVersion], onComplete: { error in
let formattedLocale = Locale.current.localeIdentifierAsJsonFormat
let isReinstall = String(returnUserMeasurement.isReturningUser)
let parameters = [
"locale": formattedLocale,
"reinstall": isReinstall
]
pixelFiring.fire(.appInstall, withAdditionalParameters: parameters, includedParameters: [.appVersion], onComplete: { error in
if let error {
Logger.general.error("Install pixel failed with error: \(error.localizedDescription, privacy: .public)")
}
Expand Down

0 comments on commit d8afd9e

Please sign in to comment.