Get unlimited public & private packages + package-based permissions with npm Pro.Get started »

ta-react-ga

1.0.0-0 • Public • Published

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.

Install

npm i ta-react-ga

DownloadsWeekly Downloads

0

Version

1.0.0-0

License

ISC

Last publish

Collaborators

  • avatar