React Native tracker 0.1.0 released

We are very excited to announce the first production release of Snowplow React Native tracker - version 0.1.0.

The react native tracker imports the native Snowplow iOS and Android trackers to react-native, as Native Modules. Much of the functionality of the native versions of the tracker is available.

The source code can be found in the react-native tracker repo.

Key Features:

  • Automatic tracking

Automatic tracking of the mobile context, screen context, session context, installs and lifecycle events are available, configurable on tracker initialisation.

  • Standard events:

Screen View, Page View, and Structured events are available.

  • Custom tracking:

Custom Self-Describing events and contexts are available.

  • Setting subject data

The subject can be set using the setSubjectData() method.

Quickstart:

npm install @snowplow/react-native-tracker

import Tracker from '@snowplow/react-native-tracker';

initialize({
  endpoint: 'my-endpoint.com',
  namespace: 'namespace',
  appId: 'my-app-id'
});

trackScreenViewEvent({screenName: 'myScreenName'})

Changes since the alpha versions

Massive thank you to those who have used the alpha versions so far, and provieded their issues, feedback and contributions! We hope to see the same level of enthusiasm continue.

Those users should note some breaking changes with this release:

  • All track methods now take only two arguments: a JSON of key-value pairs, and an optional array of context SD-JSONs.

  • Several parameters of initialize() have been renamed to avoid the prefix β€˜set’. This is an established convention in the native trackers and normally indicates a standalone method rather than a configuration option.

  • The defaults for initialize() parameters have changed, to reflect a minimal recommended config.

  • The autoScreenView option has been removed from initialize() - this feature was experimental and doesn’t behave consistently. We are keen to scope out how to instrument this kind of feature in a way that is more react-native friendly. Ideas are welcome - feel free to open a discourse topic on the subject.

  • trackScreenView() parameters removed - the option to manually set screen ID, and previous screen information have been removed. These are automatically managed internally by the tracker, and manually setting them can lead to inconsistent behaviour.

Feedback and contributing

We are still keen to hear feedback and for contributions! Please feel free to open discourse topics with ideas, and add issues and bugreports to the repo.

The next release will include the introduction of automated testing. PRs are still welcome, but due to the time investment required for thorough manual testing, they may not be reviewed and merged until we have those tests in place. If in doubt, open an issue or a discourse post to ask about your contribution - important contributions - especially bugfixes - will be prioritised.

4 Likes