combineEvents

Combine multiple event defintions into one. Use this if you want to dispatch multiple analytics events for a single action.

Import

import combineEvents from '@redux-beacon/combine-events';

Syntax

combineEvents(eventDef1 [, eventDef2, ..., eventDef3])

Parameters

  • eventDef1 ... eventDefN: EventDefinition

    • The events you want to combine together.

Example

import combineEvents from '@redux-beacon/combine-events';
import { trackTiming, trackEvent } from '@redux-beacon/google-analytics';
import { VIDEO_PLAYING_ACTION } from './my/redux/actions';

const videoPlayed = trackEvent(() => ({
  category: 'Videos',
  action: 'play',
  label: 'Fall Campaign'
}));

const videoLoaded = trackTiming(() => ({
  category: 'Videos',
  var: 'load',
  value: 3549,
}));

const eventsMap = {
    videoPlayed,
    videoLoaded,
  ),
};

Last updated