Permutive_iOS v1.4.0 Documentation

Class Event​Properties

@objc(PermutiveEventProperties)
public final class EventProperties: NSObject  

EventProperties describes metadata to be attached to a tracked event. Only certain types of information can be attached as metadata to an event.

Important

EventProperties instances should be initialised in reference to a particular event type. The key names and value types must match exactly the schema defined for that particular event in the Permutive dashboard. Incorrect or additional entries will result in the event being rejected by the Permutive API.

Enrichment

Metadata can be enriched with current geolocation, ISP and (hashed) IP address information. To achieve this add an entry whose key value matches that defined in the event schema and set the value to EventProperties.geoInfoValue, EventProperties.ispInfoValue or EventProperties.ipHashInfoValue. The Permutive SDK will substitute the current values for respective placeholder when tracking an event.

E.g.

let properties = EventProperties(["my_event_geolocation_key": EventProperties.geoInfoValue])
try Permutive.shared.track(event: "Pageview", properties: properties)
EventProperties EventProperties NSObject NSObject EventProperties->NSObject

Conforms To

NSObject

Initializers

init()

@objc
    override public init()  

init(_:​)

@objc
    public init(_ properties: [String: AnyHashable]) throws  

EventProperties is used to encapsulate event metadata to be included with an event. Values must be supported types or an exception will be thrown.

Parameters

properties [String:​ Any​Hashable]

A [String: AnyHashable]

Throws

Throws an SDKError with message: "contains invalid types. Supported types are Int, Bool, Float, Double, String, Date, EventProperties, and arrays of these types"

Properties

geo​Info​Value

@objc public static let geoInfoValue = "$ip_geo_info"

A value denoting geo location information, if available

isp​Info​Value

@objc public static let ispInfoValue = "$ip_isp_info"

A value denoting ISP information, if available

ip​Hash​Info​Value

@objc public static let ipHashInfoValue = "$ip_address_hash"

A value denoting the current external IP address hash information, if available

alchemy​Concepts​Value

@objc public static let alchemyConceptsValue = "$alchemy_concepts"

Use this constant to enrich the event with the alchemy concepts of the current url

alchemy​Entities​Value

@objc public static let alchemyEntitiesValue = "$alchemy_entities"

Use this constant to enrich the event with the alchemy entities of the current url

alchemy​Keywords​Value

@objc public static let alchemyKeywordsValue = "$alchemy_keywords"

Use this constant to enrich the event with the alchemy keywords of the current url

alchemy​Taxonomy​Value

@objc public static let alchemyTaxonomyValue = "$alchemy_taxonomy"

Use this constant to enrich the event with the alchemy taxonomy of the current url

alchemy​Document​Emotion​Value

@objc public static let alchemyDocumentEmotionValue = "$alchemy_document_emotion"

Use this constant to enrich the event with the alchemy document emotion of the current url

alchemy​Document​Sentiment​Value

@objc public static let alchemyDocumentSentimentValue = "$alchemy_document_sentiment"

Use this constant to enrich the event with the alchemy document sentiment of the current url

alchemy​Taxonomy​Labels​Value

@objc public static let alchemyTaxonomyLabelsValue = "$alchemy_taxonomy_labels"

Use this constant to enrich the event with the alchemy taxonomy labels of the current url

alchemy​Entity​Names​Value

@objc public static let alchemyEntityNamesValue = "$alchemy_entity_names"

Use this constant to enrich the event with the alchemy entity names of the current url

description

override var description: String  

debug​Description

override var debugDescription: String  

Methods

object(for​Key:​)

func object(forKey key: String) -> AnyHashable?  

Get object for key in EventProperties

Parameters

key String

The key for the object that need to be retrieved

Returns

The object if it exist

set(bool:​for​Key:​)

func set(bool: Bool, forKey key: String) throws  

Set a bool value for key

set(number:​for​Key:​)

func set(number: NSNumber, forKey key: String) throws  

Set a number value for key

set(string:​for​Key:​)

func set(string: String, forKey key: String) throws  

Set a string value for key

set(date:​for​Key:​)

func set(date: Date, forKey key: String) throws  

Set a date value for key

set(properties:​for​Key:​)

func set(properties: EventProperties, forKey key: String) throws  

Set a properties value for key

set(bools:​for​Key:​)

func set(bools: [Bool], forKey key: String) throws  

Set a bool array value for key

set(numbers:​for​Key:​)

func set(numbers: [NSNumber], forKey key: String) throws  

Set a number array value for key

set(strings:​for​Key:​)

func set(strings: [String], forKey key: String) throws  

Set a string array value for key

set(dates:​for​Key:​)

func set(dates: [Date], forKey key: String) throws  

Set a dates array value for key

set(properties​List:​for​Key:​)

func set(propertiesList: [EventProperties], forKey key: String) throws  

Set a propertiesList array value for key

remove​Value(for:​)

func removeValue(for key: String)  

remove value for key if it exist

as​Dictionary()

func asDictionary() -> [String: AnyHashable]  

Return the EventProperties object as a Dictionary

Returns

Dictionary