PermutiveApi

Functions

Link copied to clipboard
abstract suspend fun clearPersistentData(): Result<Unit>

Clear all persistent data of the current Permutive instance

abstract fun clearPersistentData(onSuccess: () -> Unit, onFailure: (Throwable) -> Unit)

Clear all persistent data of the current Permutive instance. Callbacks will run on the main thread.

Link copied to clipboard
abstract override fun close()
Link copied to clipboard
abstract fun createVideoTracker(duration: Long, eventProperties: EventProperties? = null, title: String? = null, url: Uri? = null, referrer: Uri? = null): MediaTracker

Deprecated, please use trackVideoView: trackVideoView( duration: Long, videoProperties: MediaTracker.VideoProperties?, pageProperties: MediaTracker.PageProperties?, eventProperties: EventProperties? ): MediaTracker

Link copied to clipboard
abstract fun currentUserId(): String
Link copied to clipboard

Create an EventTracker object. Any number of these may be created.

Link copied to clipboard
abstract fun logger(): Logger
Link copied to clipboard
abstract fun recordAppNexusAdImpression(auctionId: String?, buyerMemberId: Int?, creativeId: String?, source: String?, type: String?, height: Int?, tagId: String?, targeting: List<Pair<String, String>>)
Link copied to clipboard
abstract fun recordAppNexusTargeting(cohortIdsAttached: List<String>)
Link copied to clipboard
abstract fun recordGamTargeting(cohortIdsAttached: List<String>)
Link copied to clipboard
abstract fun sessionId(): String?
Link copied to clipboard
abstract fun setDeveloperMode(enable: Boolean)

Enable/disable developer mode which will log more information to the console.

Link copied to clipboard
abstract fun setIdentity(identity: String)

Associate an alias with the current user with lowest priority that never expires. Forces segments and queries to be updated with the associated identity, if there is one on the server.

abstract fun setIdentity(aliases: List<Alias>)

Associate an list of aliases with the current user. Aliases are resolved in the order given. Forces segments and queries to be updated with the associated identity, if there is one on the server.

abstract fun setIdentity(identity: String, priority: Int? = Alias.LOWEST_PRIORITY, expiry: Date? = Alias.NEVER_EXPIRE)

Associate an alias with the current user. Forces segments and queries to be updated with the associated identity, if there is one on the server. Aliases will be deleted when their expiry is in the past.

Link copied to clipboard
abstract fun setReferrer(referrer: Uri?)

Set the referrer context, used when tracking events.

Link copied to clipboard
abstract fun setTitle(title: String?)

Set the title context, used when tracking events.

Link copied to clipboard
abstract fun setUrl(url: Uri?)

Set the url context, used when tracking events.

Link copied to clipboard
abstract fun <T> trackApiCall(name: ApiFunction, func: () -> T): T
Link copied to clipboard
abstract fun trackPage(eventProperties: EventProperties? = null, title: String? = null, url: Uri? = null, referrer: Uri? = null): PageTracker

Create a page tracker object with the given context & properties. A PageTracker object will automatically track a Pageview and PageviewComplete events upon creation and closing of the PageTracker object.

Link copied to clipboard
abstract fun trackVideoAdView(durationMs: Long, adProperties: AdTracker.AdProperties?, pageProperties: MediaTracker.PageProperties?, customEventProperties: EventProperties? = null): AdTracker

Track a VideoAdView event and return an AdTracker for tracking video ad playback and interaction.

Link copied to clipboard
abstract fun trackVideoView(durationMilliseconds: Long, videoProperties: MediaTracker.VideoProperties?, pageProperties: MediaTracker.PageProperties?, customEventProperties: EventProperties? = null): MediaTracker

Track a Videoview event and return a MediaTracker for tracking user interaction with video content.

Link copied to clipboard

Create a TriggersProvider object. Any number of these may be created.

Link copied to clipboard
abstract fun viewId(): String?
Link copied to clipboard
abstract fun workspaceId(): String

Properties

Link copied to clipboard
Link copied to clipboard
abstract val currentCohorts: List<String>
Link copied to clipboard
abstract val currentMetrics: SdkMetrics

Property containing basic metrics of the SDK

Link copied to clipboard
Link copied to clipboard
abstract val currentSegments: List<Int>

Inheritors

Link copied to clipboard