Klaviyo

object Klaviyo

Public API for the core Klaviyo SDK. Receives profile changes and analytics requests to be processed and sent to the Klaviyo backend

Functions

Link copied to clipboard
fun createEvent(eventType: EventType): Klaviyo

Creates an Event associated with the currently tracked profile

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun handlePush(intent: Intent?): Klaviyo

From an opened push Intent, creates an EventType.OPENED_PUSH containing appropriate tracking parameters

Link copied to clipboard
fun initialize(apiKey: String, applicationContext: Context)

Configure Klaviyo SDK with your account's public API Key and application context. This must be called to before using any other SDK functionality

Link copied to clipboard

Checks whether a push notification payload originated from Klaviyo

Link copied to clipboard

Clears all stored profile identifiers (e.g. email or phone) and starts a new tracked profile

Link copied to clipboard
fun setEmail(email: String): Klaviyo

Assigns an email address to the currently tracked Klaviyo profile

Link copied to clipboard
fun setExternalId(externalId: String): Klaviyo

Assigns a unique identifier to associate the currently tracked Klaviyo profile with a profile in an external system, such as a point-of-sale system.

Link copied to clipboard
fun setPhoneNumber(phoneNumber: String): Klaviyo

Assigns a phone number to the currently tracked Klaviyo profile

Link copied to clipboard
fun setProfile(profile: Profile): Klaviyo

Assign new identifiers and attributes to the currently tracked profile. If a profile has already been identified it will be overwritten by calling resetProfile.

Link copied to clipboard
fun setProfileAttribute(propertyKey: ProfileKey, value: String): Klaviyo

Assign an attribute to the currently tracked profile by key/value pair

Link copied to clipboard
fun setPushToken(pushToken: String): Klaviyo

Saves a push token and registers to the current profile

Properties

Link copied to clipboard

Klaviyo lifecycle monitor which must be attached by the parent application so that the SDK can respond to environment changes such as internet availability and application termination