Closed
Description
The automatically collected Application Backgrounded event should send an empty properties
as an empty object, and not as null.
"event": "Application Backgrounded",
"integrations": {},
"messageId": "d7ee8923-280f-4224-86b7-117ae34771c3",
"originalTimestamp": "2024-02-22T03:34:17.882927",
"properties": null,
"receivedAt": "2024-02-22T08:34:24.593Z",
"sentAt": "2024-02-22T03:34:23.476Z",
"timestamp": "2024-02-22T08:34:18.999Z",
"type": "track",
The Segment spec specifies this should be an object: https://segment.com/docs/connections/spec/track/
As an interim workaround, a plugin can be used to change the format:
class PropertyFixPlugin extends Plugin {
PropertyFixPlugin() : super(PluginType.enrichment);
@override
void configure(Analytics analytics) {
super.configure(analytics);
if (kIsWeb) {
return;
}
}
@override
Future<RawEvent?> execute(RawEvent event) async {
var local = event.type.toString();
if (local == 'track') {
var track = event as TrackEvent;
final properties = track.properties;
if (properties == null) {
track.properties = {};
}
}
return event;
}
}
Metadata
Metadata
Assignees
Labels
No labels