Analytics integration for Redux and ngrx/store
npm install --save redux-beacon
How it works
Rendux-Beacon provides a way to map your Redux or ngrx actions to
analytics events. Once generated, Redux-Beacon sends the analytics
events to a given target (e.g. Google Analytics).
Analytics events are defined in an event definition, and mapped to
actions in an event definitions map:
const pageView = {
eventFields: action => ({
hitType: 'pageview',
page: action.payload,
}),
};
const eventsMap = {
LOCATION_CHANGE: pageView,
}
With the above event definitions map, Redux-Beacon will create a
pageView
event whenever an action with type LOCATION_CHANGE
is
fired, then it will push the generated event to a given target
(e.g. Google Analytics).
Quick Start
Targets
Redux-Beacon provides prebuilt targets for some popular analytics
services:
Docs
Check out the project site
for API docs, tutorials, examples and more.