sendAnalyticsEvent method
Sends an analytics event, provided the analytics are enabled. Invoked from BetterCommandRunner upon command execution with the event name, or command name if applicable. Can be overridden to customize the event sending behavior.
Implementation
@override
void sendAnalyticsEvent(
final String event, [
final Map<String, dynamic> properties = const {},
]) {
final enrichedProperties = Map<String, dynamic>.from(properties);
final cloudUser = ResourceManager.tryFetchServerpodCloudUserDataSync(
localStoragePath: globalConfiguration.scloudDir.path,
);
if (cloudUser != null) {
enrichedProperties['cloud_user_id'] = cloudUser.id;
}
super.sendAnalyticsEvent(event, enrichedProperties);
}