ta-react-ga
v1.0.0-0
Published
Example component description.
Downloads
3
Maintainers
Readme
Google Analytics Component
Component for adding Google Analytics code into a page.
Installation
npm install ta-react-componentname --save
Usage
import GoogleAnalytics from 'ta-react-ga';
...
class YourComponent extends React.Component {
render() {
const trackerDefinitions = [
{
"id": "UA-111111-1",
"name": "example1",
"refresh": "01.11.2016 13:42:47",
"cache": "false"
},
{
"id": "UA-111111-7",
"name": "example2",
"refresh": "01.11.2016 13:42:47",
"cache": "false"
}
]
return (
<GoogleAnalytics trackers={trackerDefinitions} />
)
}
}
API – 1.0.0
Props
Property | Type | Required | Description
------|----|---------|-----------
trackers
| [object]
| yes | An array of tracker definitions, as seen in the example above.