Application Analytics for Conviva iOS/tvOS Sensor

Use Application Analytics to autocollect events and track application specific events and state changes.

Updated 2026-06-30 ios, application, analytics, sensor developer center, sensor integration, application analytics

Use Application Analytics to autocollect events and track application specific events and state changes.

Download

Description Version File Updated
ConvivaAppAnalytics.xcframework v0.2.0 Download conviva-release-ios-appanalytics-0.2.0.42.zip 20/APR/2022

Supported OS Versions

The iOS/tvOS tracker supports iOS 9.0 and tvOS 9.0.

Initialization

Install the Conviva library

  1. Download and unzip the package from Downloads. During the build phase, add ConvivaAppAnalytics.xcframework to Link Binary with Libraries section in xcode. This package contains the frameworks for both, iOS and tvOS.

  2. Link the following system frameworks to Link Binary with Libraries section in xcode:

  • UIKit

  • Foundation

  • CoreTelephony (iOS only)

  • FMDB (version 2.7 or above)

  1. In Other Linker Flags section in Xcode, add "-ObjC".

  2. To refer to the Conviva classes from your source code, add the following import statements:

import ConvivaAppAnalytics

Initialize the top level object

Initialize the top level CATAppAnalytics object.

var tracker = CATAppAnalytics.createTracker(customerKey: 
"<YOUR_CUSTOMER_KEY_ADVISED_BY_Conviva>", appName: 
"<YOUR_APP_NAME_ADVISED_BY_Conviva>")

Set the user id (viewer id)

tracker.subject.userId = "user_id";

Custom event tracking to track your application specific events and state changes

Use trackCustomEvent() API to track all kinds of events. This API provides 2 fields to describe the tracked events.

  • eventName - Name of the custom event.

  • eventData - Any type of data in string format.

The following example shows the implementation of the 'onClick' event listener to any element.

Structured event = Structured("my-category", "my-action")
.label("my-label")
.property("my-property")
.value(5);
tracker.track(event);
let data = "{\"identifier1\": \"test\",\"identifier2\": 1,\"identifier3\":true}"

tracker.trackCustomEvent("your-event-name", data: data);