Skip to content
Open
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
12 changes: 12 additions & 0 deletions Sources/SegmentAmplitude/AmplitudeSession.swift
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,18 @@ public class AmplitudeSession: EventPlugin, iOSLifecycle {
debugLog("EndSession = \(eventSessionID)")
}

if active {
// "event_properties" have to contain "session_id" apart from "[Amplitude] Session Replay ID"
// - to make session replays appear in amplitude
var adjustedProps = trackEvent.properties
if adjustedProps == nil {
adjustedProps = try? JSON(["session_id": eventSessionID])
} else {
adjustedProps?.setValue(eventSessionID, forKeyPath: KeyPath("session_id"))
}
trackEvent.properties = adjustedProps
}

// if it's amp specific stuff, disable all the integrations except for amp.
if eventName.contains(Constants.ampPrefix) || eventName == Constants.ampSessionStartEvent || eventName == Constants.ampSessionEndEvent {
var integrations = disableAllIntegrations(integrations: trackEvent.integrations)
Expand Down