react-redux-analytics-sitecatalyst

0.0.5 • Public • Published

SiteCatalyst plugin for react-redux-analytics

Features

  • Track PageView by s.t() with custom variables
  • Track Custom Event by s.tl() tracking with custom variables
  • Set analytics variables to s object on PageView and Custom event tracking

Installation

npm install --save react-redux-analytics

Getting Started

1. Register Middleware

place SiteCatalystMiddlware just after AnalyticsMiddleware

import { applyMiddleware } from 'redux'
import { analyticsMiddleware } from 'react-redux-analytics'
import { siteCatalystMiddlware } from 'react-redux-analytics-sitecatalyst'
 
const sConfig = {
  s_account: '[[YOUR S_ACCOUNT]]', //required
  s_code: {
    visitorNamespace: '[[YOUR VISITOR NAMESPACE]]', //required
    trackingServer: '[[YOUR TRACKING SERVER]]', //required
    ..., //other s_code options
  },
}
 
const enhancer = applyMiddleware(...,
  analyticsMiddleware({
    reducerName: 'analytics',
    ...
  }),
  siteCatalystMiddlware({
    s_gi: (s_account) => window.s_gi(s_account), // or import s_code.js as a node module
    config: sConfig,
    ...
  })
)

2. Register Reducer

https://www.npmjs.com/package/react-redux-analytics

3. Track Page View on componentDidMount

https://www.npmjs.com/package/react-redux-analytics

4. Track Custom Event on Click

https://www.npmjs.com/package/react-redux-analytics

API

siteCatalystMiddleware

Package Sidebar

Install

npm i react-redux-analytics-sitecatalyst

Weekly Downloads

14

Version

0.0.5

License

MIT

Last publish

Collaborators

  • r_takanashi_hiroki