Back to home

js/

Segment

Version: 0.0.2

Last Updated: Unknown


Segment JS

This snippet is only used to set up Segment IO.

Setup

Place REACT_APP_SEGMENT_KEY in the .env file and import Segment during initialisation and run Segment.init();.

Usage and Examples

Recommendation would be to place an Emitter event for it.

Emitter.emit('event', { name: 'John Doe', email: 'okeeffe_d@icloud.com', plan: 'Enterprise' });

Other examples

window.analytics.identify('userId12345', { firstName: 'Dennis', lastName: `O'Keeffe`, email: 'okeeffe_d@icloud.com' });

window.analytics.track('Email Opened', { name: 'John Doe', email: 'okeeffe_d@icloud.com', plan: 'Enterprise' });

Install


Repository

https://github.com/okeeffed/pkg-js-segment

Sections