Skip to main content

API Reference

B2MAnalytics​

MethodDescription
start(apiKey:appIdentifier:...)Initializes and configures the SDK. Must be called before tracking any events.
logEvent(name:properties:itemProperties:)Tracks a custom event with optional properties and item-level data.
setUser(_:)Identifies the current user and updates their profile.
registerDeviceToken(_:)Registers an APNs device token and logs a push_token event.
trackPushOpened(userInfo:)Tracks a push notification open and logs a push_opened event.
flush()Sends all pending events immediately.
shutdown()Stops timers/observers after a final delivery attempt.
logLevelProperty controlling console log verbosity.

LogLevel​

ValueDescription
.offNo logging
.errorOnly critical errors
.warningErrors and warnings
.infoGeneral SDK operations
.debugDetailed debugging info