Skip to content

Commit

Permalink
Merge pull request #1081 from tomivm/fix-analytics
Browse files Browse the repository at this point in the history
Fix Analytics
  • Loading branch information
tomivm authored Nov 25, 2021
2 parents 802e106 + 1f5da48 commit 9c1f887
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 17 deletions.
16 changes: 8 additions & 8 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@
"@material-ui/icons": "^4.11.2",
"@material-ui/lab": "4.0.0-alpha.57",
"@microsoft/applicationinsights-web": "^2.6.3",
"@redux-beacon/google-analytics-gtag": "^1.0.2",
"@redux-beacon/google-analytics-gtag": "^1.1.0",
"@redux-beacon/logger": "^1.0.0",
"@redux-beacon/offline-web": "^1.0.0",
"axios": "^0.21.3",
"browser-image-resizer": "^1.2.0",
"dom-to-image": "^2.6.0",
"dotenv": "^8.6.0",
"echarts": "5.2.1",
"echarts-for-react": "^2.0.15-beta.1",
"echarts-for-react": "^3.0.2",
"file-saver": "^2.0.5",
"fontsource-roboto": "^4.0.0",
"formik": "^1.3.2",
Expand Down
1 change: 1 addition & 0 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
https://*.app.cboard.io/
https://*.app.qa.cboard.io/
https://www.google-analytics.com/
http://www.googletagmanager.com/gtag/js
https://www.google.com/ads/
https://www.google.com.ar/ads/
https://stats.g.doubleclick.net/
Expand Down
11 changes: 4 additions & 7 deletions src/components/Analytics/Analytics.container.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,13 +151,10 @@ export class AnalyticsContainer extends Component {
this.timerId = setTimeout(() => {
if (isCordova()) {
resolve(this.getGaClientIdFromCookie());
} else if (
typeof window.ga !== 'undefined' &&
typeof window.ga.getAll === 'function' &&
typeof window.ga.getAll()[0] !== 'undefined' &&
typeof window.ga.getAll()[0].get('clientId') !== 'undefined'
) {
resolve(window.ga.getAll()[0].get('clientId'));
} else if (typeof window.gtag !== 'undefined') {
window.gtag('get', 'UA-108091601-1', 'client_id', client_id => {
resolve(client_id);
});
} else {
reject(
new Error({ message: 'Google analytics client id not found' })
Expand Down

0 comments on commit 9c1f887

Please sign in to comment.