# combineEvents

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

## Import

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

## Syntax

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

### Parameters

* `eventDef1 ... eventDefN`: [`EventDefinition`](/redux-beacon/index-1/event-definition.md)
  * The events you want to combine together.

## Example

```javascript
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,
  ),
};
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://rangle.gitbook.io/redux-beacon/index-3/combine-events.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
