authscape 1.0.590 → 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 +4 -8
- package/package.json +1 -1
- package/src/components/AuthScapeApp.js +3 -16
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,
|
|
@@ -449,11 +449,7 @@ function AuthScapeApp(_ref) {
|
|
|
449
449
|
setSuccessToastMessage: setSuccessToastMessage,
|
|
450
450
|
setWarnToastMessage: setWarnToastMessage,
|
|
451
451
|
setErrorToastMessage: setErrorToastMessage
|
|
452
|
-
}))), /*#__PURE__*/_react["default"].createElement(_reactToastify.ToastContainer, null)), loadingLayout && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, loadingLayout(isLoadingShow))
|
|
453
|
-
dangerouslySetInnerHTML: {
|
|
454
|
-
__html: "(function(c,l,a,r,i,t,y){\n c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)};\n t=l.createElement(r);t.async=1;t.src=\"https://www.clarity.ms/tag/\"+i;\n y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);\n })(window, document, \"clarity\", \"script\", \"" + process.env.microsoftClarityTrackingCode + "\");"
|
|
455
|
-
}
|
|
456
|
-
}));
|
|
452
|
+
}))), /*#__PURE__*/_react["default"].createElement(_reactToastify.ToastContainer, null)), loadingLayout && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, loadingLayout(isLoadingShow)));
|
|
457
453
|
}
|
|
458
454
|
"use strict";
|
|
459
455
|
|
package/package.json
CHANGED
|
@@ -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,
|
|
@@ -455,19 +455,6 @@ export function AuthScapeApp ({Component, layout, loadingLayout, pageProps, muiT
|
|
|
455
455
|
{loadingLayout(isLoadingShow)}
|
|
456
456
|
</>
|
|
457
457
|
}
|
|
458
|
-
|
|
459
|
-
{(frontEndLoadedState && process.env.microsoftClarityTrackingCode != null) &&
|
|
460
|
-
<script
|
|
461
|
-
dangerouslySetInnerHTML={{
|
|
462
|
-
__html:
|
|
463
|
-
`(function(c,l,a,r,i,t,y){
|
|
464
|
-
c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)};
|
|
465
|
-
t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i;
|
|
466
|
-
y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);
|
|
467
|
-
})(window, document, "clarity", "script", "` + process.env.microsoftClarityTrackingCode + `");`
|
|
468
|
-
}}
|
|
469
|
-
/>
|
|
470
|
-
}
|
|
471
458
|
</>
|
|
472
459
|
)
|
|
473
460
|
}
|