Bucklescript bindings for react-ga.
It is designed to work with the latest version of Google Analytics, Universal Analytics. At this point, all Google Analytics projects are being upgraded to Universal Analytics, so this module will not support the older ga.js implementation.
This module is mildly opinionated in how we instrument tracking within our front-end code. Our API is slightly more verbose than the core Google Analytics library, in the hope that the code is easier to read and understand for our engineers. See examples below.
npm install --global bs-platform yarn install
How to compile
yarn add bs-react-ga
dependencies node of your
For the moment, only
pageView bindings are provided.
GA must be initialized using
initialize before any of the other tracking functions will record any data.
ReactGa.initialize("<you GA id>"); ReactGa.pageView(location.pathname ++ location.hash ++ location.search);