CleanInsightsSDK Documentation Beta

Class Event

open class Event: DataPoint
Event Event DataPoint DataPoint Event->DataPoint

Nested Types

Event.CodingKeys

Superclass

DataPoint

Initializers

init(category:​action:​name:​value:​campaign​Id:​times:​first:​last:​)

public init(category: String, action: String, name: String? = nil, value: Double? = nil, campaignId: String, times: UInt = 1, first: Date = Date(), last: Date = Date())

Parameters

category String

The event category. Must not be empty. (eg. Videos, Music, Games...)

action String

The event action. Must not be empty. (eg. Play, Pause, Duration, Add Playlist, Downloaded, Clicked...)

name String?

The event name. OPTIONAL.

value Double?

The event value. OPTIONAL.

campaign​Id String

The campaign ID this data point is for.

times UInt

Number of times this data point has arisen between first and last. OPTIONAL, defaults to 1.

first Date

The first time this data point has arisen. OPTIONAL, defaults to now.

last Date

The last time this data point has arisen. OPTIONAL, defaults to now.

init(from:​)

public required init(from decoder: Decoder) throws

Properties

category

let category: String

The event category. Must not be empty. (eg. Videos, Music, Games...)

action

let action: String

The event action. Must not be empty. (eg. Play, Pause, Duration, Add Playlist, Downloaded, Clicked...)

name

let name: String?

The event name. OPTIONAL.

value

var value: Double?

The event value. OPTIONAL.

description

var description: String

Methods

encode(to:​)

open override func encode(to encoder: Encoder) throws