Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
snyaggarwal committed Jun 28, 2023
1 parent 72260a7 commit 5fda9c9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"react-diff-viewer": "^3.1.1",
"react-dom": "^17.0.2",
"react-dropzone": "^11.7.1",
"react-ga": "^3.3.1",
"react-ga4": "^2.1.0",
"react-google-recaptcha": "^2.1.0",
"react-hotjar": "^5.5.0",
"react-i18next": "^12.1.5",
Expand Down
6 changes: 3 additions & 3 deletions src/common/utils.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*eslint no-process-env: 0*/
import 'core-js/features/url-search-params';
import React from 'react';
import ReactGA from 'react-ga';
import ReactGA from 'react-ga4';
import alertifyjs from 'alertifyjs';
import moment from 'moment';
import {
Expand Down Expand Up @@ -591,14 +591,14 @@ export const getOpenMRSURL = () => {
export const recordGAPageView = () => {
/*eslint no-undef: 0*/
ReactGA.initialize(window.GA_ACCOUNT_ID || process.env.GA_ACCOUNT_ID);
ReactGA.pageview(window.location.pathname + window.location.hash);
ReactGA.send({ hitType: "pageview", page: window.location.pathname + window.location.hash });
}

export const recordGAAction = (category, action, label) => {
/*eslint no-undef: 0*/
if(category && action) {
ReactGA.initialize(window.GA_ACCOUNT_ID || process.env.GA_ACCOUNT_ID);
ReactGA.event({category: category, action: action, label: label || action});
ReactGA.event({category: category, action: action, label: label || action, transport: "xhr"});
}
}

Expand Down

0 comments on commit 5fda9c9

Please sign in to comment.