Socket
Socket
Sign inDemoInstall

react-router-ga

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-router-ga

Google Analytics component for React Router. Bear in mind this is a super simple implementation that only logs page views. Logging of custom events, exceptions, user timings or social interactions is currently not supported.


Version published
Weekly downloads
793
decreased by-14.55%
Maintainers
1
Weekly downloads
 
Created
Source

react-router-ga

Google Analytics component for React Router. Bear in mind this is a super simple implementation that only logs page views. Logging of custom events, exceptions, user timings or social interactions is currently not supported.

Props

PropTypeDescriptionDefault value
idstringGoogle Analytics tracking IDRequired
debugbooleanIf enabled, react-router-ga will log all page views to the consolefalse
trackPathnameOnlybooleanIf enabled, react-router-ga will only send page views when the pathname changedfalse

Usage Example

import React from 'react';
import ReactDOM from 'react-dom';
import { BrowserRouter } from 'react-router-dom';
import Analytics from 'react-router-ga';
import App from './containers/App';
import Login from './containers/Login';

ReactDOM.render(
  <BrowserRouter>
    <Analytics id="UA-111111111-1" debug>
      <App>
        <Switch>
          <Route exact path="/login" component={Login} />
        </Switch>
      </App>
    </Analytics>
  </BrowserRouter>,
  document.getElementById('root')
);

Dependencies

This project has react@^16.2.0 and react-router-dom@^4.2.2 as peer dependencies.

Keywords

FAQs

Package last updated on 22 Jan 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc