@artisan-commerce/analytics-rn 0.3.0-canary.76 → 0.3.0-canary.78
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/dist/bundle.cjs.js +54 -54
- package/dist/bundle.cjs.js.map +1 -1
- package/dist/bundle.d.ts +2 -2
- package/dist/bundle.esm.js +8 -8
- package/dist/bundle.esm.js.map +1 -1
- package/package.json +7 -7
package/dist/bundle.cjs.js
CHANGED
|
@@ -7,7 +7,7 @@ var reactNative = require('react-native');
|
|
|
7
7
|
var state = require('@artisan-commerce/state');
|
|
8
8
|
var analytics = require('@segment/analytics-react-native');
|
|
9
9
|
var analytics$1 = require('@react-native-firebase/analytics');
|
|
10
|
-
var
|
|
10
|
+
var shoppingCartCore = require('@artisan-commerce/shopping-cart-core');
|
|
11
11
|
var products = require('@artisan-commerce/products');
|
|
12
12
|
|
|
13
13
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
@@ -17,7 +17,7 @@ var analytics__default$1 = /*#__PURE__*/_interopDefaultLegacy(analytics$1);
|
|
|
17
17
|
|
|
18
18
|
var name = "@artisan-commerce/analytics-rn";
|
|
19
19
|
var description = "Artisn commerce analytics react native library";
|
|
20
|
-
var version = "0.3.0-canary.
|
|
20
|
+
var version = "0.3.0-canary.78";
|
|
21
21
|
var main = "./dist/bundle.cjs.js";
|
|
22
22
|
var module$1 = "./dist/bundle.esm.js";
|
|
23
23
|
var types = "./dist/bundle.d.ts";
|
|
@@ -51,10 +51,10 @@ var dependencies = {
|
|
|
51
51
|
"snake-case": "^3.0.4"
|
|
52
52
|
};
|
|
53
53
|
var devDependencies = {
|
|
54
|
-
"@artisan-commerce/products": "0.9.0-canary.
|
|
55
|
-
"@artisan-commerce/shopping-cart": "0.12.0-canary.
|
|
56
|
-
"@artisan-commerce/state": "0.3.0-canary.
|
|
57
|
-
"@artisan-commerce/types": "0.14.0-canary.
|
|
54
|
+
"@artisan-commerce/products": "0.9.0-canary.50",
|
|
55
|
+
"@artisan-commerce/shopping-cart-core": "0.12.0-canary.73",
|
|
56
|
+
"@artisan-commerce/state": "0.3.0-canary.9",
|
|
57
|
+
"@artisan-commerce/types": "0.14.0-canary.38",
|
|
58
58
|
"@babel/core": "^7.13.15",
|
|
59
59
|
"@babel/preset-env": "^7.10.4",
|
|
60
60
|
"@babel/preset-react": "^7.10.4",
|
|
@@ -68,7 +68,7 @@ var devDependencies = {
|
|
|
68
68
|
};
|
|
69
69
|
var peerDependencies = {
|
|
70
70
|
"@artisan-commerce/products": "*",
|
|
71
|
-
"@artisan-commerce/shopping-cart": "*",
|
|
71
|
+
"@artisan-commerce/shopping-cart-core": "*",
|
|
72
72
|
"@artisan-commerce/state": "*",
|
|
73
73
|
"@react-native-firebase/analytics": "*",
|
|
74
74
|
"@react-native-firebase/app": "*",
|
|
@@ -95,7 +95,7 @@ var nx = {
|
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
97
|
};
|
|
98
|
-
var gitHead = "
|
|
98
|
+
var gitHead = "8b7e9003491df2d60084bec12a957e6b14b5a0f9";
|
|
99
99
|
var packageJSON = {
|
|
100
100
|
name: name,
|
|
101
101
|
description: description,
|
|
@@ -788,20 +788,20 @@ const triageEventToProviders = (eventName, params, providersHandlers) => {
|
|
|
788
788
|
}, []);
|
|
789
789
|
eventSent(eventName, targetedProviders);
|
|
790
790
|
};
|
|
791
|
-
const getProductIdsFromShoppingCart = (shoppingCart
|
|
792
|
-
const products =
|
|
791
|
+
const getProductIdsFromShoppingCart = (shoppingCart) => {
|
|
792
|
+
const products = shoppingCartCore.getShoppingCartProducts(shoppingCart);
|
|
793
793
|
return products.map((product) => product.productId);
|
|
794
794
|
};
|
|
795
|
-
const getProductContentFromShoppingCart = (shoppingCart
|
|
796
|
-
const products =
|
|
795
|
+
const getProductContentFromShoppingCart = (shoppingCart) => {
|
|
796
|
+
const products = shoppingCartCore.getShoppingCartProducts(shoppingCart);
|
|
797
797
|
return products.map((product) => getProductContent(product));
|
|
798
798
|
};
|
|
799
799
|
const getProductContent = (product) => {
|
|
800
800
|
const totals = products.getProductTotals(product);
|
|
801
801
|
return `${product.name}:${totals.netPrice}`;
|
|
802
802
|
};
|
|
803
|
-
const mapProductsToGoogleItems = (shoppingCart
|
|
804
|
-
const products =
|
|
803
|
+
const mapProductsToGoogleItems = (shoppingCart, currency) => {
|
|
804
|
+
const products = shoppingCartCore.getShoppingCartProducts(shoppingCart);
|
|
805
805
|
return products.map((product) => mapProductToGoogleItem(product, currency));
|
|
806
806
|
};
|
|
807
807
|
const mapProductToGoogleItem = (product, currency) => {
|
|
@@ -3144,7 +3144,7 @@ var __objRest$32 = (source, exclude) => {
|
|
|
3144
3144
|
const initiateCheckout$2 = (provider, params) => {
|
|
3145
3145
|
const { userId: providerUserId } = provider;
|
|
3146
3146
|
const { currency: providerCurrency } = provider;
|
|
3147
|
-
const _a = params, { userId, shoppingCart
|
|
3147
|
+
const _a = params, { userId, shoppingCart, currency } = _a, rest = __objRest$32(_a, ["userId", "shoppingCart", "currency"]);
|
|
3148
3148
|
const selectedUserId = userId != null ? userId : providerUserId;
|
|
3149
3149
|
const selectedCurrency = currency != null ? currency : providerCurrency;
|
|
3150
3150
|
const enhancedParams = __spreadProps$1U(__spreadValues$33({}, rest), {
|
|
@@ -3154,9 +3154,9 @@ const initiateCheckout$2 = (provider, params) => {
|
|
|
3154
3154
|
const transformedParams = eventParamsToSnakeCase(enhancedParams);
|
|
3155
3155
|
const { meta } = getState();
|
|
3156
3156
|
const transformedMeta = eventParamsToSnakeCase(meta);
|
|
3157
|
-
const { total, totalPoints } =
|
|
3157
|
+
const { total, totalPoints } = shoppingCartCore.getShoppingCartTotal(shoppingCart);
|
|
3158
3158
|
analytics__default$1["default"]().logEvent("begin_checkout", __spreadValues$33(__spreadValues$33({
|
|
3159
|
-
items: mapProductsToGoogleItems(shoppingCart
|
|
3159
|
+
items: mapProductsToGoogleItems(shoppingCart, selectedCurrency),
|
|
3160
3160
|
value: total,
|
|
3161
3161
|
points: totalPoints != null ? totalPoints : 0
|
|
3162
3162
|
}, transformedParams), transformedMeta));
|
|
@@ -3195,7 +3195,7 @@ var __objRest$31 = (source, exclude) => {
|
|
|
3195
3195
|
};
|
|
3196
3196
|
const initiateCheckout$1 = (provider, params) => {
|
|
3197
3197
|
const { currency: providerCurrency } = provider;
|
|
3198
|
-
const _a = params, { shoppingCart
|
|
3198
|
+
const _a = params, { shoppingCart, currency } = _a, rest = __objRest$31(_a, ["shoppingCart", "currency"]);
|
|
3199
3199
|
delete rest.userId;
|
|
3200
3200
|
const selectedCurrency = currency != null ? currency : providerCurrency;
|
|
3201
3201
|
const enhancedParams = __spreadProps$1T(__spreadValues$32({}, rest), {
|
|
@@ -3204,8 +3204,8 @@ const initiateCheckout$1 = (provider, params) => {
|
|
|
3204
3204
|
const transformedParams = eventParamsToSnakeCase(enhancedParams);
|
|
3205
3205
|
const { meta } = getState();
|
|
3206
3206
|
const transformedMeta = eventParamsToSnakeCase(meta);
|
|
3207
|
-
const products =
|
|
3208
|
-
const { total, totalTaxes, shippingCost, totalPoints } =
|
|
3207
|
+
const products = shoppingCartCore.getShoppingCartProducts(shoppingCart);
|
|
3208
|
+
const { total, totalTaxes, shippingCost, totalPoints } = shoppingCartCore.getShoppingCartTotal(shoppingCart);
|
|
3209
3209
|
analytics__default["default"].track("Initiate Checkout", __spreadValues$32(__spreadValues$32({
|
|
3210
3210
|
total,
|
|
3211
3211
|
revenue: total - (totalTaxes != null ? totalTaxes : 0) - (shippingCost != null ? shippingCost : 0),
|
|
@@ -3246,16 +3246,16 @@ var __objRest$30 = (source, exclude) => {
|
|
|
3246
3246
|
};
|
|
3247
3247
|
const initiateCheckout = (provider, params) => {
|
|
3248
3248
|
const { currency: providerCurrency } = provider;
|
|
3249
|
-
const _a = params, { shoppingCart
|
|
3249
|
+
const _a = params, { shoppingCart, currency, contentType } = _a, rest = __objRest$30(_a, ["shoppingCart", "currency", "contentType"]);
|
|
3250
3250
|
delete rest.userId;
|
|
3251
3251
|
const selectedCurrency = currency != null ? currency : providerCurrency;
|
|
3252
3252
|
const enhancedParams = __spreadValues$31({}, rest);
|
|
3253
3253
|
const transformedParams = eventParamsToSnakeCase(enhancedParams);
|
|
3254
3254
|
const { meta } = getState();
|
|
3255
3255
|
const transformedMeta = eventParamsToSnakeCase(meta);
|
|
3256
|
-
const productsIds = getProductIdsFromShoppingCart(shoppingCart
|
|
3257
|
-
const productContents = getProductContentFromShoppingCart(shoppingCart
|
|
3258
|
-
const { total, totalPoints } =
|
|
3256
|
+
const productsIds = getProductIdsFromShoppingCart(shoppingCart);
|
|
3257
|
+
const productContents = getProductContentFromShoppingCart(shoppingCart);
|
|
3258
|
+
const { total, totalPoints } = shoppingCartCore.getShoppingCartTotal(shoppingCart);
|
|
3259
3259
|
reactNativeFbsdkNext.AppEventsLogger.logEvent("fb_mobile_initiated_checkout", total, __spreadValues$31(__spreadValues$31({
|
|
3260
3260
|
fb_content_id: transformArrayParam(productsIds),
|
|
3261
3261
|
fb_contents: transformArrayParam(productContents),
|
|
@@ -8810,7 +8810,7 @@ var __objRest$17 = (source, exclude) => {
|
|
|
8810
8810
|
const purchaseAttempt$2 = (provider, params) => {
|
|
8811
8811
|
const { userId: providerUserId } = provider;
|
|
8812
8812
|
const { currency: providerCurrency } = provider;
|
|
8813
|
-
const _a = params, { userId, currency, shoppingCart
|
|
8813
|
+
const _a = params, { userId, currency, shoppingCart } = _a, rest = __objRest$17(_a, ["userId", "currency", "shoppingCart"]);
|
|
8814
8814
|
const selectedUserId = userId != null ? userId : providerUserId;
|
|
8815
8815
|
const selectedCurrency = currency != null ? currency : providerCurrency;
|
|
8816
8816
|
const enhancedParams = __spreadProps$M(__spreadValues$18({}, rest), {
|
|
@@ -8820,8 +8820,8 @@ const purchaseAttempt$2 = (provider, params) => {
|
|
|
8820
8820
|
const transformedParams = eventParamsToSnakeCase(enhancedParams);
|
|
8821
8821
|
const { meta } = getState();
|
|
8822
8822
|
const transformedMeta = eventParamsToSnakeCase(meta);
|
|
8823
|
-
const productContents = getProductContentFromShoppingCart(shoppingCart
|
|
8824
|
-
const { total, totalPoints } =
|
|
8823
|
+
const productContents = getProductContentFromShoppingCart(shoppingCart);
|
|
8824
|
+
const { total, totalPoints } = shoppingCartCore.getShoppingCartTotal(shoppingCart);
|
|
8825
8825
|
analytics__default$1["default"]().logEvent("purchase_attempt", __spreadValues$18(__spreadValues$18({
|
|
8826
8826
|
products: transformArrayParam(productContents),
|
|
8827
8827
|
value: total,
|
|
@@ -8862,7 +8862,7 @@ var __objRest$16 = (source, exclude) => {
|
|
|
8862
8862
|
};
|
|
8863
8863
|
const purchaseAttempt$1 = (provider, params) => {
|
|
8864
8864
|
const { currency: providerCurrency } = provider;
|
|
8865
|
-
const _a = params, { currency, shoppingCart
|
|
8865
|
+
const _a = params, { currency, shoppingCart } = _a, rest = __objRest$16(_a, ["currency", "shoppingCart"]);
|
|
8866
8866
|
delete rest.userId;
|
|
8867
8867
|
const selectedCurrency = currency != null ? currency : providerCurrency;
|
|
8868
8868
|
const enhancedParams = __spreadProps$L(__spreadValues$17({}, rest), {
|
|
@@ -8871,8 +8871,8 @@ const purchaseAttempt$1 = (provider, params) => {
|
|
|
8871
8871
|
const transformedParams = eventParamsToSnakeCase(enhancedParams);
|
|
8872
8872
|
const { meta } = getState();
|
|
8873
8873
|
const transformedMeta = eventParamsToSnakeCase(meta);
|
|
8874
|
-
const products =
|
|
8875
|
-
const { total, totalTaxes, shippingCost, totalPoints } =
|
|
8874
|
+
const products = shoppingCartCore.getShoppingCartProducts(shoppingCart);
|
|
8875
|
+
const { total, totalTaxes, shippingCost, totalPoints } = shoppingCartCore.getShoppingCartTotal(shoppingCart);
|
|
8876
8876
|
analytics__default["default"].track("Purchase Attempt", __spreadValues$17(__spreadValues$17({
|
|
8877
8877
|
total,
|
|
8878
8878
|
revenue: total - (totalTaxes != null ? totalTaxes : 0) - (shippingCost != null ? shippingCost : 0),
|
|
@@ -8913,16 +8913,16 @@ var __objRest$15 = (source, exclude) => {
|
|
|
8913
8913
|
};
|
|
8914
8914
|
const purchaseAttempt = (provider, params) => {
|
|
8915
8915
|
const { currency: providerCurrency } = provider;
|
|
8916
|
-
const _a = params, { currency, shoppingCart
|
|
8916
|
+
const _a = params, { currency, shoppingCart, contentType } = _a, rest = __objRest$15(_a, ["currency", "shoppingCart", "contentType"]);
|
|
8917
8917
|
delete rest.userId;
|
|
8918
8918
|
const selectedCurrency = currency != null ? currency : providerCurrency;
|
|
8919
8919
|
const enhancedParams = __spreadValues$16({}, rest);
|
|
8920
8920
|
const transformedParams = eventParamsToSnakeCase(enhancedParams);
|
|
8921
8921
|
const { meta } = getState();
|
|
8922
8922
|
const transformedMeta = eventParamsToSnakeCase(meta);
|
|
8923
|
-
const productsIds = getProductIdsFromShoppingCart(shoppingCart
|
|
8924
|
-
const productContents = getProductContentFromShoppingCart(shoppingCart
|
|
8925
|
-
const { total, totalPoints } =
|
|
8923
|
+
const productsIds = getProductIdsFromShoppingCart(shoppingCart);
|
|
8924
|
+
const productContents = getProductContentFromShoppingCart(shoppingCart);
|
|
8925
|
+
const { total, totalPoints } = shoppingCartCore.getShoppingCartTotal(shoppingCart);
|
|
8926
8926
|
reactNativeFbsdkNext.AppEventsLogger.logEvent("PurchaseAttempt", total, __spreadValues$16(__spreadValues$16({
|
|
8927
8927
|
fb_content_id: transformArrayParam(productsIds),
|
|
8928
8928
|
fb_contents: transformArrayParam(productContents),
|
|
@@ -8975,7 +8975,7 @@ var __objRest$14 = (source, exclude) => {
|
|
|
8975
8975
|
const purchaseFail$2 = (provider, params) => {
|
|
8976
8976
|
const { userId: providerUserId } = provider;
|
|
8977
8977
|
const { currency: providerCurrency } = provider;
|
|
8978
|
-
const _a = params, { userId, currency, shoppingCart
|
|
8978
|
+
const _a = params, { userId, currency, shoppingCart } = _a, rest = __objRest$14(_a, ["userId", "currency", "shoppingCart"]);
|
|
8979
8979
|
const selectedUserId = userId != null ? userId : providerUserId;
|
|
8980
8980
|
const selectedCurrency = currency != null ? currency : providerCurrency;
|
|
8981
8981
|
const enhancedParams = __spreadProps$K(__spreadValues$15({}, rest), {
|
|
@@ -8985,8 +8985,8 @@ const purchaseFail$2 = (provider, params) => {
|
|
|
8985
8985
|
const transformedParams = eventParamsToSnakeCase(enhancedParams);
|
|
8986
8986
|
const { meta } = getState();
|
|
8987
8987
|
const transformedMeta = eventParamsToSnakeCase(meta);
|
|
8988
|
-
const productContents = getProductContentFromShoppingCart(shoppingCart
|
|
8989
|
-
const { total, totalPoints } =
|
|
8988
|
+
const productContents = getProductContentFromShoppingCart(shoppingCart);
|
|
8989
|
+
const { total, totalPoints } = shoppingCartCore.getShoppingCartTotal(shoppingCart);
|
|
8990
8990
|
analytics__default$1["default"]().logEvent("purchase_fail", __spreadValues$15(__spreadValues$15({
|
|
8991
8991
|
products: transformArrayParam(productContents),
|
|
8992
8992
|
value: total,
|
|
@@ -9027,7 +9027,7 @@ var __objRest$13 = (source, exclude) => {
|
|
|
9027
9027
|
};
|
|
9028
9028
|
const purchaseFail$1 = (provider, params) => {
|
|
9029
9029
|
const { currency: providerCurrency } = provider;
|
|
9030
|
-
const _a = params, { currency, shoppingCart
|
|
9030
|
+
const _a = params, { currency, shoppingCart } = _a, rest = __objRest$13(_a, ["currency", "shoppingCart"]);
|
|
9031
9031
|
delete rest.userId;
|
|
9032
9032
|
const selectedCurrency = currency != null ? currency : providerCurrency;
|
|
9033
9033
|
const enhancedParams = __spreadProps$J(__spreadValues$14({}, rest), {
|
|
@@ -9036,8 +9036,8 @@ const purchaseFail$1 = (provider, params) => {
|
|
|
9036
9036
|
const transformedParams = eventParamsToSnakeCase(enhancedParams);
|
|
9037
9037
|
const { meta } = getState();
|
|
9038
9038
|
const transformedMeta = eventParamsToSnakeCase(meta);
|
|
9039
|
-
const products =
|
|
9040
|
-
const { total, totalTaxes, shippingCost, totalPoints } =
|
|
9039
|
+
const products = shoppingCartCore.getShoppingCartProducts(shoppingCart);
|
|
9040
|
+
const { total, totalTaxes, shippingCost, totalPoints } = shoppingCartCore.getShoppingCartTotal(shoppingCart);
|
|
9041
9041
|
analytics__default["default"].track("Purchase Fail", __spreadValues$14(__spreadValues$14({
|
|
9042
9042
|
total,
|
|
9043
9043
|
revenue: total - (totalTaxes != null ? totalTaxes : 0) - (shippingCost != null ? shippingCost : 0),
|
|
@@ -9078,16 +9078,16 @@ var __objRest$12 = (source, exclude) => {
|
|
|
9078
9078
|
};
|
|
9079
9079
|
const purchaseFail = (provider, params) => {
|
|
9080
9080
|
const { currency: providerCurrency } = provider;
|
|
9081
|
-
const _a = params, { currency, shoppingCart
|
|
9081
|
+
const _a = params, { currency, shoppingCart, contentType } = _a, rest = __objRest$12(_a, ["currency", "shoppingCart", "contentType"]);
|
|
9082
9082
|
delete rest.userId;
|
|
9083
9083
|
const selectedCurrency = currency != null ? currency : providerCurrency;
|
|
9084
9084
|
const enhancedParams = __spreadValues$13({}, rest);
|
|
9085
9085
|
const transformedParams = eventParamsToSnakeCase(enhancedParams);
|
|
9086
9086
|
const { meta } = getState();
|
|
9087
9087
|
const transformedMeta = eventParamsToSnakeCase(meta);
|
|
9088
|
-
const productsIds = getProductIdsFromShoppingCart(shoppingCart
|
|
9089
|
-
const productContents = getProductContentFromShoppingCart(shoppingCart
|
|
9090
|
-
const { total, totalPoints } =
|
|
9088
|
+
const productsIds = getProductIdsFromShoppingCart(shoppingCart);
|
|
9089
|
+
const productContents = getProductContentFromShoppingCart(shoppingCart);
|
|
9090
|
+
const { total, totalPoints } = shoppingCartCore.getShoppingCartTotal(shoppingCart);
|
|
9091
9091
|
reactNativeFbsdkNext.AppEventsLogger.logEvent("PurchaseFail", total, __spreadValues$13(__spreadValues$13({
|
|
9092
9092
|
fb_content_id: transformArrayParam(productsIds),
|
|
9093
9093
|
fb_contents: transformArrayParam(productContents),
|
|
@@ -9140,19 +9140,19 @@ var __objRest$11 = (source, exclude) => {
|
|
|
9140
9140
|
const purchaseSuccess$2 = (provider, params) => {
|
|
9141
9141
|
const { userId: providerUserId } = provider;
|
|
9142
9142
|
const { currency: providerCurrency } = provider;
|
|
9143
|
-
const _a = params, { userId, currency, shoppingCart
|
|
9143
|
+
const _a = params, { userId, currency, shoppingCart, orderId } = _a, rest = __objRest$11(_a, ["userId", "currency", "shoppingCart", "orderId"]);
|
|
9144
9144
|
const selectedUserId = userId != null ? userId : providerUserId;
|
|
9145
9145
|
const selectedCurrency = currency != null ? currency : providerCurrency;
|
|
9146
9146
|
const enhancedParams = __spreadProps$I(__spreadValues$12({}, rest), {
|
|
9147
9147
|
userId: selectedUserId,
|
|
9148
9148
|
currency: selectedCurrency
|
|
9149
9149
|
});
|
|
9150
|
-
const { total, shippingCost, totalTaxes, totalPoints } =
|
|
9150
|
+
const { total, shippingCost, totalTaxes, totalPoints } = shoppingCartCore.getShoppingCartTotal(shoppingCart);
|
|
9151
9151
|
const transformedParams = eventParamsToSnakeCase(enhancedParams);
|
|
9152
9152
|
const { meta } = getState();
|
|
9153
9153
|
const transformedMeta = eventParamsToSnakeCase(meta);
|
|
9154
9154
|
analytics__default$1["default"]().logEvent("purchase", __spreadValues$12(__spreadValues$12({
|
|
9155
|
-
items: mapProductsToGoogleItems(shoppingCart
|
|
9155
|
+
items: mapProductsToGoogleItems(shoppingCart, selectedCurrency),
|
|
9156
9156
|
value: total,
|
|
9157
9157
|
points: totalPoints != null ? totalPoints : 0,
|
|
9158
9158
|
transaction_id: orderId,
|
|
@@ -9194,7 +9194,7 @@ var __objRest$10 = (source, exclude) => {
|
|
|
9194
9194
|
};
|
|
9195
9195
|
const purchaseSuccess$1 = (provider, params) => {
|
|
9196
9196
|
const { currency: providerCurrency } = provider;
|
|
9197
|
-
const _a = params, { currency, shoppingCart
|
|
9197
|
+
const _a = params, { currency, shoppingCart } = _a, rest = __objRest$10(_a, ["currency", "shoppingCart"]);
|
|
9198
9198
|
delete rest.userId;
|
|
9199
9199
|
const selectedCurrency = currency != null ? currency : providerCurrency;
|
|
9200
9200
|
const enhancedParams = __spreadProps$H(__spreadValues$11({}, rest), {
|
|
@@ -9203,8 +9203,8 @@ const purchaseSuccess$1 = (provider, params) => {
|
|
|
9203
9203
|
const transformedParams = eventParamsToSnakeCase(enhancedParams);
|
|
9204
9204
|
const { meta } = getState();
|
|
9205
9205
|
const transformedMeta = eventParamsToSnakeCase(meta);
|
|
9206
|
-
const products =
|
|
9207
|
-
const { total, totalTaxes, shippingCost, totalPoints } =
|
|
9206
|
+
const products = shoppingCartCore.getShoppingCartProducts(shoppingCart);
|
|
9207
|
+
const { total, totalTaxes, shippingCost, totalPoints } = shoppingCartCore.getShoppingCartTotal(shoppingCart);
|
|
9208
9208
|
analytics__default["default"].track("Order Completed", __spreadValues$11(__spreadValues$11({
|
|
9209
9209
|
total,
|
|
9210
9210
|
revenue: total - (totalTaxes != null ? totalTaxes : 0) - (shippingCost != null ? shippingCost : 0),
|
|
@@ -9245,16 +9245,16 @@ var __objRest$$ = (source, exclude) => {
|
|
|
9245
9245
|
};
|
|
9246
9246
|
const purchaseSuccess = (provider, params) => {
|
|
9247
9247
|
const { currency: providerCurrency } = provider;
|
|
9248
|
-
const _a = params, { currency, shoppingCart
|
|
9248
|
+
const _a = params, { currency, shoppingCart, orderId, contentType } = _a, rest = __objRest$$(_a, ["currency", "shoppingCart", "orderId", "contentType"]);
|
|
9249
9249
|
delete rest.userId;
|
|
9250
9250
|
const selectedCurrency = currency != null ? currency : providerCurrency;
|
|
9251
9251
|
const enhancedParams = __spreadValues$10({}, rest);
|
|
9252
9252
|
const transformedParams = eventParamsToSnakeCase(enhancedParams);
|
|
9253
9253
|
const { meta } = getState();
|
|
9254
9254
|
const transformedMeta = eventParamsToSnakeCase(meta);
|
|
9255
|
-
const productsIds = getProductIdsFromShoppingCart(shoppingCart
|
|
9256
|
-
const productContents = getProductContentFromShoppingCart(shoppingCart
|
|
9257
|
-
const { total, totalPoints } =
|
|
9255
|
+
const productsIds = getProductIdsFromShoppingCart(shoppingCart);
|
|
9256
|
+
const productContents = getProductContentFromShoppingCart(shoppingCart);
|
|
9257
|
+
const { total, totalPoints } = shoppingCartCore.getShoppingCartTotal(shoppingCart);
|
|
9258
9258
|
reactNativeFbsdkNext.AppEventsLogger.logPurchase(total, selectedCurrency, __spreadValues$10(__spreadValues$10({
|
|
9259
9259
|
fb_content_id: orderId,
|
|
9260
9260
|
fb_contents_id: transformArrayParam(productsIds),
|