1.0.0-0 • Published 9 years ago

ta-react-ga v1.0.0-0

Weekly downloads
1
License
ISC
Repository
gitlab
Last release
9 years ago

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

PropertyTypeRequiredDescription
trackers[object]yesAn array of tracker definitions, as seen in the example above.
1.0.0-0

9 years ago