UAAnalytics

@interface UAAnalytics : UAComponent

The UAAnalytics object provides an interface to the Airship Analytics API.

  • The conversion send ID.

    Declaration

    Objective-C

    @property (readonly, copy, nonatomic, nullable) NSString *conversionSendID;

    Swift

    var conversionSendID: String? { get }
  • The conversion push metadata.

    Declaration

    Objective-C

    @property (readonly, copy, nonatomic, nullable) NSString *conversionPushMetadata;

    Swift

    var conversionPushMetadata: String? { get }
  • The conversion rich push ID.

    Declaration

    Objective-C

    @property (readonly, copy, nonatomic, nullable) NSString *conversionRichPushID;

    Swift

    var conversionRichPushID: String? { get }
  • The current session ID.

    Declaration

    Objective-C

    @property (readonly, copy, nonatomic) NSString *_Nonnull sessionID;

    Swift

    var sessionID: String { get }
  • Date representing the last attempt to send analytics.

    Declaration

    Objective-C

    @property (readonly, strong, nonatomic) NSDate *_Nonnull lastSendTime;

    Swift

    var lastSendTime: Date { get }

    Return Value

    NSDate representing the last attempt to send analytics

  • Optional event consumer.

    Note

    AirshipDebugKit uses the event consumer to capture events. Setting the event consumer for other purposes will result in an interruption to AirshipDebugKit’s event stream.

    Declaration

    Objective-C

    @property (readwrite, strong, nonatomic, nullable)
        id<UAAnalyticsEventConsumerProtocol>
            eventConsumer;

    Swift

    var eventConsumer: UAAnalyticsEventConsumerProtocol? { get set }
  • Analytics enable flag. Disabling analytics will delete any locally stored events and prevent any events from uploading. Features that depend on analytics being enabled may not work properly if it’s disabled (reports, region triggers, location segmentation, push to local time).

    Note: This property will always return NO if analytics is disabled in UARuntimeConfig.

    Declaration

    Objective-C

    @property (getter=isEnabled, assign, readwrite, nonatomic) BOOL enabled;

    Swift

    var isEnabled: Bool { get set }
  • Triggers an analytics event.

    Declaration

    Objective-C

    - (void)addEvent:(nonnull UAEvent *)event;

    Swift

    func add(_ event: UAEvent)

    Parameters

    event

    The event to be triggered

  • Associates identifiers with the device. This call will add a special event that will be batched and sent up with our other analytics events. Previous associated identifiers will be replaced.

    Declaration

    Objective-C

    - (void)associateDeviceIdentifiers:
        (nonnull UAAssociatedIdentifiers *)associatedIdentifiers;

    Swift

    func associateDeviceIdentifiers(_ associatedIdentifiers: UAAssociatedIdentifiers)

    Parameters

    associatedIdentifiers

    The associated identifiers.

  • The device’s current associated identifiers.

    Declaration

    Objective-C

    - (nonnull UAAssociatedIdentifiers *)currentAssociatedDeviceIdentifiers;

    Swift

    func currentAssociatedDeviceIdentifiers() -> UAAssociatedIdentifiers

    Return Value

    The device’s current associated identifiers.

  • Initiates screen tracking for a specific app screen, must be called once per tracked screen.

    Declaration

    Objective-C

    - (void)trackScreen:(nullable NSString *)screen;

    Swift

    func trackScreen(_ screen: String?)

    Parameters

    screen

    The screen’s identifier as an NSString.

  • Schedules an event upload if one is not already scheduled.

    Declaration

    Objective-C

    - (void)scheduleUpload;

    Swift

    func scheduleUpload()