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 - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

8

index.js

@@ -9,2 +9,3 @@ // @flow

debug: boolean,
trackPathnameOnly: boolean,
children?: React.Node,

@@ -53,2 +54,9 @@ location: Location,

// Do nothing if trackPathnameOnly is enabled and the pathname didn't change.
if (this.props.trackPathnameOnly && location.pathname === this.lastPathname) {
return;
}
this.lastPathname = location.pathname;
// Sets the page value on the tracker.

@@ -55,0 +63,0 @@ window.ga('set', 'page', location.pathname);

@@ -71,2 +71,9 @@ 'use strict';

// Do nothing if trackPathnameOnly is enabled and the pathname didn't change.
if (this.props.trackPathnameOnly && location.pathname === this.lastPathname) {
return;
}
this.lastPathname = location.pathname;
// Sets the page value on the tracker.

@@ -73,0 +80,0 @@ window.ga('set', 'page', location.pathname);

2

package.json
{
"name": "react-router-ga",
"version": "1.0.0",
"version": "1.1.0",
"main": "lib/index.js",

@@ -5,0 +5,0 @@ "license": "MIT",

# react-router-ga
Google Analytics component for React Router.
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.

@@ -11,2 +11,3 @@ ## Props

| `debug` | boolean | If enabled, react-router-ga will log all page views to the console | `false` |
| `trackPathnameOnly` | boolean | If enabled, react-router-ga will only send page views when the pathname changed | `false` |

@@ -29,3 +30,2 @@ ## Usage Example

<Route exact path="/login" component={Login} />
// your other routes
</Switch>

@@ -32,0 +32,0 @@ </App>

Sorry, the diff of this file is not supported yet

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