Usage Instructions

  1. Sign up for if you haven't already, and create a project for your web application!

  2. Add the JavaScript Tracking Snippet to your site.

    Tip: during development and testing it is often helpful to use the debug version of analytics.js. Follow the instructions here to enable it.

    Warning: the last line of the tracking snippet; hits with a page view that matches the first loaded route. If you're tracking page views using Redux Beacon, be sure to remove this line so the initial page load isn't recorded twice.

  3. Import the target, then provide it when creating middleware or a meta reducer:

    import { Segment } from 'redux-beacon/targets/segment';
    const middleware = createMiddleware(eventsMap, Segment);
    const metaReducer = createMetaReducer(eventsMap, Segment);

For Typescript Users

This target also exposes interfaces for common events:

import {
} from 'redux-beacon/targets/segment';

To use it, just specify the event in your event definition:

const pageView = (action): PageView => ({
  hitType: 'pageview',
  page: action.payload,