Segment

Setup

  1. Sign uparrow-up-right for Segment.io and create a Segment.io project for your web application.

  2. Add the JavaScript Tracking Snippetarrow-up-right to your site.

    During development and testing it is often helpful to use the debug version of analytics.js. Follow the instructions herearrow-up-right to enable it.

  3. Install the target:

     npm install --save @redux-beacon/segment

Usage

import Segment from '@redux-beacon/segment';

// Create or import an events map.
// See "getting started" pages for instructions.

const segment = Segment();

const segmentMiddleware = createMiddleware(eventsMap, segment);
const segmentMetaReducer = createMetaReducer(eventsMap, segment);

Event Definitions

Don't see your event listed? Please submit a pull request to the Redux Beacon repositoryarrow-up-right with the missing event. Use the source of the existing event-helpers to guide your work. If you need any support feel free to make the pull request with all you're able to do. We can fill in the gaps from there.

pageView

Docs:

https://segment.com/docs/sources/website/analytics.js/#pagearrow-up-right

triangle-exclamation

event

Docs:

https://segment.com/docs/sources/website/analytics.js/#trackarrow-up-right

alias

Docs:

https://segment.com/docs/sources/website/analytics.js/#aliasarrow-up-right

group

Docs:

https://segment.com/docs/sources/website/analytics.js/#grouparrow-up-right

identify

Docs:

https://segment.com/docs/sources/website/analytics.js/#identifyarrow-up-right

reset

Docs:

https://segment.com/docs/sources/website/analytics.js/#reset-logoutarrow-up-right

Last updated