Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/hzdg/react-google-analytics

Google analytics component
https://github.com/hzdg/react-google-analytics

Last synced: about 2 months ago
JSON representation

Google analytics component

Awesome Lists containing this project

README

        

react-google-analytics
======================

Adds the Google Analytics script to your page and exposes the `ga` tracking
function as a module.

Usage:

```javascript
var ga = require('react-google-analytics');
var GAInitiailizer = ga.Initializer;

// Use the initializer to add the script to your page somewhere.
var MyComponent = React.createClass({
render: function() {
return (


// SNIP

// SNIP

);
}
});
```

Elsewhere, use the `ga` function:

```javascript
var ga = require('react-google-analytics');
ga('create', 'UA-XXXX-Y', 'auto');
ga('send', 'pageview');
```