AnalyticsProvider

public protocol AnalyticsProvider : Sendable

The provider for report related properties and methods.

  • The id for the visitor.

    Declaration

    Swift

    var visitorId: String? { get }
  • viewPage(title:url:) Asynchronous

    Reports to CXone that a some page/screen in the app has been viewed by the visitor.

    Throws

    EncodingError.invalidValue(_:_:) if the given value is invalid in the current context for this format.

    Throws

    channelConfigFailure if the URL cannot be parsed, most likely because environment.chatURL is not a valid URL.

    Throws

    URLError.badServerResponse if the URL Loading system received bad data from the server.

    Throws

    EncodingError.invalidValue if a non-conforming floating-point value is encountered during encoding, and the encoding strategy is .throw.

    Throws

    NSError object that indicates why the request failed

    Declaration

    Swift

    func viewPage(title: String, url: String) async throws

    Parameters

    title

    The title or description of the page that was viewed.

    url

    A URL uniquely identifying the page.

  • CXone reporting that a visitor has left a certain page/screen in the application.

    Throws

    EncodingError.invalidValue(_:_:) if the given value is invalid in the current context for this format.

    Throws

    channelConfigFailure if the URL cannot be parsed, most likely because environment.chatURL is not a valid URL.

    Throws

    URLError.badServerResponse if the URL Loading system received bad data from the server.

    Throws

    EncodingError.invalidValue if a non-conforming floating-point value is encountered during encoding, and the encoding strategy is .throw.

    Throws

    NSError object that indicates why the request failed

    Declaration

    Swift

    func viewPageEnded(title: String, url: String) async throws

    Parameters

    title

    The title or description of the page that was left.

    url

    A URL uniquely identifying the page.

  • chatWindowOpen() Asynchronous

    Reports to CXone that the chat window/view has been opened by the visitor.

    Throws

    EncodingError.invalidValue(_:_:) if the given value is invalid in the current context for this format.

    Throws

    channelConfigFailure if the URL cannot be parsed, most likely because environment.chatURL is not a valid URL.

    Throws

    URLError.badServerResponse if the URL Loading system received bad data from the server.

    Throws

    EncodingError.invalidValue if a non-conforming floating-point value is encountered during encoding, and the encoding strategy is .throw.

    Throws

    NSError object that indicates why the request failed

    Declaration

    Swift

    func chatWindowOpen() async throws
  • Reports to CXone that a conversion has occurred.

    Throws

    EncodingError.invalidValue(_:_:) if the given value is invalid in the current context for this format.

    Throws

    channelConfigFailure if the URL cannot be parsed, most likely because environment.chatURL is not a valid URL.

    Throws

    URLError.badServerResponse if the URL Loading system received bad data from the server.

    Throws

    EncodingError.invalidValue if a non-conforming floating-point value is encountered during encoding, and the encoding strategy is .throw.

    Throws

    NSError object that indicates why the request failed

    Declaration

    Swift

    func conversion(type: String, value: Double) async throws

    Parameters

    type

    The type of conversion. Can be any value.

    value

    The value associated with the conversion (for example, unit amount). Can be any number.