authscape 1.0.592 → 1.0.594

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -188,7 +188,7 @@ function AuthScapeApp(_ref) {
188
188
  return _initGA.apply(this, arguments);
189
189
  }
190
190
  var logEvent = function logEvent(category, action, label) {
191
- if (ga4React != null) {
191
+ if (ga4React != null && ga4React.current != null && ga4React != "") {
192
192
  ga4React.current.event(action, label, category);
193
193
  }
194
194
  if (process.env.enableDatabaseAnalytics == "true") {
@@ -251,7 +251,7 @@ function AuthScapeApp(_ref) {
251
251
  }
252
252
  databaseDrivenPageView(window.location.pathname);
253
253
  _router["default"].events.on('routeChangeComplete', function () {
254
- if (ga4React != null) {
254
+ if (ga4React != null && ga4React != "") {
255
255
  try {
256
256
  ga4React.current.pageview(window.location.pathname);
257
257
  } catch (exp) {}
@@ -308,7 +308,7 @@ function AuthScapeApp(_ref) {
308
308
  setIsLoadingShow(isLoading);
309
309
  };
310
310
  var logPurchase = function logPurchase(transactionId, amount, tax, items) {
311
- if (ga4React != null) {
311
+ if (ga4React != null && ga4React != "") {
312
312
  ga4React.current.gtag("event", "purchase", {
313
313
  transaction_id: transactionId,
314
314
  value: amount,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "authscape",
3
- "version": "1.0.592",
3
+ "version": "1.0.594",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -128,7 +128,7 @@ export function AuthScapeApp ({Component, layout, loadingLayout, pageProps, muiT
128
128
 
129
129
  const logEvent = (category, action, label) => {
130
130
 
131
- if (ga4React != null)
131
+ if (ga4React != null && ga4React.current != null && ga4React != "")
132
132
  {
133
133
  ga4React.current.event(action, label, category);
134
134
  }
@@ -216,7 +216,7 @@ export function AuthScapeApp ({Component, layout, loadingLayout, pageProps, muiT
216
216
  databaseDrivenPageView(window.location.pathname);
217
217
  Router.events.on('routeChangeComplete', () => {
218
218
 
219
- if (ga4React != null)
219
+ if (ga4React != null && ga4React != "")
220
220
  {
221
221
  try
222
222
  {
@@ -277,7 +277,7 @@ export function AuthScapeApp ({Component, layout, loadingLayout, pageProps, muiT
277
277
 
278
278
  const logPurchase = (transactionId, amount, tax, items) => {
279
279
 
280
- if (ga4React != null)
280
+ if (ga4React != null && ga4React != "")
281
281
  {
282
282
  ga4React.current.gtag("event", "purchase", {
283
283
  transaction_id: transactionId,