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
missingVisitorId
ifprepare(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
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 failedDeclaration
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.
-
viewPageEnded(title:
Asynchronousurl: ) CXone reporting that a visitor has left a certain page/screen in the application.
Throws
missingVisitorId
ifprepare(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
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 failedDeclaration
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()
AsynchronousReports to CXone that the chat window/view has been opened by the visitor.
Throws
missingVisitorId
ifprepare(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
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 failedDeclaration
Swift
func chatWindowOpen() async throws
-
conversion(type:
Asynchronousvalue: ) Reports to CXone that a conversion has occurred.
Throws
missingVisitorId
ifprepare(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
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 failedDeclaration
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.
-
proactiveActionDisplay(data:
Asynchronous) Reports to CXone that a proactive action was displayed to the visitor.
Throws
missingVisitorId
ifprepare(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
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 failedDeclaration
Swift
func proactiveActionDisplay(data: ProactiveActionDetails) async throws
Parameters
data
The proactive action that was displayed.
-
proactiveActionClick(data:
Asynchronous) Reports to CXone that a proactive action was clicked or acted upon by the visitor.
Throws
missingVisitorId
ifprepare(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
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 failedDeclaration
Swift
func proactiveActionClick(data: ProactiveActionDetails) async throws
Parameters
data
The proactive action that was clicked.
-
proactiveActionSuccess(_:
Asynchronousdata: ) Reports to CXone that a proactive action was successful or fails and lead to a conversion.
Throws
missingVisitorId
ifprepare(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
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 failedDeclaration
Swift
func proactiveActionSuccess(_ isSuccess: Bool, data: ProactiveActionDetails) async throws
Parameters
data
The 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
notConnected
if an attempt was made to use a method without connecting first. Make sure you call theconnect
method first.Throws
invalidData
when 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
func customVisitorEvent(data: VisitorEventDataType) throws
Parameters
data
Any data associated with the event.