Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
{
"plugins": [],
"presets": [
[
"babel-preset-gatsby",
{
"targets": {
"esmodules": true,
"browsers": [">0.25%", "not dead"]
"esmodules": true
}
}
]
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
14.20.1
18.15.0
61 changes: 24 additions & 37 deletions gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,43 +178,6 @@ module.exports = {
// resolve: `gatsby-plugin-create-client-paths`,
// options: { prefixes: [`/auth/*`, `/a/*`, `/members/profile/*`] },
// },
{
resolve: `gatsby-plugin-google-analytics`,
options: {
// The property ID; the tracking code won't be generated without it
trackingId: "UA-139234657-1",
// Defines where to place the tracking script - `true` in the head and `false` in the body
head: true,
// Setting this parameter is optional
anonymize: true,
// Setting this parameter is also optional
respectDNT: true,
},
},
{
resolve: `gatsby-plugin-google-gtag`,
options: {
// You can add multiple tracking ids and a pageview event will be fired for all of them.
trackingIds: [
"UA-139234657-1", // Google Analytics / GA,
],
// This object gets passed directly to the gtag config command
// This config will be shared across all trackingIds
gtagConfig: {
anonymize_ip: true,
cookie_expires: 0,
},
// This object is used for configuration specific to this plugin
pluginConfig: {
// Puts tracking script in the head instead of the body
head: false,
// Setting this parameter is also optional
respectDNT: true,
// Avoids sending pageview hits from custom paths
// exclude: ["/preview/**", "/do-not-track/me/too/"],
},
},
},
{
resolve: "gatsby-plugin-google-tagmanager",
options: {
Expand Down Expand Up @@ -247,6 +210,30 @@ module.exports = {
// Defaults to https://www.googletagmanager.com
// selfHostedOrigin: "YOUR_SELF_HOSTED_ORIGIN",
},
},
{
resolve: `gatsby-plugin-google-gtag`,
options: {
// You can add multiple tracking ids and a pageview event will be fired for all of them.
trackingIds: [
"UA-139234657-1", // Google Analytics / GA,
],
// This object gets passed directly to the gtag config command
// This config will be shared across all trackingIds
gtagConfig: {
anonymize_ip: true,
cookie_expires: 0,
},
// This object is used for configuration specific to this plugin
pluginConfig: {
// Puts tracking script in the head instead of the body
head: true,
// Setting this parameter is also optional
respectDNT: true,
// Avoids sending pageview hits from custom paths
// exclude: ["/preview/**", "/do-not-track/me/too/"],
},
},
},
{
resolve: `gatsby-plugin-manifest`,
Expand Down
2 changes: 1 addition & 1 deletion netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
functionsPort = 8888

[build.environment]
NODE_VERSION = "14.20.1"
NODE_VERSION = "18.15.0"
YARN_VERSION = "1.22.4"
YARN_FLAGS = "--no-ignore-optional"
[[headers]]
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"dependencies": {
"@ncwidgets/file-relation": "^0.8.0",
"@ncwidgets/id": "^0.8.1",
"@react-pdf/renderer": "^3.1.12",
"awesome-bootstrap-checkbox": "^1.0.1",
"axios": "^0.21.1",
"babel-preset-gatsby": "^2.11.0",
Expand Down Expand Up @@ -39,9 +40,8 @@
"gatsby-transformer-sharp": "^4.10.0",
"gatsby-plugin-anchor-links": "^1.2.1",
"gatsby-plugin-feed": "^4.24.0",
"gatsby-plugin-google-analytics": "^4.24.0",
"gatsby-plugin-google-gtag": "^4.24.0",
"gatsby-plugin-google-tagmanager": "^4.24.0",
"gatsby-plugin-google-tagmanager": "^5.12.3",
"gatsby-plugin-linkedin-insight": "^1.0.1",
"gatsby-plugin-manifest": "^4.24.0",
"gatsby-plugin-remove-serviceworker": "^1.0.0",
Expand All @@ -63,7 +63,7 @@
"netlify-cli": "^10.3.0",
"netlify-cms-app": "^2.13.3",
"node-sass": "^4.11.0",
"openstack-uicore-foundation": "^4.0.60",
"openstack-uicore-foundation": "^4.1.54",
"path-browserify": "^1.0.1",
"prop-types": "^15.6.0",
"react": "^17.0.0",
Expand Down
2 changes: 1 addition & 1 deletion src/components/LinkComponent.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import PropTypes from "prop-types"
import { Link } from 'gatsby'
import { OutboundLink } from 'gatsby-plugin-google-analytics'
import { OutboundLink } from "gatsby-plugin-google-gtag"

const LinkComponent = class extends React.Component {
render() {
Expand Down
13 changes: 9 additions & 4 deletions src/routes/PrivateRoute.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,16 @@ import HeroComponent from "../components/HeroComponent";
const PrivateRoute = ({ children, location, isLoggedUser, user, isIdTokenAlive, ...rest}) => {

if (!isLoggedUser) {
// do login after page is loaded and GA is called
if(typeof window !== 'undefined') {
window.setTimeout(() => {
doLogin(`${location.pathname}`);
}, 3000);
// do login after page is loaded and Google Tag Manager is loaded
function checkIfAnalyticsLoaded() {
if (typeof window.ga === 'function' && Array.isArray(window.dataLayer)) {
doLogin(`${location.pathname}`);
} else {
setTimeout(checkIfAnalyticsLoaded, 500);
}
}
checkIfAnalyticsLoaded();
}
return <HeroComponent title={'Checking Credentials ...'}/>
}
Expand Down
Loading