Class – KochavaEvent

  • Class

    KochavaEvent

    The class KochavaEvent provides a means of defining the parameters for a post-install event, providing standardized types and key names.


    Overview

    Sending post-install events is not a requirement. To track installation information, you do not need to do anything more than call the constructor for the tracker. Still, many advertisers want to understand and correlate the relationship between conversion and attribution source information with post-install behaviors. This can only be done by tracking post-install events.

    Once the tracker has been configured, Kochava event tracking methods can be called from anywhere within the application. Events will be coupled with the information sent by the tracker to report events, based on user device and application information. Events are not sent immediately to Kochava servers but queued, should the device not have connectivity.

     

    Discussion

    The KochavaEvent class defines an individual post-install event, providing a variety of standardized event names and parameters. Standard event names may represent a purchase, the completion of a level, an achievement, etc. Standard parameters may represent a currency, price, level, etc.

    The use of standard event names and parameters maximizes parity with external analytics partners and ensures optimal reporting and analytical output via the Kochava platform. If the data you are sending through post-install events can be sent using standard event names and parameters we recommend you use an instance of class KochavaEvent to do so. Once an event has been fully configured, the class KochavaTracker provides the instance method send(_:) method to send it to the Kochava Server.

    The class KochavaTracker class also provides convenience methods for creating and sending events in one step when the name and information is a simple string or dictionary. For a simple string you may use the instance method sendEvent(withNameString:infoString:), and for a simple dictionary you may use the instance methodsendEvent(withNameString:infoDictionary:).

     

    Initialization and Configuration

    To create a KochavaEvent, use the designated initialization method init?(eventTypeEnum:). Once created, you may complete the configuration of the KochavaEvent instance by configuring any number of the available optional parameters.

     

    Sample Code:

    Sending the Event

    The class KochavaTracker (Class) provides the instance method send(_:) to send a KochavaEvent to the Kochava Server.

     

    Sample Code:

     

    In-App Purchases

    When your app is notified through your SKPaymentTransactionObserver that a SKPaymentQueue updated an array of SKPaymentTransaction objects, it is expected that your app will persist the purchases and unlock functionality within your app. At this point you may create and send a purchase event which typically includes values such as price, product description, an apple app store receipt, and any other data you wish to include with this purchase.

     

    BEST PRACTICES: For auto-renewable subscriptions, this same type of purchase event can be sent once your app has been notified that a purchase has completed for a subscription renewal. The following sample assumes that you have stored the possible SKProduct(s) in self.storeKitProductDictionary, which is keyed by the product identifier, so that you may later send additional details for the product with the event.

     

    Sample Code:

     

    Symbols

    Creating an Instance init?(eventTypeEnum: EventTypeEnum)

    The designated initialization method for an instance of class KochavaEvent.

    Standardized Parameters appleWatchBool

    A boolean indicating that this event originated from an Apple Watch.

    Info Dictionary Key String: “apple_watch”

    appleWatchIdString

    A string containing a unique identifier associated with the Apple Watch from which this event originated.

    Optional. You may set this property in addition to appleWatchBool if you have a unique identifier associated with the watch.

    Info Dictionary Key String: “apple_watch_id”

    appStoreReceiptBase64EncodedString

    A property containing an App Store receipt which has been converted into a base64 encoded string. The format of the information is expected to be that which is provided by the main bundle’s appStoreReceiptURL method, the data of which being loaded and base64 string encoded.

    checkoutAsGuestString

    A property indicating whether a checkout took place as a guest. This is generally taken to be a boolean, but it is passed as a string so that you can provide more than two states. Suggested values are “true” and “false”, but can also be values such as “yes”, “no”, or “partial”.

    Info Dictionary Key String: “checkout_as_guest”

    contentIdString

    A property containing a content identifier string. This field has a somewhat generic quality, in that it can contain whatever you consider to be fitting value.

    Info Dictionary Key String: “content_id”

    contentTypeString

    A property containing a content type string. This field has a somewhat generic quality, in that it can contain whatever you consider to be fitting value.

    Info Dictionary Key String: “content_type”

    currencyString

    A property containing a currency type string. This field has a somewhat generic quality, in that it can contain whatever you consider to be fitting value.

    Info Dictionary Key String: “currency”

    customEventNameString

    A property containing a custom name string. When the event type is set to Custom, this is the name that will be used for the custom event.

    date

    A property containing a date. This field has a somewhat generic quality, in that it can contain whatever you consider to be fitting value.

    Info Dictionary Key String: “now_date”

    dateString

    A property containing a date string. “dateString” can be used as an alternate to “date” when a specific date format is desired. This field has a somewhat generic quality, in that it can contain whatever you consider to be fitting value.

    Info Dictionary Key String: “now_date”

    descriptionString

    A property containing a description. It is a string that can contain any alphanumeric value. This field has a somewhat generic quality, in that it can contain whatever you consider to be fitting value.

    Info Dictionary Key String: “description”

    destinationString

    A property containing a destination. It is a string that can contain any alphanumeric value. This field has a somewhat generic quality, in that it can contain whatever you consider to be fitting value.

    Info Dictionary Key String: “destination”

    durationTimeIntervalNumber

    A property that contains a duration. It is a time interval that is wrapped in an NSNumber. This field has a somewhat generic quality, in that it can contain whatever you consider to be fitting value.

    Info Dictionary Key String: “duration”

    endDate

    A property that contains an end date. This field has a somewhat generic quality, in that it can contain whatever you consider to be fitting value.

    Info Dictionary Key String: “end_date”

    endDateString

    A property that contains an end date. “endDateString” can be used as an alternate to “endDate” when a specific date format is desired. This field has a somewhat generic quality, in that it can contain whatever you consider to be fitting value.

    Info Dictionary Key String: “end_date”

    infoDictionary

    A property that contains a dictionary of information. This is the standard default dictionary property used with custom events. This field has an entirely generic quality. If can contain whatever you consider to be a fitting value. Whatever is passed within this dictionary must be JSON serializable.

    infoString

    A property which contains a string of information. This is the standard default string property used with custom events. This field has an entirely generic quality. It can contain whatever you consider to be a fitting value.

    itemAddedFromString

    A property that contains an indication of where an item as added from. It is a string that can contain any alphanumeric value. This field has a somewhat generic quality, in that it can contain whatever you consider to be fitting value.

    Info Dictionary Key String: “item_added_from”

    levelString

    A property that contains a level. It is a string that can contain any alphanumeric value. This field has a somewhat generic quality, in that it can contain whatever you consider to be fitting value.

    Info Dictionary Key String: “level”

    maxRatingValueDoubleNumber

    A property that contains a maximum rating value. It is a double that is wrapped in an NSNumber. This property is used in conjunction with ratingValueDoubleNumber. This field has a somewhat generic quality, in that it can contain whatever you consider to be fitting value.

    Info Dictionary Key String: “max_rating_value”

    nameString

    A property that contains a name. It can be a human name or the name of any other item type. It is a string that can contain any alphanumeric value. This field has a somewhat generic quality, in that it can contain whatever you consider to be fitting value. It can be a person’s name or the name of any other object.

    Info Dictionary Key String: “name”

    orderIdString

    A property that contains an order id. It is a string that can contain any alphanumeric value. This field has a somewhat generic quality, in that it can contain whatever you consider to be fitting value.

    Info Dictionary Key String: “order_id”

    originString

    A property that contains an origin. It is a string that can contain any alphanumeric value. This field has a somewhat generic quality, in that it can contain whatever you consider to be fitting value.

    Info Dictionary Key String: “origin”

    priceDoubleNumber

    A property that contains a price. It is a double that is wrapped in an NSNumber. This field has a somewhat generic quality, in that it can contain whatever you consider to be fitting value.

    Info Dictionary Key String: “price”

    quantityDoubleNumber

    A property that contains a quantity. It is a double that is wrapped in an NSNumber. This field has a somewhat generic quality, in that it can contain whatever you consider to be fitting value.

    Info Dictionary Key String: “quantity”

    ratingValueDoubleNumber

    A property that contains a rating value. It is a double that is wrapped in an NSNumber. This field has a somewhat generic quality, in that it can contain whatever you consider to be fitting value.

    Info Dictionary Key String: “rating_value”

    receiptIdString

    A property that contains a receipt id. It is a string that can contain any alphanumeric value. This field has a somewhat generic quality, in that it can contain whatever you consider to be fitting value.

    Info Dictionary Key String: “receipt_id”

    referralFromString

    A property that contains where something was referred from. It is a string that can contain any alphanumeric value. This field has a somewhat generic quality, in that it can contain whatever you consider to be fitting value.

    Info Dictionary Key String: “referral_from”

    registrationMethodString

    A property that contains a registration method. It is a string that can contain any alphanumeric value. This field has a somewhat generic quality, in that it can contain whatever you consider to be fitting value.

    Info Dictionary Key String: “registration_method”

    resultsString

    A property that contains results. It is a string that can contain any alphanumeric value. This field has a somewhat generic quality, in that it can contain whatever you consider to be fitting value.

    Info Dictionary Key String: “results”

    scoreString

    A property that contains a score. It is a string that can contain any alphanumeric value. This field has a somewhat generic quality, in that it can contain whatever you consider to be fitting value.

    Info Dictionary Key String: “score”

    searchTermString

    A property that contains a search term (or terms). It is a string that can contain any alphanumeric value. This field has a somewhat generic quality, in that it can contain whatever you consider to be fitting value.

    Info Dictionary Key String: “search_term”

    spatialXDoubleNumber

    A property that contains a spatial coordinate’s x value. This field has a somewhat generic quality, in that it can contain whatever you consider to be fitting value. One such application is to record the occurrence of events in 3D Gamespace.

    Info Dictionary Key String: “spatial_x”

    spatialYDoubleNumber

    A property that contains a spatial coordinate’s y value. This field has a somewhat generic quality, in that it can contain whatever you consider to be fitting value. One such application is to record the occurrence of events in 3D Gamespace.

    Info Dictionary Key String: “spatial_y”

    spatialZDoubleNumber

    A property that contains a spatial coordinate’s z value. This field has a somewhat generic quality, in that it can contain whatever you consider to be fitting value. One such application is to record the occurrence of events in 3D Gamespace.

    Info Dictionary Key String: “spatial_z”

    startDate

    A property that contains a start date. This field has a somewhat generic quality, in that it can contain whatever you consider to be fitting value.

    Info Dictionary Key String: “start_date”

    startDateString

    A property that contains a start date. “startDateString” is a string that can be used as an alternate to “startDate” when a specific display format is desired. This field has a somewhat generic quality, in that it can contain whatever you consider to be fitting value.

    Info Dictionary Key String: “start_date”

    successString

    A property that contains a success string. It is a string that can be any alphanumeric value. This field has a somewhat generic quality, in that it can contain whatever you consider to be fitting value.

    Info Dictionary Key String: “success”

    userIdString

    A property that contains a user id. It is a string that can be any alphanumeric value. This field has a somewhat generic quality, in that it can contain whatever you consider to be fitting value.

    Info Dictionary Key String: “user_id”

    userNameString

    A property that contains a username. This is intended to be used to store an account-syle username, as opposed to a user’s name (compare “nameString”). It is a string that can be any alphanumeric value. This field has a somewhat generic quality, in that it can contain whatever you consider to be fitting value.

    Info Dictionary Key String: “user_name”

    validatedString

    A property that contains a validated string. It is a string that is intended to contain a boolean-like value, such as “true” or “false”. It can also contain other custom values such as “partial”. This field has a somewhat generic quality, in that it can contain whatever you consider to be fitting value.

    Info Dictionary Key String: “validated”

    Relationships

    Inherits From NSObject

    See Also

    Related Symbols class KochavaTracker

    The class KochavaTracker provides an interface between a host application and Kochava’s Attribution and Analytics Servers. A tracker manages the exchange of data between these two entities, along with the associated tasks and network transactions.

    enum KochavaEventTypeEnum

    An enumeration that defines a type of event for an instance of class KochavaEvent.

    func send(KochavaEvent)

    Sends an instance of class KochavaEvent to the Kochava Server.

    func sendEvent(withNameString: String, infoDictionary: [AnyHashable: Any]?)

    Creates an instance of class KochavaEvent which has a nameString and an optional infoDictionary, and then sends it to the Kochava Server. A convenience method.

    func sendEvent(withNameString: String, infoString: String?)

    Creates an instance of class KochavaEvent which has a nameString and an optional infoString, and then sends it to the Kochava Server. A convenience method.

  • Class

    KochavaEvent

    The class KochavaEvent provides a means of defining the parameters for a post-install event, providing standardized types and key names.


    Overview

    Sending post-install events is not a requirement. To track installation information, you do not need to do anything more than call the constructor for the tracker. Still, many advertisers want to understand and correlate the relationship between conversion and attribution source information with post-install behaviors. This can only be done by tracking post-install events.

    Once the tracker has been configured, Kochava event tracking methods can be called from anywhere within the application. Events will be coupled with the information sent by the tracker to report events, based on user device and application information. Events are not sent immediately to Kochava servers but queued, should the device not have connectivity.

     

    Discussion

    The KochavaEvent class defines an individual post-install event, providing a variety of standardized event names and parameters. Standard event names may represent a purchase, the completion of a level, an achievement, etc. Standard parameters may represent a currency, price, level, etc.

    The use of standard event names and parameters maximizes parity with external analytics partners and ensures optimal reporting and analytical output via the Kochava platform. If the data you are sending through post-install events can be sent using standard event names and parameters we recommend you use an instance of class KochavaEvent to do so. Once an event has been fully configured, the class KochavaTracker provides the instance method sendEvent: method to send it to the Kochava Server.

    The class KochavaTracker class also provides convenience methods for creating and sending events in one step when the name and information is a simple string or dictionary. For a simple string you may use the instance method sendEventwithNameString:infoString:, and for a simple dictionary you may use the instance methodinstance method sendEventWithNameString:infoDictionary:.

     

    Initialization and Configuration

    To create a KochavaEvent, use the constructor designated initialization method eventWIthEventTypeEnum:. Once created, you may complete the configuration of the KochavaEvent instance by configuring any number of the available optional parameters.

     

    Sample Code:

     

    Sending the Event

    The class KochavaTracker provides the instance method sendEvent: to send a KochavaEvent to the Kochava Server.

     

    Sample Code:

     

    In-App Purchases

    When your app is notified through your SKPaymentTransactionObserver that a SKPaymentQueue updated an array of SKPaymentTransaction objects, it is expected that your app will persist the purchases and unlock functionality within your app. At this point you may create and send a purchase event which typically includes values such as price, product description, an apple app store receipt, and any other data you wish to include with this purchase.

     

    BEST PRACTICES: For auto-renewable subscriptions, this same type of purchase event can be sent once your app has been notified that a purchase has completed for a subscription renewal. The following sample assumes that you have stored the possible SKProduct(s) in self.storeKitProductDictionary, which is keyed by the product identifier, so that you may later send additional details for the product with the event.

     

    Sample Code:

     

    Symbols

    Creating an Instance + eventWithEventTypeEnum:

    The designated initialization method for an instance of class KochavaEvent.

    Standardized Parameters appleWatchBool

    A boolean indicating that this event originated from an Apple Watch.

    Info Dictionary Key String: “apple_watch”

    appleWatchIdString

    A string containing a unique identifier associated with the Apple Watch from which this event originated.

    Optional. You may set this property in addition to appleWatchBool if you have a unique identifier associated with the watch.

    Info Dictionary Key String: “apple_watch_id”

    appStoreReceiptBase64EncodedString

    A property containing an App Store receipt which has been converted into a base64 encoded string. The format of the information is expected to be that which is provided by the main bundle’s appStoreReceiptURL method, the data of which being loaded and base64 string encoded.

    checkoutAsGuestString

    A property indicating whether a checkout took place as a guest. This is generally taken to be a boolean, but it is passed as a string so that you can provide more than two states. Suggested values are “true” and “false”, but can also be values such as “yes”, “no”, or “partial”.

    Info Dictionary Key String: “checkout_as_guest”

    contentIdString

    A property containing a content identifier string. This field has a somewhat generic quality, in that it can contain whatever you consider to be fitting value.

    Info Dictionary Key String: “content_id”

    contentTypeString

    A property containing a content type string. This field has a somewhat generic quality, in that it can contain whatever you consider to be fitting value.

    Info Dictionary Key String: “content_type”

    currencyString

    A property containing a currency type string. This field has a somewhat generic quality, in that it can contain whatever you consider to be fitting value.

    Info Dictionary Key String: “currency”

    customEventNameString

    A property containing a custom name string. When the event type is set to Custom, this is the name that will be used for the custom event.

    date

    A property containing a date. This field has a somewhat generic quality, in that it can contain whatever you consider to be fitting value.

    Info Dictionary Key String: “now_date”

    dateString

    A property containing a date string. “dateString” can be used as an alternate to “date” when a specific date format is desired. This field has a somewhat generic quality, in that it can contain whatever you consider to be fitting value.

    Info Dictionary Key String: “now_date”

    descriptionString

    A property containing a description. It is a string that can contain any alphanumeric value. This field has a somewhat generic quality, in that it can contain whatever you consider to be fitting value.

    Info Dictionary Key String: “description”

    destinationString

    A property containing a destination. It is a string that can contain any alphanumeric value. This field has a somewhat generic quality, in that it can contain whatever you consider to be fitting value.

    Info Dictionary Key String: “destination”

    durationTimeIntervalNumber

    A property that contains a duration. It is a time interval that is wrapped in an NSNumber. This field has a somewhat generic quality, in that it can contain whatever you consider to be fitting value.

    Info Dictionary Key String: “duration”

    endDate

    A property that contains an end date. This field has a somewhat generic quality, in that it can contain whatever you consider to be fitting value.

    Info Dictionary Key String: “end_date”

    endDateString

    A property that contains an end date. “endDateString” can be used as an alternate to “endDate” when a specific date format is desired. This field has a somewhat generic quality, in that it can contain whatever you consider to be fitting value.

    Info Dictionary Key String: “end_date”

    infoDictionary

    A property that contains a dictionary of information. This is the standard default dictionary property used with custom events. This field has an entirely generic quality. If can contain whatever you consider to be a fitting value. Whatever is passed within this dictionary must be JSON serializable.

    infoString

    A property which contains a string of information. This is the standard default string property used with custom events. This field has an entirely generic quality. It can contain whatever you consider to be a fitting value.

    itemAddedFromString

    A property that contains an indication of where an item as added from. It is a string that can contain any alphanumeric value. This field has a somewhat generic quality, in that it can contain whatever you consider to be fitting value.

    Info Dictionary Key String: “item_added_from”

    levelString

    A property that contains a level. It is a string that can contain any alphanumeric value. This field has a somewhat generic quality, in that it can contain whatever you consider to be fitting value.

    Info Dictionary Key String: “level”

    maxRatingValueDoubleNumber

    A property that contains a maximum rating value. It is a double that is wrapped in an NSNumber. This property is used in conjunction with ratingValueDoubleNumber. This field has a somewhat generic quality, in that it can contain whatever you consider to be fitting value.

    Info Dictionary Key String: “max_rating_value”

    nameString

    A property that contains a name. It can be a human name or the name of any other item type. It is a string that can contain any alphanumeric value. This field has a somewhat generic quality, in that it can contain whatever you consider to be fitting value. It can be a person’s name or the name of any other object.

    Info Dictionary Key String: “name”

    orderIdString

    A property that contains an order id. It is a string that can contain any alphanumeric value. This field has a somewhat generic quality, in that it can contain whatever you consider to be fitting value.

    Info Dictionary Key String: “order_id”

    originString

    A property that contains an origin. It is a string that can contain any alphanumeric value. This field has a somewhat generic quality, in that it can contain whatever you consider to be fitting value.

    Info Dictionary Key String: “origin”

    priceDoubleNumber

    A property that contains a price. It is a double that is wrapped in an NSNumber. This field has a somewhat generic quality, in that it can contain whatever you consider to be fitting value.

    Info Dictionary Key String: “price”

    quantityDoubleNumber

    A property that contains a quantity. It is a double that is wrapped in an NSNumber. This field has a somewhat generic quality, in that it can contain whatever you consider to be fitting value.

    Info Dictionary Key String: “quantity”

    ratingValueDoubleNumber

    A property that contains a rating value. It is a double that is wrapped in an NSNumber. This field has a somewhat generic quality, in that it can contain whatever you consider to be fitting value.

    Info Dictionary Key String: “rating_value”

    receiptIdString

    A property that contains a receipt id. It is a string that can contain any alphanumeric value. This field has a somewhat generic quality, in that it can contain whatever you consider to be fitting value.

    Info Dictionary Key String: “receipt_id”

    referralFromString

    A property that contains where something was referred from. It is a string that can contain any alphanumeric value. This field has a somewhat generic quality, in that it can contain whatever you consider to be fitting value.

    Info Dictionary Key String: “referral_from”

    registrationMethodString

    A property that contains a registration method. It is a string that can contain any alphanumeric value. This field has a somewhat generic quality, in that it can contain whatever you consider to be fitting value.

    Info Dictionary Key String: “registration_method”

    resultsString

    A property that contains results. It is a string that can contain any alphanumeric value. This field has a somewhat generic quality, in that it can contain whatever you consider to be fitting value.

    Info Dictionary Key String: “results”

    scoreString

    A property that contains a score. It is a string that can contain any alphanumeric value. This field has a somewhat generic quality, in that it can contain whatever you consider to be fitting value.

    Info Dictionary Key String: “score”

    searchTermString

    A property that contains a search term (or terms). It is a string that can contain any alphanumeric value. This field has a somewhat generic quality, in that it can contain whatever you consider to be fitting value.

    Info Dictionary Key String: “search_term”

    spatialXDoubleNumber

    A property that contains a spatial coordinate’s x value. This field has a somewhat generic quality, in that it can contain whatever you consider to be fitting value. One such application is to record the occurrence of events in 3D Gamespace.

    Info Dictionary Key String: “spatial_x”

    spatialYDoubleNumber

    A property that contains a spatial coordinate’s y value. This field has a somewhat generic quality, in that it can contain whatever you consider to be fitting value. One such application is to record the occurrence of events in 3D Gamespace.

    Info Dictionary Key String: “spatial_y”

    spatialZDoubleNumber

    A property that contains a spatial coordinate’s z value. This field has a somewhat generic quality, in that it can contain whatever you consider to be fitting value. One such application is to record the occurrence of events in 3D Gamespace.

    Info Dictionary Key String: “spatial_z”

    startDate

    A property that contains a start date. This field has a somewhat generic quality, in that it can contain whatever you consider to be fitting value.

    Info Dictionary Key String: “start_date”

    startDateString

    A property that contains a start date. “startDateString” is a string that can be used as an alternate to “startDate” when a specific display format is desired. This field has a somewhat generic quality, in that it can contain whatever you consider to be fitting value.

    Info Dictionary Key String: “start_date”

    successString

    A property that contains a success string. It is a string that can be any alphanumeric value. This field has a somewhat generic quality, in that it can contain whatever you consider to be fitting value.

    Info Dictionary Key String: “success”

    userIdString

    A property that contains a user id. It is a string that can be any alphanumeric value. This field has a somewhat generic quality, in that it can contain whatever you consider to be fitting value.

    Info Dictionary Key String: “user_id”

    userNameString

    A property that contains a username. This is intended to be used to store an account-syle username, as opposed to a user’s name (compare “nameString”). It is a string that can be any alphanumeric value. This field has a somewhat generic quality, in that it can contain whatever you consider to be fitting value.

    Info Dictionary Key String: “user_name”

    validatedString

    A property that contains a validated string. It is a string that is intended to contain a boolean-like value, such as “true” or “false”. It can also contain other custom values such as “partial”. This field has a somewhat generic quality, in that it can contain whatever you consider to be fitting value.

    Info Dictionary Key String: “validated”

    Relationships

    Inherits From NSObject

    See Also

    Related Symbols class KochavaTracker

    The class KochavaTracker provides an interface between a host application and Kochava’s Attribution and Analytics Servers. A tracker manages the exchange of data between these two entities, along with the associated tasks and network transactions.

    enum KochavaEventTypeEnum

    An enumeration that defines a type of event for an instance of class KochavaEvent.

    sendEvent:

    Sends an instance of class KochavaEvent to the Kochava Server.

    sendEventWithNameString:infoDictionary:

    Creates an instance of class KochavaEvent which has a nameString and an optional infoDictionary, and then sends it to the Kochava Server. A convenience method.

    sendEventWithNameString:infoString:

    Creates an instance of class KochavaEvent which has a nameString and an optional infoString, and then sends it to the Kochava Server. A convenience method.

 
 

Last Modified: Jun 11, 2018 at 7:25 am