Snowplow

object Snowplow

Instance a new Snowplow tracker for local or remote configuration, and manage multiple trackers.

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

fun createTracker(context: Context, namespace: String, endpoint: String, method: HttpMethod = HttpMethod.POST): 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 settings and only the collector endpoint URL needs to be passed for the configuration. By default, the tracker will send events by POST; pass HttpMethod.GET here to change that. For the default configuration of the tracker see TrackerConfiguration

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

A tracker can be removed from the active trackers of the app. The removed tracker is always stopped, and cannot be added again or set as default. To "resume" a removed tracker, create a new tracker with the same namespace and configuration.

Link copied to clipboard

Set the passed tracker as default. The tracker must be active: one that has been removed (see Snowplow.removeTracker) cannot 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?>?>)
fun setup(context: Context, remoteConfiguration: RemoteConfiguration, defaultBundles: List<ConfigurationBundle>?, defaultBundleVersion: Int, onSuccess: Consumer<Pair<List<String>, ConfigurationState?>?>)

Set up 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 downloaded 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 WebView that listens for events tracked using the Snowplow library for WebViews.

Properties

Link copied to clipboard

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