React Native Tracker 0.1.0-alpha-16

Hi All,

We have recently released a new alpha version of the react-native tracker, that includes a lot of new functionality. Because the project is still in alpha it doesn’t warrant a full release post, but there’s a lot of cool stuff in there so I thought I’d post the key info here informally.

I’ve also rewritten the readme to make usage clearer. Docs are on the repo

The next announcement on this subject will hopefully be a beta release!

New functionality

The initialize method now takes a set of arguments to enable some of the mobile trackers’ standard event and entity tracking functionality:

initialize('test-endpoint', 'post', 'https', 'namespace', 'my-app-id', {
  setPlatformContext: true,
  setBase64Encoded: true,
  setApplicationContext: true,
  setLifecycleEvents: true,
  setScreenContext: true,
  setSessionContext: true,
  foregroundTimeout: 600, // 10 minutes
  backgroundTimeout: 300, // 5 minutes
  checkInterval: 15,
  setInstallEvent: true
  });

The subject can now be set, and updated at any time:

setSubjectData({ // All parameters optional
  userId: 'my-userId', // user id, string
  screenWidth: 123, // screen width, integer
  screenHeight: 456, // screen height, integer
  colorDepth: 20, // colour depth, integer
  timezone: 'EST', // timezone, string enum
  language: 'en', // language, string enum
  ipAddress: '12.345.67', // IP address, string
  useragent: '[some-user-agent-string]', // user agent, string
  networkUserId: '5d79770b-015b-4af8-8c91-b2ed6faf4b1e', // network user id, UUID4 string
  domainUserId: '5d79770b-015b-4af8-8c91-b2ed6faf4b1e',// domain user id, UUID4 string
  viewportWidth: 123, // viewport width, integer
  viewportHeight: 456 // viewport height, integer
});

Page views are now available:

trackPageViewEvent('my-page-url.com', // required, page url, string
                  'my page title', // optional - set to null if not needed, page title, string
                  'my-page-referrer.com', // optional - set to null if not needed, referrer url, string
                  []); // array of self-describing JSONs for custom contexts, or an empty array if none are to be attached

It would be great to hear back from anyone who uses these to find out how they’re working! Please report issues on the repo, or just reply here with feedback!

Not yet implemented

The geolocation context and exception tracking are so far not implemented - this is mainly due to time constraints. This release was driven by a community PR, I had a limited window of time to test and push those releases, and these two methods manifested the most time consuming difficulties in testing.

The future

As it stands, the next piece of work on this tracker is looking quite likely to be a beta release. This will introduce breaking changes. Specifically:

setAutoTrackScreenViews will be removed. It doesn’t work as intended.

All the methods will be changed to take the same argument structure - probably just a single JSON. Tracking implementations will need to be updated to suit.

Finally

Massive thank you to @mbondarenko for submitting the initial PR for this release!

Additionally, thank you to all of the community who have submitted feedback and input on the alpha so far!

4 Likes

@tfinkel, @kinney, @Alexandre_Rayes, @postfactum, @VanHoutte, @mmikolayatq, @mike - all of you were on the other thread, so FYI. :slight_smile: