Set the callback
FlowPilot.configure(...):
The event
Each call gives you anAnalyticsEvent. The useful fields:
Most fields are optional and only present for the event types that carry them. For the complete field list and per-event meaning, see Event taxonomy.
Event names
The SDK fires these automatic event names (fromAutomaticEventType):
Two more event names appear in the stream but are not part of
AutomaticEventType:
conversionis emitted when you calltrackConversion. It carriesrevenue,currency, and anypropertiesyou pass, and it reaches your callback like any other event.resolve_no_flowis a backend-side event recorded when a placement resolves to no flow. The iOS SDK does not emit it, so do not expect it in this callback.
These names match the backend’s event taxonomy exactly, so the names you forward line up with what FlowPilot reports. The Swift
eventName property maps to the event_type field on the wire.Example: forward to your analytics
Forward completions and conversions, with flow and experiment context attached:Notes
- It runs in-process. The callback is invoked synchronously while the SDK records the event. Keep it fast and non-blocking. If you need to do heavy work, hand the event to your own queue and return.
- It is additive, not a replacement. FlowPilot still sends every event to its backend. Your callback is an extra copy for your own tools.
- Most fields are optional. Guard against
nil. A field likerevenueis only set onconversionevents;screenIdis only set on screen-scoped events.
Common mistakes
- Setting the callback after presenting. The session captures the callback at creation time. Set it before
presentPlacementorcreateSession, ideally right afterconfigure. - Assuming it replaces FlowPilot ingestion. It does not. FlowPilot tracks independently. If you only wanted to disable FlowPilot’s own tracking, that is a separate concern, not this callback.
- Double-counting purchases. If you call
trackConversionand also forward theconversionevent to a provider that already tracks the purchase elsewhere, you can count it twice. Pick one source of truth per metric. - Heavy work in the callback. Logging, disk writes, or network calls inline will slow the flow. Offload them.