Skip to content

Commit

Permalink
update google analytics
Browse files Browse the repository at this point in the history
  • Loading branch information
ndittren committed Jan 20, 2023
1 parent 1a758a1 commit b08e843
Show file tree
Hide file tree
Showing 7 changed files with 3,722 additions and 4,678 deletions.
8,373 changes: 3,710 additions & 4,663 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"prop-types": "~15.8.1",
"react": "~16.14.0",
"react-dom": "~16.14.0",
"react-ga": "~3.3.0",
"react-ga4": "~2.0.0",
"react-katex": "^3.0.1",
"react-router-dom": "~5.3.0",
"react-test-renderer": "~16.14.0",
Expand Down
2 changes: 1 addition & 1 deletion src/central_limit_theorem/CentralLimitGraph.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ let config = {
matrix: 'Array'
};
const math = create(all, config);
import ReactGA from 'react-ga';
import ReactGA from 'react-ga4';
import {
createHistogramArray, getHistogramMaxima,
createScatterPlotHistogram } from '../utils.js';
Expand Down
2 changes: 1 addition & 1 deletion src/clt_least_squares/CLTLeastSquares.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { Component } from 'react';
import ReactGA from 'react-ga';
import ReactGA from 'react-ga4';
import { Nav } from '../Nav.jsx';
import { InputForm } from './InputForm';
import { PopulationGraph } from './PopulationGraph';
Expand Down
2 changes: 1 addition & 1 deletion src/estimation_least_squares/LeastSquares.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { Component } from 'react';
import ReactGA from 'react-ga';
import ReactGA from 'react-ga4';
import { Nav } from '../Nav.jsx';

import { RegressionForm } from './RegressionForm';
Expand Down
2 changes: 1 addition & 1 deletion src/linear_regression_model/LinearRegressionModel.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { Component } from 'react';
import ReactGA from 'react-ga';
import ReactGA from 'react-ga4';
import PropTypes from 'prop-types';
import { TransitionGroup, CSSTransition } from 'react-transition-group';
import { Nav } from '../Nav.jsx';
Expand Down
17 changes: 7 additions & 10 deletions src/withTracker.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,17 @@
*/

import React, { Component } from 'react';
import ReactGA from 'react-ga';
import ReactGA from "react-ga4";

ReactGA.initialize('UA-51144540-29', {
testMode: process.env.NODE_ENV === 'test',
});
ReactGA.set({ anonymizeIp: true })
const options = {
gtagOptions: {anonymizeIp: true},
testMode: process.env.NODE_ENV === 'test'
}
ReactGA.initialize('G-VX2F4J3PWZ', options);

export default function withTracker(WrappedComponent, options = {}) {
const trackPage = (page) => {
ReactGA.set({
page,
...options
});
ReactGA.pageview(page);
ReactGA.send({ hitType: "pageview", page: page, ...options });
};

const HOC = class extends Component {
Expand Down

0 comments on commit b08e843

Please sign in to comment.