Snowplow

object Snowplow

Entry point to instance a new Snowplow tracker.

Functions

Link copied to clipboard
fun createTracker(context: Context, namespace: String, network: NetworkConfiguration, vararg configurations: Configuration): TrackerController

Create a new tracker instance which will be used inside the app to track events. The app can run multiple tracker instances which will be identified by string namespaces. Each tracker can be configured by various configuration objects implementing the Configuration interface. For the default configuration of the tracker see TrackerConfiguration.TrackerConfiguration

fun createTracker(context: Context, namespace: String, endpoint: String, method: HttpMethod): TrackerController

Create a new tracker instance which will be used inside the app to track events. The app can run multiple tracker instances which will be identified by string namespaces. The tracker will be configured with default setting and only the collector endpoint URL need to be passed for the configuration. For the default configuration of the tracker see TrackerConfiguration

Link copied to clipboard

Using the namespace identifier is possible to get the trackerController if already instanced.

Link copied to clipboard

Reconfigure, create or delete the trackers based on the configuration downloaded remotely. The trackers configuration is automatically download from the endpoint indicated in the RemoteConfiguration previously used to setup the trackers.

Link copied to clipboard

Remove all the trackers. The removed tracker is always stopped.

Link copied to clipboard

A tracker can be removed from the active trackers of the app. Once it has been removed it can't be added again or set as default. The unique way to resume a removed tracker is creating a new tracker with same namespace and same configurations. The removed tracker is always stopped.

Link copied to clipboard

Set the passed tracker as default tracker if it's registered as an active tracker in the app. If the passed instance is of a tracker which is already removed (see .removeTracker) then it can't become the new default tracker and the operation fails.

Link copied to clipboard
fun setup(context: Context, remoteConfiguration: RemoteConfiguration, defaultBundles: List<ConfigurationBundle>?, onSuccess: Consumer<Pair<List<String>, ConfigurationState?>?>)

Setup a single or a set of tracker instances which will be used inside the app to track events. The app can run multiple tracker instances which will be identified by string namespaces. The trackers configuration is automatically download from the endpoint indicated in the RemoteConfiguration passed as argument. For more details see RemoteConfiguration.

Link copied to clipboard

Add a JavaScript interface to the Web view that listens for events tracked using the Snowplow library for Web views.

Properties

Link copied to clipboard

The default tracker instance is the first created in the app, but that can be overridden programmatically calling .setTrackerAsDefault.