Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/hzdg/react-google-analytics
- Owner: hzdg
- License: other
- Created: 2014-04-04T19:28:49.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2017-05-24T09:09:51.000Z (over 7 years ago)
- Last Synced: 2024-04-14T04:31:59.866Z (8 months ago)
- Language: CoffeeScript
- Size: 458 KB
- Stars: 111
- Watchers: 26
- Forks: 9
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-react-components-all - react-google-analytics - Google analytics component. (Uncategorized / Uncategorized)
- awesome-react-components - react-google-analytics - Google analytics component. (Utilities / Integrations with Third Party Services)
- awesome-list - react-google-analytics - Google analytics component. (Utilities / Integrations with Third Party Services)
- awesome-react-components - react-google-analytics - Google analytics component. (Utilities / Integrations with Third Party Services)
- awesome-react-components - react-google-analytics - Google analytics component. (Utilities / Integrations with Third Party Services)
- awesome-react-components - react-google-analytics - Google analytics component. (Utilities / Integrations with Third Party Services)
- fucking-awesome-react-components - react-google-analytics - Google analytics component. (Utilities / Integrations with Third Party Services)
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');
```