Skip to content

Commit bb5e7e2

Browse files
authored
Added conversion info fields to properties payload (#20)
1 parent 1fbf8b6 commit bb5e7e2

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

Package.resolved

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Sources/SegmentAppsFlyer/AppsFlyerDestination.swift

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,10 +214,19 @@ extension AppsFlyerDestination: AppsFlyerLibDelegate {
214214
"ad_group": adgroup
215215
]
216216

217-
let properties: [String: Codable] = [
217+
var properties: [String: Any] = [
218218
"provider": "AppsFlyer",
219-
"campaign": try? JSON(campaign)
219+
"campaign": campaign
220220
]
221+
222+
if let conversionInfo = conversionInfo as? [String: Any] {
223+
properties.merge(conversionInfo) { current, _ in
224+
return current
225+
}
226+
// removed already-mapped special fields
227+
properties.removeValue(forKey: "media_source")
228+
properties.removeValue(forKey: "adgroup")
229+
}
221230
analytics?.track(name: "Install Attributed", properties: properties)
222231

223232
}

0 commit comments

Comments
 (0)