react-tag-manager
Advanced tools
Comparing version 2.0.0-beta.6 to 2.0.0-beta.7
import debug from 'debug'; | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import Helmet from 'react-helmet'; | ||
import { withRouter } from 'react-router'; | ||
@@ -231,3 +232,9 @@ | ||
return _ret = (_temp = (_this = possibleConstructorReturn(this, (_ref = PageView.__proto__ || Object.getPrototypeOf(PageView)).call.apply(_ref, [this].concat(args))), _this), _this.sendPageView = function () { | ||
return _ret = (_temp = (_this = possibleConstructorReturn(this, (_ref = PageView.__proto__ || Object.getPrototypeOf(PageView)).call.apply(_ref, [this].concat(args))), _this), _this.sendPageView = false, _this.triggerPageView = function () { | ||
if (!_this.sendPageView) { | ||
return; | ||
} | ||
_this.sendPageView = false; | ||
var _this$props = _this.props, | ||
@@ -254,3 +261,3 @@ eventData = _this$props.data, | ||
value: function componentDidMount() { | ||
this.sendPageView(); | ||
this.sendPageView = true; | ||
} | ||
@@ -265,3 +272,3 @@ }, { | ||
if (newPathName !== oldPathName) { | ||
this.sendPageView(); | ||
this.sendPageView = true; | ||
} | ||
@@ -272,3 +279,10 @@ } | ||
value: function render() { | ||
return null; | ||
var _this2 = this; | ||
/** | ||
* We use Helmet's 'onChangeClientState' so we are sure the dom data is updated before sending the PageView | ||
*/ | ||
return React.createElement(Helmet, { onChangeClientState: function onChangeClientState() { | ||
return _this2.triggerPageView(); | ||
} }); | ||
} | ||
@@ -275,0 +289,0 @@ }]); |
@@ -10,2 +10,3 @@ 'use strict'; | ||
var PropTypes = _interopDefault(require('prop-types')); | ||
var Helmet = _interopDefault(require('react-helmet')); | ||
var reactRouter = require('react-router'); | ||
@@ -238,3 +239,9 @@ | ||
return _ret = (_temp = (_this = possibleConstructorReturn(this, (_ref = PageView.__proto__ || Object.getPrototypeOf(PageView)).call.apply(_ref, [this].concat(args))), _this), _this.sendPageView = function () { | ||
return _ret = (_temp = (_this = possibleConstructorReturn(this, (_ref = PageView.__proto__ || Object.getPrototypeOf(PageView)).call.apply(_ref, [this].concat(args))), _this), _this.sendPageView = false, _this.triggerPageView = function () { | ||
if (!_this.sendPageView) { | ||
return; | ||
} | ||
_this.sendPageView = false; | ||
var _this$props = _this.props, | ||
@@ -261,3 +268,3 @@ eventData = _this$props.data, | ||
value: function componentDidMount() { | ||
this.sendPageView(); | ||
this.sendPageView = true; | ||
} | ||
@@ -272,3 +279,3 @@ }, { | ||
if (newPathName !== oldPathName) { | ||
this.sendPageView(); | ||
this.sendPageView = true; | ||
} | ||
@@ -279,3 +286,10 @@ } | ||
value: function render() { | ||
return null; | ||
var _this2 = this; | ||
/** | ||
* We use Helmet's 'onChangeClientState' so we are sure the dom data is updated before sending the PageView | ||
*/ | ||
return React.createElement(Helmet, { onChangeClientState: function onChangeClientState() { | ||
return _this2.triggerPageView(); | ||
} }); | ||
} | ||
@@ -282,0 +296,0 @@ }]); |
{ | ||
"name": "react-tag-manager", | ||
"version": "2.0.0-beta.6", | ||
"version": "2.0.0-beta.7", | ||
"description": "Google Tag Manager for React", | ||
@@ -43,3 +43,4 @@ "keywords": [ | ||
"prop-types": "^15.6.1", | ||
"react": "^16.3.1", | ||
"react": "^16.3.2", | ||
"react-helmet": "^5.2.0", | ||
"react-router": "^4.2.0" | ||
@@ -49,3 +50,3 @@ }, | ||
"babel-cli": "^6.26.0", | ||
"babel-eslint": "^8.2.2", | ||
"babel-eslint": "^8.2.3", | ||
"babel-jest": "^22.4.3", | ||
@@ -63,5 +64,5 @@ "babel-plugin-add-react-displayname": "0.0.5", | ||
"eslint-formatter-pretty": "^1.3.0", | ||
"eslint-plugin-babel": "^5.0.0", | ||
"eslint-plugin-import": "^2.10.0", | ||
"eslint-plugin-jest": "^21.15.0", | ||
"eslint-plugin-babel": "^5.1.0", | ||
"eslint-plugin-import": "^2.11.0", | ||
"eslint-plugin-jest": "^21.15.1", | ||
"eslint-plugin-jsx-a11y": "^6.0.3", | ||
@@ -71,13 +72,7 @@ "eslint-plugin-node": "^6.0.1", | ||
"eslint-plugin-react": "^7.7.0", | ||
"eslint-plugin-standard": "^3.0.1", | ||
"flow-bin": "^0.69.0", | ||
"flow-copy-source": "^1.3.0", | ||
"eslint-plugin-standard": "^3.1.0", | ||
"jest": "^22.4.3", | ||
"nock": "^9.2.3", | ||
"react-test-renderer": "^16.3.1", | ||
"redux": "^3.7.2", | ||
"redux-mock-store": "^1.5.1", | ||
"redux-thunk": "^2.2.0", | ||
"rollup": "^0.57.1", | ||
"rollup-plugin-babel": "^3.0.3", | ||
"react-test-renderer": "^16.3.2", | ||
"rollup": "^0.58.2", | ||
"rollup-plugin-babel": "^3.0.4", | ||
"rollup-plugin-node-resolve": "^3.3.0" | ||
@@ -84,0 +79,0 @@ }, |
@@ -32,14 +32,14 @@ <p align="center"> | ||
id: 'GTM-12345', | ||
auth: '', // Optional | ||
preview: '', // Optional | ||
auth: '', // Optional | ||
preview: '', // Optional | ||
}} | ||
settings={{ | ||
sendPageView: true, // default false | ||
pageView: { // default null | ||
event: 'pageview', // default | ||
data : {}, // default | ||
sendPageView: true, // default false | ||
pageView: { // default null | ||
event: 'pageview', // default | ||
data : {}, // default | ||
settings: { | ||
locationProp: 'pathname', // default | ||
sendAs : 'url', // default | ||
locationProp: 'pathname', // default | ||
sendAs : 'url', // default | ||
}, | ||
@@ -163,5 +163,5 @@ } | ||
### Using development version in local project | ||
You can use `npm link` to use your development version in your own project: | ||
- Go to `react-tag-manager` directory and execute command `npm link` | ||
- Go to your project directory and execute command `npm link react-tag-manager` | ||
You can use `npm link` / `yarn link` to use your development version in your own project: | ||
- Go to `react-tag-manager` directory and execute command `npm link` / `yarn link` | ||
- Go to your project directory and execute command `npm link react-tag-manager` / `yarn link react-tag-manager` | ||
@@ -168,0 +168,0 @@ ## [License](https://github.com/TriPSs/react-tag-manager/blob/master/LICENSE) |
@@ -1,2 +0,2 @@ | ||
import * as p from 'path' | ||
import path from 'path' | ||
import babel from 'rollup-plugin-babel' | ||
@@ -6,3 +6,3 @@ import resolve from 'rollup-plugin-node-resolve'; | ||
export default { | ||
input : p.resolve('src/index.js'), | ||
input : path.resolve('src/index.js'), | ||
output : [ | ||
@@ -17,2 +17,3 @@ { file: 'lib/index.js', format: 'cjs' }, | ||
'react-router', | ||
'react-helmet', | ||
], | ||
@@ -19,0 +20,0 @@ plugins : [ |
Sorry, the diff of this file is not supported yet
27
954
215316
5
+ Addedreact-helmet@^5.2.0
+ Addedreact-fast-compare@2.0.4(transitive)
+ Addedreact-helmet@5.2.1(transitive)
+ Addedreact-side-effect@1.2.0(transitive)
+ Addedshallowequal@1.1.0(transitive)
Updatedreact@^16.3.2