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: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:loggerURL:brandId:channelId:tokenURL:)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:loggerURL:brandId:channelId:tokenURL:)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:loggerURL:brandId:channelId:tokenURL:)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:loggerURL:brandId:channelId:tokenURL:)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.
View on GitHub