AnalyticsProvider
public protocol AnalyticsProvider
The provider for report related properties and methods.
-
The id for the visitor.
Declaration
Swift
var visitorId: UUID? { get } -
viewPage(title:Asynchronousurl: ) Reports to CXone that a some page/screen in the app has been viewed by the visitor.
Throws
missingVisitorIdifprepare(environment:brandId:channelId:)orprepare(chatURL:socketURL:brandId:channelId:)method was not called before triggering analytics event.Throws
EncodingError.invalidValue(_:_:)if the given value is invalid in the current context for this format.Throws
channelConfigFailureif the URL cannot be parsed, most likely because environment.chatURL is not a valid URL.Throws
URLError.badServerResponseif the URL Loading system received bad data from the server.Throws
EncodingError.invalidValueif a non-conforming floating-point value is encountered during encoding, and the encoding strategy is.throw.Throws
NSErrorobject that indicates why the request failedDeclaration
Swift
func viewPage(title: String, url: String) async throwsParameters
titleThe title or description of the page that was viewed.
urlA URL uniquely identifying the page.
-
viewPageEnded(title:Asynchronousurl: ) CXone reporting that a visitor has left a certain page/screen in the application.
Throws
missingVisitorIdifprepare(environment:brandId:channelId:)orprepare(chatURL:socketURL:brandId:channelId:)method was not called before triggering analytics event.Throws
EncodingError.invalidValue(_:_:)if the given value is invalid in the current context for this format.Throws
channelConfigFailureif the URL cannot be parsed, most likely because environment.chatURL is not a valid URL.Throws
URLError.badServerResponseif the URL Loading system received bad data from the server.Throws
EncodingError.invalidValueif a non-conforming floating-point value is encountered during encoding, and the encoding strategy is.throw.Throws
NSErrorobject that indicates why the request failedDeclaration
Swift
func viewPageEnded(title: String, url: String) async throwsParameters
titleThe title or description of the page that was left.
urlA URL uniquely identifying the page.
-
chatWindowOpen()AsynchronousReports to CXone that the chat window/view has been opened by the visitor.
Throws
missingVisitorIdifprepare(environment:brandId:channelId:)orprepare(chatURL:socketURL:brandId:channelId:)method was not called before triggering analytics event.Throws
EncodingError.invalidValue(_:_:)if the given value is invalid in the current context for this format.Throws
channelConfigFailureif the URL cannot be parsed, most likely because environment.chatURL is not a valid URL.Throws
URLError.badServerResponseif the URL Loading system received bad data from the server.Throws
EncodingError.invalidValueif a non-conforming floating-point value is encountered during encoding, and the encoding strategy is.throw.Throws
NSErrorobject that indicates why the request failedDeclaration
Swift
func chatWindowOpen() async throws -
conversion(type:Asynchronousvalue: ) Reports to CXone that a conversion has occurred.
Throws
missingVisitorIdifprepare(environment:brandId:channelId:)orprepare(chatURL:socketURL:brandId:channelId:)method was not called before triggering analytics event.Throws
EncodingError.invalidValue(_:_:)if the given value is invalid in the current context for this format.Throws
channelConfigFailureif the URL cannot be parsed, most likely because environment.chatURL is not a valid URL.Throws
URLError.badServerResponseif the URL Loading system received bad data from the server.Throws
EncodingError.invalidValueif a non-conforming floating-point value is encountered during encoding, and the encoding strategy is.throw.Throws
NSErrorobject that indicates why the request failedDeclaration
Swift
func conversion(type: String, value: Double) async throwsParameters
typeThe type of conversion. Can be any value.
valueThe value associated with the conversion (for example, unit amount). Can be any number.
-
proactiveActionDisplay(data:Asynchronous) Reports to CXone that a proactive action was displayed to the visitor.
Throws
missingVisitorIdifprepare(environment:brandId:channelId:)orprepare(chatURL:socketURL:brandId:channelId:)method was not called before triggering analytics event.Throws
EncodingError.invalidValue(_:_:)if the given value is invalid in the current context for this format.Throws
channelConfigFailureif the URL cannot be parsed, most likely because environment.chatURL is not a valid URL.Throws
URLError.badServerResponseif the URL Loading system received bad data from the server.Throws
EncodingError.invalidValueif a non-conforming floating-point value is encountered during encoding, and the encoding strategy is.throw.Throws
NSErrorobject that indicates why the request failedDeclaration
Swift
func proactiveActionDisplay(data: ProactiveActionDetails) async throwsParameters
dataThe proactive action that was displayed.
-
proactiveActionClick(data:Asynchronous) Reports to CXone that a proactive action was clicked or acted upon by the visitor.
Throws
missingVisitorIdifprepare(environment:brandId:channelId:)orprepare(chatURL:socketURL:brandId:channelId:)method was not called before triggering analytics event.Throws
EncodingError.invalidValue(_:_:)if the given value is invalid in the current context for this format.Throws
channelConfigFailureif the URL cannot be parsed, most likely because environment.chatURL is not a valid URL.Throws
URLError.badServerResponseif the URL Loading system received bad data from the server.Throws
EncodingError.invalidValueif a non-conforming floating-point value is encountered during encoding, and the encoding strategy is.throw.Throws
NSErrorobject that indicates why the request failedDeclaration
Swift
func proactiveActionClick(data: ProactiveActionDetails) async throwsParameters
dataThe proactive action that was clicked.
-
proactiveActionSuccess(_:Asynchronousdata: ) Reports to CXone that a proactive action was successful or fails and lead to a conversion.
Throws
missingVisitorIdifprepare(environment:brandId:channelId:)orprepare(chatURL:socketURL:brandId:channelId:)method was not called before triggering analytics event.Throws
EncodingError.invalidValue(_:_:)if the given value is invalid in the current context for this format.Throws
channelConfigFailureif the URL cannot be parsed, most likely because environment.chatURL is not a valid URL.Throws
URLError.badServerResponseif the URL Loading system received bad data from the server.Throws
EncodingError.invalidValueif a non-conforming floating-point value is encountered during encoding, and the encoding strategy is.throw.Throws
NSErrorobject that indicates why the request failedDeclaration
Swift
func proactiveActionSuccess(_ isSuccess: Bool, data: ProactiveActionDetails) async throwsParameters
dataThe proactive action that was successful or fails.
-
Reports to CXone that some event occurred with the visitor.
This can be used to report any custom event that may not be covered by other existing methods.
Throws
notConnectedif an attempt was made to use a method without connecting first. Make sure you call theconnectmethod first.Throws
invalidDatawhen the Data object cannot be successfully converted to a valid UTF-8 stringThrows
EncodingError.invalidValue(_:_:)if the given value is invalid in the current context for this format.Declaration
Swift
@available(*, deprecated, message: "Deprecated with 2.3.0. Sending `customVisitorEvent(data:﹚` via WebSocket is not supported.") func customVisitorEvent(data: VisitorEventDataType) throwsParameters
dataAny data associated with the event.
View on GitHub