authscape 1.0.348 → 1.0.350
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 +18 -0
- package/package.json +1 -1
- package/src/services/analytics.js +20 -0
package/index.js
CHANGED
|
@@ -4142,7 +4142,9 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
4142
4142
|
Object.defineProperty(exports, "__esModule", {
|
|
4143
4143
|
value: true
|
|
4144
4144
|
});
|
|
4145
|
+
exports.ConversionEvents = ConversionEvents;
|
|
4145
4146
|
exports.init = init;
|
|
4147
|
+
exports.logConvertion = logConvertion;
|
|
4146
4148
|
exports.logEvent = logEvent;
|
|
4147
4149
|
exports.logPageView = logPageView;
|
|
4148
4150
|
exports.logPageViews = logPageViews;
|
|
@@ -4281,6 +4283,22 @@ function logPurchase(transactionId, amount, tax, items) {
|
|
|
4281
4283
|
});
|
|
4282
4284
|
}
|
|
4283
4285
|
}
|
|
4286
|
+
function logConvertion(transactionId, amount, tax, items) {
|
|
4287
|
+
if (ga4react != null) {
|
|
4288
|
+
ga4react.gtag("event", "purchase", {
|
|
4289
|
+
transaction_id: transactionId,
|
|
4290
|
+
value: amount,
|
|
4291
|
+
tax: tax,
|
|
4292
|
+
currency: "USD",
|
|
4293
|
+
items: items
|
|
4294
|
+
});
|
|
4295
|
+
}
|
|
4296
|
+
}
|
|
4297
|
+
function ConversionEvents(conversionName, payload) {
|
|
4298
|
+
if (ga4react != null) {
|
|
4299
|
+
ga4react.gtag("event", conversionName, payload);
|
|
4300
|
+
}
|
|
4301
|
+
}
|
|
4284
4302
|
"use strict";
|
|
4285
4303
|
|
|
4286
4304
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
package/package.json
CHANGED
|
@@ -85,4 +85,24 @@ export function logPurchase(transactionId, amount, tax, items) {
|
|
|
85
85
|
items: items
|
|
86
86
|
});
|
|
87
87
|
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export function logConvertion(transactionId, amount, tax, items) {
|
|
91
|
+
if (ga4react != null)
|
|
92
|
+
{
|
|
93
|
+
ga4react.gtag("event", "purchase", {
|
|
94
|
+
transaction_id: transactionId,
|
|
95
|
+
value: amount,
|
|
96
|
+
tax: tax,
|
|
97
|
+
currency: "USD",
|
|
98
|
+
items: items
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export function ConversionEvents(conversionName, payload) {
|
|
104
|
+
if (ga4react != null)
|
|
105
|
+
{
|
|
106
|
+
ga4react.gtag("event", conversionName, payload);
|
|
107
|
+
}
|
|
88
108
|
}
|