@segment/action-destinations 3.74.4-alpha.8 → 3.76.0
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/destinations/google-analytics-4/addPaymentInfo/index.js +5 -5
- package/dist/destinations/google-analytics-4/addPaymentInfo/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/addToCart/index.js +6 -3
- package/dist/destinations/google-analytics-4/addToCart/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/addToWishlist/index.js +5 -5
- package/dist/destinations/google-analytics-4/addToWishlist/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/beginCheckout/index.js +5 -5
- package/dist/destinations/google-analytics-4/beginCheckout/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/ga4-functions.d.ts +1 -0
- package/dist/destinations/google-analytics-4/ga4-functions.js +12 -0
- package/dist/destinations/google-analytics-4/ga4-functions.js.map +1 -0
- package/dist/destinations/google-analytics-4/generateLead/index.js +3 -3
- package/dist/destinations/google-analytics-4/generateLead/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/purchase/index.js +4 -6
- package/dist/destinations/google-analytics-4/purchase/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/refund/index.js +5 -5
- package/dist/destinations/google-analytics-4/refund/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/removeFromCart/index.js +5 -5
- package/dist/destinations/google-analytics-4/removeFromCart/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/selectItem/index.js +3 -3
- package/dist/destinations/google-analytics-4/selectItem/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/selectPromotion/index.js +3 -3
- package/dist/destinations/google-analytics-4/selectPromotion/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/viewCart/index.js +5 -5
- package/dist/destinations/google-analytics-4/viewCart/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/viewItem/index.js +5 -5
- package/dist/destinations/google-analytics-4/viewItem/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/viewItemList/index.js +3 -3
- package/dist/destinations/google-analytics-4/viewItemList/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/viewPromotion/index.js +3 -3
- package/dist/destinations/google-analytics-4/viewPromotion/index.js.map +1 -1
- package/dist/destinations/google-sheets/constants.d.ts +3 -0
- package/dist/destinations/google-sheets/constants.js +7 -0
- package/dist/destinations/google-sheets/constants.js.map +1 -0
- package/dist/destinations/google-sheets/generated-types.d.ts +2 -0
- package/dist/destinations/google-sheets/generated-types.js +3 -0
- package/dist/destinations/google-sheets/generated-types.js.map +1 -0
- package/dist/destinations/google-sheets/googleapis/index.d.ts +17 -0
- package/dist/destinations/google-sheets/googleapis/index.js +34 -0
- package/dist/destinations/google-sheets/googleapis/index.js.map +1 -0
- package/dist/destinations/google-sheets/index.d.ts +4 -0
- package/dist/destinations/google-sheets/index.js +39 -0
- package/dist/destinations/google-sheets/index.js.map +1 -0
- package/dist/destinations/google-sheets/postSheet/generated-types.d.ts +10 -0
- package/dist/destinations/google-sheets/postSheet/generated-types.js +3 -0
- package/dist/destinations/google-sheets/postSheet/generated-types.js.map +1 -0
- package/dist/destinations/google-sheets/postSheet/index.d.ts +5 -0
- package/dist/destinations/google-sheets/postSheet/index.js +71 -0
- package/dist/destinations/google-sheets/postSheet/index.js.map +1 -0
- package/dist/destinations/google-sheets/postSheet/operations.d.ts +10 -0
- package/dist/destinations/google-sheets/postSheet/operations.js +96 -0
- package/dist/destinations/google-sheets/postSheet/operations.js.map +1 -0
- package/dist/destinations/index.js +1 -0
- package/dist/destinations/index.js.map +1 -1
- package/dist/destinations/salesforce/account/generated-types.d.ts +1 -0
- package/dist/destinations/salesforce/account/index.js +2 -5
- package/dist/destinations/salesforce/account/index.js.map +1 -1
- package/dist/destinations/salesforce/cases/generated-types.d.ts +1 -0
- package/dist/destinations/salesforce/cases/index.js +2 -8
- package/dist/destinations/salesforce/cases/index.js.map +1 -1
- package/dist/destinations/salesforce/contact/generated-types.d.ts +1 -0
- package/dist/destinations/salesforce/contact/index.js +2 -5
- package/dist/destinations/salesforce/contact/index.js.map +1 -1
- package/dist/destinations/salesforce/customObject/generated-types.d.ts +1 -0
- package/dist/destinations/salesforce/customObject/index.js +2 -8
- package/dist/destinations/salesforce/customObject/index.js.map +1 -1
- package/dist/destinations/salesforce/index.js +2 -1
- package/dist/destinations/salesforce/index.js.map +1 -1
- package/dist/destinations/salesforce/lead/generated-types.d.ts +1 -0
- package/dist/destinations/salesforce/lead/index.js +2 -5
- package/dist/destinations/salesforce/lead/index.js.map +1 -1
- package/dist/destinations/salesforce/opportunity/generated-types.d.ts +1 -0
- package/dist/destinations/salesforce/opportunity/index.js +2 -5
- package/dist/destinations/salesforce/opportunity/index.js.map +1 -1
- package/dist/destinations/salesforce/sf-operations.d.ts +3 -1
- package/dist/destinations/salesforce/sf-operations.js +27 -3
- package/dist/destinations/salesforce/sf-operations.js.map +1 -1
- package/dist/destinations/salesforce/sf-properties.js +2 -1
- package/dist/destinations/salesforce/sf-properties.js.map +1 -1
- package/dist/destinations/salesforce/sf-utils.d.ts +1 -1
- package/dist/destinations/salesforce/sf-utils.js +22 -5
- package/dist/destinations/salesforce/sf-utils.js.map +1 -1
- package/dist/destinations/snap-conversions-api/index.js +147 -0
- package/dist/destinations/snap-conversions-api/index.js.map +1 -1
- package/package.json +10 -5
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const actions_core_1 = require("@segment/actions-core");
|
|
4
|
-
const
|
|
4
|
+
const ga4_functions_1 = require("../ga4-functions");
|
|
5
5
|
const ga4_properties_1 = require("../ga4-properties");
|
|
6
6
|
const action = {
|
|
7
7
|
title: 'Add Payment Info',
|
|
@@ -26,8 +26,8 @@ const action = {
|
|
|
26
26
|
if (payload.items && !payload.items.length) {
|
|
27
27
|
throw new actions_core_1.IntegrationError('Google requires one or more products in add_payment_info events.', 'Misconfigured required field', 400);
|
|
28
28
|
}
|
|
29
|
-
if (payload.currency
|
|
30
|
-
|
|
29
|
+
if (payload.currency) {
|
|
30
|
+
ga4_functions_1.verifyCurrency(payload.currency);
|
|
31
31
|
}
|
|
32
32
|
if (payload.value && payload.currency === undefined) {
|
|
33
33
|
throw new actions_core_1.IntegrationError('Currency is required if value is set.', 'Misconfigured required field', 400);
|
|
@@ -41,8 +41,8 @@ const action = {
|
|
|
41
41
|
if (product.item_name === undefined && product.item_id === undefined) {
|
|
42
42
|
throw new actions_core_1.IntegrationError('One of product name or product id is required for product or impression data.', 'Misconfigured required field', 400);
|
|
43
43
|
}
|
|
44
|
-
if (product.currency
|
|
45
|
-
|
|
44
|
+
if (product.currency) {
|
|
45
|
+
ga4_functions_1.verifyCurrency(product.currency);
|
|
46
46
|
}
|
|
47
47
|
return product;
|
|
48
48
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/addPaymentInfo/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/addPaymentInfo/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAI1E,oDAAiD;AACjD,sDAY0B;AAE1B,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,kBAAkB;IACzB,WAAW,EAAE,0DAA0D;IACvE,mBAAmB,EAAE,mDAAmD;IACxE,MAAM,EAAE;QACN,SAAS,EAAE,EAAE,GAAG,0BAAS,EAAE;QAC3B,OAAO,EAAE,EAAE,GAAG,wBAAO,EAAE;QACvB,QAAQ,EAAE,EAAE,GAAG,yBAAQ,EAAE;QACzB,KAAK,EAAE,EAAE,GAAG,sBAAK,EAAE;QACnB,MAAM,EAAE,EAAE,GAAG,uBAAM,EAAE;QACrB,YAAY,EAAE,EAAE,GAAG,6BAAY,EAAE;QACjC,KAAK,EAAE;YACL,GAAG,qCAAoB;YACvB,QAAQ,EAAE,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AC/B,CAAC,CAAC,CAAA;SACH;QAED,OAAO,OAAO,CAAC,6CAA6C,EAAE;YAC5D,MAAM,EAAE,MAAM;YACd,IAAI,EAAE;gBACJ,SAAS,EAAE,OAAO,CAAC,SAAS;gBAC5B,OAAO,EAAE,OAAO,CAAC,OAAO;gBACxB,MAAM,EAAE;oBACN;wBACE,IAAI,EAAE,kBAAkB;wBACxB,MAAM,EAAE;4BACN,QAAQ,EAAE,OAAO,CAAC,QAAQ;4BAC1B,KAAK,EAAE,OAAO,CAAC,KAAK;4BACpB,MAAM,EAAE,OAAO,CAAC,MAAM;4BACtB,YAAY,EAAE,OAAO,CAAC,YAAY;4BAClC,KAAK,EAAE,WAAW;4BAClB,oBAAoB,EAAE,OAAO,CAAC,oBAAoB;4BAClD,GAAG,OAAO,CAAC,MAAM;yBAClB;qBACF;iBACF;gBACD,GAAG,qCAAoB,CAAC,OAAO,CAAC,eAAe,CAAC;aACjD;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const actions_core_1 = require("@segment/actions-core");
|
|
4
|
-
const
|
|
4
|
+
const ga4_functions_1 = require("../ga4-functions");
|
|
5
5
|
const ga4_properties_1 = require("../ga4-properties");
|
|
6
6
|
const action = {
|
|
7
7
|
title: 'Add to Cart',
|
|
@@ -22,13 +22,16 @@ const action = {
|
|
|
22
22
|
},
|
|
23
23
|
perform: (request, { payload }) => {
|
|
24
24
|
let googleItems = [];
|
|
25
|
+
if (payload.currency) {
|
|
26
|
+
ga4_functions_1.verifyCurrency(payload.currency);
|
|
27
|
+
}
|
|
25
28
|
if (payload.items) {
|
|
26
29
|
googleItems = payload.items.map((product) => {
|
|
27
30
|
if (product.item_name === undefined && product.item_id === undefined) {
|
|
28
31
|
throw new actions_core_1.IntegrationError('One of product name or product id is required for product or impression data.', 'Misconfigured required field', 400);
|
|
29
32
|
}
|
|
30
|
-
if (product.currency
|
|
31
|
-
|
|
33
|
+
if (product.currency) {
|
|
34
|
+
ga4_functions_1.verifyCurrency(product.currency);
|
|
32
35
|
}
|
|
33
36
|
return product;
|
|
34
37
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/addToCart/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAI1E,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/addToCart/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAI1E,oDAAiD;AACjD,sDAU0B;AAE1B,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,aAAa;IACpB,WAAW,EAAE,6CAA6C;IAC1D,mBAAmB,EAAE,4CAA4C;IACjE,MAAM,EAAE;QACN,SAAS,EAAE,EAAE,GAAG,0BAAS,EAAE;QAC3B,OAAO,EAAE,EAAE,GAAG,wBAAO,EAAE;QACvB,QAAQ,EAAE,EAAE,GAAG,yBAAQ,EAAE;QACzB,KAAK,EAAE;YACL,GAAG,sCAAqB;YACxB,QAAQ,EAAE,IAAI;SACf;QACD,KAAK,EAAE,EAAE,GAAG,sBAAK,EAAE;QACnB,eAAe,EAAE,gCAAe;QAChC,oBAAoB,EAAE,qCAAoB;QAC1C,MAAM,EAAE,uBAAM;KACf;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;QAChC,IAAI,WAAW,GAAkB,EAAE,CAAA;QAEnC,IAAI,OAAO,CAAC,QAAQ,EAAE;YACpB,8BAAc,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAA;SACjC;QAED,IAAI,OAAO,CAAC,KAAK,EAAE;YACjB,WAAW,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE;gBAC1C,IAAI,OAAO,CAAC,SAAS,KAAK,SAAS,IAAI,OAAO,CAAC,OAAO,KAAK,SAAS,EAAE;oBACpE,MAAM,IAAI,+BAAgB,CACxB,+EAA+E,EAC/E,8BAA8B,EAC9B,GAAG,CACJ,CAAA;iBACF;gBAED,IAAI,OAAO,CAAC,QAAQ,EAAE;oBACpB,8BAAc,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAA;iBACjC;gBAED,OAAO,OAAsB,CAAA;YAC/B,CAAC,CAAC,CAAA;SACH;QAED,OAAO,OAAO,CAAC,6CAA6C,EAAE;YAC5D,MAAM,EAAE,MAAM;YACd,IAAI,EAAE;gBACJ,SAAS,EAAE,OAAO,CAAC,SAAS;gBAC5B,OAAO,EAAE,OAAO,CAAC,OAAO;gBACxB,MAAM,EAAE;oBACN;wBACE,IAAI,EAAE,aAAa;wBACnB,MAAM,EAAE;4BACN,QAAQ,EAAE,OAAO,CAAC,QAAQ;4BAC1B,KAAK,EAAE,WAAW;4BAClB,KAAK,EAAE,OAAO,CAAC,KAAK;4BACpB,oBAAoB,EAAE,OAAO,CAAC,oBAAoB;4BAClD,GAAG,OAAO,CAAC,MAAM;yBAClB;qBACF;iBACF;gBACD,GAAG,qCAAoB,CAAC,OAAO,CAAC,eAAe,CAAC;aACjD;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const actions_core_1 = require("@segment/actions-core");
|
|
4
|
-
const
|
|
4
|
+
const ga4_functions_1 = require("../ga4-functions");
|
|
5
5
|
const ga4_properties_1 = require("../ga4-properties");
|
|
6
6
|
const action = {
|
|
7
7
|
title: 'Add to Wishlist',
|
|
@@ -21,8 +21,8 @@ const action = {
|
|
|
21
21
|
params: ga4_properties_1.params
|
|
22
22
|
},
|
|
23
23
|
perform: (request, { payload }) => {
|
|
24
|
-
if (payload.currency
|
|
25
|
-
|
|
24
|
+
if (payload.currency) {
|
|
25
|
+
ga4_functions_1.verifyCurrency(payload.currency);
|
|
26
26
|
}
|
|
27
27
|
if (payload.value && payload.currency === undefined) {
|
|
28
28
|
throw new actions_core_1.IntegrationError('Currency is required if value is set.', 'Misconfigured required field', 400);
|
|
@@ -36,8 +36,8 @@ const action = {
|
|
|
36
36
|
if (product.item_name === undefined && product.item_id === undefined) {
|
|
37
37
|
throw new actions_core_1.IntegrationError('One of product name or product id is required for product or impression data.', 'Misconfigured required field', 400);
|
|
38
38
|
}
|
|
39
|
-
if (product.currency
|
|
40
|
-
|
|
39
|
+
if (product.currency) {
|
|
40
|
+
ga4_functions_1.verifyCurrency(product.currency);
|
|
41
41
|
}
|
|
42
42
|
return product;
|
|
43
43
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/addToWishlist/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/addToWishlist/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAI1E,oDAAiD;AACjD,sDAU0B;AAE1B,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,iBAAiB;IACxB,WAAW,EAAE,iDAAiD;IAC9D,mBAAmB,EAAE,wDAAwD;IAC7E,MAAM,EAAE;QACN,SAAS,EAAE,EAAE,GAAG,0BAAS,EAAE;QAC3B,OAAO,EAAE,EAAE,GAAG,wBAAO,EAAE;QACvB,QAAQ,EAAE,EAAE,GAAG,yBAAQ,EAAE;QACzB,KAAK,EAAE,EAAE,GAAG,sBAAK,EAAE;QACnB,KAAK,EAAE;YACL,GAAG,sCAAqB;YACxB,QAAQ,EAAE,IAAI;SACf;QACD,eAAe,EAAE,gCAAe;QAChC,oBAAoB,EAAE,qCAAoB;QAC1C,MAAM,EAAE,uBAAM;KACf;IACD,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O;gBACxB,MAAM,EAAE;oBACN;wBACE,IAAI,EAAE,iBAAiB;wBACvB,MAAM,EAAE;4BACN,QAAQ,EAAE,OAAO,CAAC,QAAQ;4BAC1B,KAAK,EAAE,OAAO,CAAC,KAAK;4BACpB,KAAK,EAAE,WAAW;4BAClB,oBAAoB,EAAE,OAAO,CAAC,oBAAoB;4BAClD,GAAG,OAAO,CAAC,MAAM;yBAClB;qBACF;iBACF;gBACD,GAAG,qCAAoB,CAAC,OAAO,CAAC,eAAe,CAAC;aACjD;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const actions_core_1 = require("@segment/actions-core");
|
|
4
|
-
const
|
|
4
|
+
const ga4_functions_1 = require("../ga4-functions");
|
|
5
5
|
const ga4_properties_1 = require("../ga4-properties");
|
|
6
6
|
const action = {
|
|
7
7
|
title: 'Begin Checkout',
|
|
@@ -22,8 +22,8 @@ const action = {
|
|
|
22
22
|
params: ga4_properties_1.params
|
|
23
23
|
},
|
|
24
24
|
perform: (request, { payload }) => {
|
|
25
|
-
if (payload.currency
|
|
26
|
-
|
|
25
|
+
if (payload.currency) {
|
|
26
|
+
ga4_functions_1.verifyCurrency(payload.currency);
|
|
27
27
|
}
|
|
28
28
|
let googleItems = [];
|
|
29
29
|
if (payload.items) {
|
|
@@ -31,8 +31,8 @@ const action = {
|
|
|
31
31
|
if (product.item_name === undefined && product.item_id === undefined) {
|
|
32
32
|
throw new actions_core_1.IntegrationError('One of product name or product id is required for product or impression data.', 'Misconfigured required field', 400);
|
|
33
33
|
}
|
|
34
|
-
if (product.currency
|
|
35
|
-
|
|
34
|
+
if (product.currency) {
|
|
35
|
+
ga4_functions_1.verifyCurrency(product.currency);
|
|
36
36
|
}
|
|
37
37
|
return product;
|
|
38
38
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/beginCheckout/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAC1E,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/beginCheckout/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAC1E,oDAAiD;AACjD,sDAW0B;AAK1B,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,gBAAgB;IACvB,WAAW,EAAE,wCAAwC;IACrD,mBAAmB,EAAE,+CAA+C;IACpE,MAAM,EAAE;QACN,SAAS,EAAE,EAAE,GAAG,0BAAS,EAAE;QAC3B,OAAO,EAAE,EAAE,GAAG,wBAAO,EAAE;QACvB,MAAM,EAAE,EAAE,GAAG,uBAAM,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,qBAAqB,EAAE,EAAE;QAClE,QAAQ,EAAE,EAAE,GAAG,yBAAQ,EAAE;QAGzB,KAAK,EAAE;YACL,GAAG,qCAAoB;YACvB,QAAQ,EAAE,IAAI;SACf;QACD,KAAK,EAAE,EAAE,GAAG,sBAAK,EAAE;QACnB,eAAe,EAAE,gCAAe;QAChC,oBAAoB,EAAE,qCAAoB;QAC1C,MAAM,EAAE,uBAAM;KACf;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;QAChC,IAAI,OAAO,CAAC,QAAQ,EAAE;YACpB,8BAAc,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAA;SACjC;QAED,IAAI,WAAW,GAAkB,EAAE,CAAA;QAEnC,IAAI,OAAO,CAAC,KAAK,EAAE;YACjB,WAAW,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE;gBAC1C,IAAI,OAAO,CAAC,SAAS,KAAK,SAAS,IAAI,OAAO,CAAC,OAAO,KAAK,SAAS,EAAE;oBACpE,MAAM,IAAI,+BAAgB,CACxB,+EAA+E,EAC/E,8BAA8B,EAC9B,GAAG,CACJ,CAAA;iBACF;gBAED,IAAI,OAAO,CAAC,QAAQ,EAAE;oBACpB,8BAAc,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAA;iBACjC;gBAED,OAAO,OAAsB,CAAA;YAC/B,CAAC,CAAC,CAAA;SACH;QAED,OAAO,OAAO,CAAC,6CAA6C,EAAE;YAC5D,MAAM,EAAE,MAAM;YACd,IAAI,EAAE;gBACJ,SAAS,EAAE,OAAO,CAAC,SAAS;gBAC5B,OAAO,EAAE,OAAO,CAAC,OAAO;gBACxB,MAAM,EAAE;oBACN;wBACE,IAAI,EAAE,gBAAgB;wBACtB,MAAM,EAAE;4BACN,MAAM,EAAE,OAAO,CAAC,MAAM;4BACtB,QAAQ,EAAE,OAAO,CAAC,QAAQ;4BAC1B,KAAK,EAAE,WAAW;4BAClB,KAAK,EAAE,OAAO,CAAC,KAAK;4BACpB,oBAAoB,EAAE,OAAO,CAAC,oBAAoB;4BAClD,GAAG,OAAO,CAAC,MAAM;yBAClB;qBACF;iBACF;gBACD,GAAG,qCAAoB,CAAC,OAAO,CAAC,eAAe,CAAC;aACjD;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function verifyCurrency(currency: string): void;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.verifyCurrency = void 0;
|
|
4
|
+
const actions_core_1 = require("@segment/actions-core");
|
|
5
|
+
const constants_1 = require("./constants");
|
|
6
|
+
function verifyCurrency(currency) {
|
|
7
|
+
if (!constants_1.CURRENCY_ISO_CODES.includes(currency.toUpperCase())) {
|
|
8
|
+
throw new actions_core_1.IntegrationError(`${currency} is not a valid currency code.`, 'Incorrect value format', 400);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
exports.verifyCurrency = verifyCurrency;
|
|
12
|
+
//# sourceMappingURL=ga4-functions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ga4-functions.js","sourceRoot":"","sources":["../../../src/destinations/google-analytics-4/ga4-functions.ts"],"names":[],"mappings":";;;AAAA,wDAAwD;AACxD,2CAAgD;AAGhD,SAAgB,cAAc,CAAC,QAAgB;IAC7C,IAAI,CAAC,8BAAkB,CAAC,QAAQ,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC,EAAE;QACxD,MAAM,IAAI,+BAAgB,CAAC,GAAG,QAAQ,gCAAgC,EAAE,wBAAwB,EAAE,GAAG,CAAC,CAAA;KACvG;AACH,CAAC;AAJD,wCAIC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const actions_core_1 = require("@segment/actions-core");
|
|
4
|
-
const
|
|
4
|
+
const ga4_functions_1 = require("../ga4-functions");
|
|
5
5
|
const ga4_properties_1 = require("../ga4-properties");
|
|
6
6
|
const action = {
|
|
7
7
|
title: 'Generate Lead',
|
|
@@ -17,8 +17,8 @@ const action = {
|
|
|
17
17
|
params: ga4_properties_1.params
|
|
18
18
|
},
|
|
19
19
|
perform: (request, { payload }) => {
|
|
20
|
-
if (payload.currency
|
|
21
|
-
|
|
20
|
+
if (payload.currency) {
|
|
21
|
+
ga4_functions_1.verifyCurrency(payload.currency);
|
|
22
22
|
}
|
|
23
23
|
if (payload.value && payload.currency === undefined) {
|
|
24
24
|
throw new actions_core_1.IntegrationError('Currency is required if value is set.', 'Misconfigured required field', 400);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/generateLead/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAC1E,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/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AC;aACjD;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const actions_core_1 = require("@segment/actions-core");
|
|
4
|
-
const
|
|
4
|
+
const ga4_functions_1 = require("../ga4-functions");
|
|
5
5
|
const ga4_properties_1 = require("../ga4-properties");
|
|
6
6
|
const action = {
|
|
7
7
|
title: 'Purchase',
|
|
@@ -26,17 +26,15 @@ const action = {
|
|
|
26
26
|
params: ga4_properties_1.params
|
|
27
27
|
},
|
|
28
28
|
perform: (request, { payload }) => {
|
|
29
|
-
|
|
30
|
-
throw new Error(`${payload.currency} is not a valid currency code.`);
|
|
31
|
-
}
|
|
29
|
+
ga4_functions_1.verifyCurrency(payload.currency);
|
|
32
30
|
let googleItems = [];
|
|
33
31
|
if (payload.items) {
|
|
34
32
|
googleItems = payload.items.map((product) => {
|
|
35
33
|
if (product.item_name === undefined && product.item_id === undefined) {
|
|
36
34
|
throw new actions_core_1.IntegrationError('One of product name or product id is required for product or impression data.', 'Misconfigured required field', 400);
|
|
37
35
|
}
|
|
38
|
-
if (product.currency
|
|
39
|
-
|
|
36
|
+
if (product.currency) {
|
|
37
|
+
ga4_functions_1.verifyCurrency(product.currency);
|
|
40
38
|
}
|
|
41
39
|
return product;
|
|
42
40
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/purchase/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAG1E,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/purchase/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAG1E,oDAAiD;AAEjD,sDAe0B;AAI1B,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,UAAU;IACjB,WAAW,E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AAQ,EAAE;oBACpB,8BAAc,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAA;iBACjC;gBAED,OAAO,OAAsB,CAAA;YAC/B,CAAC,CAAC,CAAA;SACH;QAED,OAAO,OAAO,CAAC,6CAA6C,EAAE;YAC5D,MAAM,EAAE,MAAM;YACd,IAAI,EAAE;gBACJ,SAAS,EAAE,OAAO,CAAC,SAAS;gBAC5B,OAAO,EAAE,OAAO,CAAC,OAAO;gBACxB,MAAM,EAAE;oBACN;wBACE,IAAI,EAAE,UAAU;wBAChB,MAAM,EAAE;4BACN,WAAW,EAAE,OAAO,CAAC,WAAW;4BAChC,MAAM,EAAE,OAAO,CAAC,MAAM;4BACtB,QAAQ,EAAE,OAAO,CAAC,QAAQ;4BAC1B,KAAK,EAAE,WAAW;4BAClB,cAAc,EAAE,OAAO,CAAC,cAAc;4BACtC,QAAQ,EAAE,OAAO,CAAC,QAAQ;4BAC1B,KAAK,EAAE,OAAO,CAAC,KAAK;4BACpB,GAAG,EAAE,OAAO,CAAC,GAAG;4BAChB,oBAAoB,EAAE,OAAO,CAAC,oBAAoB;4BAClD,GAAG,OAAO,CAAC,MAAM;yBAClB;qBACF;iBACF;gBACD,GAAG,qCAAoB,CAAC,OAAO,CAAC,eAAe,CAAC;aACjD;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const actions_core_1 = require("@segment/actions-core");
|
|
4
|
-
const
|
|
4
|
+
const ga4_functions_1 = require("../ga4-functions");
|
|
5
5
|
const ga4_properties_1 = require("../ga4-properties");
|
|
6
6
|
const action = {
|
|
7
7
|
title: 'Refund',
|
|
@@ -29,8 +29,8 @@ const action = {
|
|
|
29
29
|
params: ga4_properties_1.params
|
|
30
30
|
},
|
|
31
31
|
perform: (request, { payload }) => {
|
|
32
|
-
if (payload.currency
|
|
33
|
-
|
|
32
|
+
if (payload.currency) {
|
|
33
|
+
ga4_functions_1.verifyCurrency(payload.currency);
|
|
34
34
|
}
|
|
35
35
|
if (payload.value && payload.currency === undefined) {
|
|
36
36
|
throw new actions_core_1.IntegrationError('Currency is required if value is set.', 'Misconfigured required field', 400);
|
|
@@ -44,8 +44,8 @@ const action = {
|
|
|
44
44
|
if (product.item_name === undefined && product.item_id === undefined) {
|
|
45
45
|
throw new actions_core_1.IntegrationError('One of product name or product id is required for product or impression data.', 'Misconfigured required field', 400);
|
|
46
46
|
}
|
|
47
|
-
if (product.currency
|
|
48
|
-
|
|
47
|
+
if (product.currency) {
|
|
48
|
+
ga4_functions_1.verifyCurrency(product.currency);
|
|
49
49
|
}
|
|
50
50
|
return product;
|
|
51
51
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/refund/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAC1E,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/refund/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAC1E,oDAAiD;AACjD,sDAc0B;AAK1B,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,QAAQ;IACf,WAAW,EAAE,oCAAoC;IACjD,mBAAmB,EAAE,6CAA6C;IAClE,MAAM,EAAE;QACN,SAAS,EAAE,EAAE,GAAG,0BAAS,EAAE;QAC3B,OAAO,EAAE,EAAE,GAAG,wBAAO,EAAE;QACvB,QAAQ,EAAE,EAAE,GAAG,yBAAQ,EAAE;QACzB,cAAc,EAAE,EAAE,GAAG,+BAAc,EAAE,QAAQ,EAAE,IAAI,EAAE;QACrD,KAAK,EAAE,EAAE,GAAG,sBAAK,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,oBAAoB,EAAE,EAAE;QAC/D,WAAW,EAAE,EAAE,GAAG,4BAAW,EAAE;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,CAAA;iBACF;gBAED,IAAI,OAAO,CAAC,QAAQ,EAAE;oBACpB,8BAAc,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAA;iBACjC;gBAED,OAAO,OAAsB,CAAA;YAC/B,CAAC,CAAC,CAAA;SACH;QAED,OAAO,OAAO,CAAC,6CAA6C,EAAE;YAC5D,MAAM,EAAE,MAAM;YACd,IAAI,EAAE;gBACJ,SAAS,EAAE,OAAO,CAAC,SAAS;gBAC5B,OAAO,EAAE,OAAO,CAAC,OAAO;gBACxB,MAAM,EAAE;oBACN;wBACE,IAAI,EAAE,QAAQ;wBACd,MAAM,EAAE;4BACN,QAAQ,EAAE,OAAO,CAAC,QAAQ;4BAC1B,cAAc,EAAE,OAAO,CAAC,cAAc;4BACtC,KAAK,EAAE,OAAO,CAAC,KAAK;4BACpB,WAAW,EAAE,OAAO,CAAC,WAAW;4BAChC,MAAM,EAAE,OAAO,CAAC,MAAM;4BACtB,QAAQ,EAAE,OAAO,CAAC,QAAQ;4BAC1B,GAAG,EAAE,OAAO,CAAC,GAAG;4BAChB,KAAK,EAAE,WAAW;4BAClB,oBAAoB,EAAE,OAAO,CAAC,oBAAoB;4BAClD,GAAG,OAAO,CAAC,MAAM;yBAClB;qBACF;iBACF;gBACD,GAAG,qCAAoB,CAAC,OAAO,CAAC,eAAe,CAAC;aACjD;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const actions_core_1 = require("@segment/actions-core");
|
|
4
|
-
const
|
|
4
|
+
const ga4_functions_1 = require("../ga4-functions");
|
|
5
5
|
const ga4_properties_1 = require("../ga4-properties");
|
|
6
6
|
const action = {
|
|
7
7
|
title: 'Remove from Cart',
|
|
@@ -21,8 +21,8 @@ const action = {
|
|
|
21
21
|
params: ga4_properties_1.params
|
|
22
22
|
},
|
|
23
23
|
perform: (request, { payload }) => {
|
|
24
|
-
if (payload.currency
|
|
25
|
-
|
|
24
|
+
if (payload.currency) {
|
|
25
|
+
ga4_functions_1.verifyCurrency(payload.currency);
|
|
26
26
|
}
|
|
27
27
|
if (payload.value && payload.currency === undefined) {
|
|
28
28
|
throw new actions_core_1.IntegrationError('Currency is required if value is set.', 'Misconfigured required field', 400);
|
|
@@ -36,8 +36,8 @@ const action = {
|
|
|
36
36
|
if (product.item_name === undefined && product.item_id === undefined) {
|
|
37
37
|
throw new actions_core_1.IntegrationError('One of product name or product id is required for product or impression data.', 'Misconfigured required field', 400);
|
|
38
38
|
}
|
|
39
|
-
if (product.currency
|
|
40
|
-
|
|
39
|
+
if (product.currency) {
|
|
40
|
+
ga4_functions_1.verifyCurrency(product.currency);
|
|
41
41
|
}
|
|
42
42
|
return product;
|
|
43
43
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/removeFromCart/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAC1E,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/removeFromCart/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAC1E,oDAAiD;AACjD,sDAU0B;AAK1B,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,kBAAkB;IACzB,WAAW,EAAE,kDAAkD;IAC/D,mBAAmB,EAAE,8CAA8C;IACnE,MAAM,EAAE;QACN,SAAS,EAAE,EAAE,GAAG,0BAAS,EAAE;QAC3B,OAAO,EAAE,EAAE,GAAG,wBAAO,EAAE;QACvB,QAAQ,EAAE,EAAE,GAAG,yBAAQ,EAAE;QACzB,KAAK,EAAE,EAAE,GAAG,sBAAK,EAAE;QACnB,KAAK,EAAE;YACL,GAAG,sCAAqB;YACxB,QAAQ,EAAE,IAAI;SACf;QACD,eAAe,EAAE,gCAAe;QAChC,oBAAoB,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O,CAAC,SAAS;gBAC5B,OAAO,EAAE,OAAO,CAAC,OAAO;gBACxB,MAAM,EAAE;oBACN;wBACE,IAAI,EAAE,kBAAkB;wBACxB,MAAM,EAAE;4BACN,QAAQ,EAAE,OAAO,CAAC,QAAQ;4BAC1B,KAAK,EAAE,OAAO,CAAC,KAAK;4BACpB,KAAK,EAAE,WAAW;4BAClB,oBAAoB,EAAE,OAAO,CAAC,oBAAoB;4BAClD,GAAG,OAAO,CAAC,MAAM;yBAClB;qBACF;iBACF;gBACD,GAAG,qCAAoB,CAAC,OAAO,CAAC,eAAe,CAAC;aACjD;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const actions_core_1 = require("@segment/actions-core");
|
|
4
|
-
const
|
|
4
|
+
const ga4_functions_1 = require("../ga4-functions");
|
|
5
5
|
const ga4_properties_1 = require("../ga4-properties");
|
|
6
6
|
const action = {
|
|
7
7
|
title: 'Select Item',
|
|
@@ -35,8 +35,8 @@ const action = {
|
|
|
35
35
|
if (product.item_name === undefined && product.item_id === undefined) {
|
|
36
36
|
throw new actions_core_1.IntegrationError('One of product name or product id is required for product or impression data.', 'Misconfigured required field', 400);
|
|
37
37
|
}
|
|
38
|
-
if (product.currency
|
|
39
|
-
|
|
38
|
+
if (product.currency) {
|
|
39
|
+
ga4_functions_1.verifyCurrency(product.currency);
|
|
40
40
|
}
|
|
41
41
|
return product;
|
|
42
42
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/selectItem/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAC1E,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/selectItem/index.ts"],"names":[],"mappings":";;A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ACJ,SAAS,EAAE,OAAO,CAAC,SAAS;gBAC5B,OAAO,EAAE,OAAO,CAAC,OAAO;gBACxB,MAAM,EAAE;oBACN;wBACE,IAAI,EAAE,aAAa;wBACnB,MAAM,EAAE;4BACN,KAAK,EAAE,WAAW;4BAClB,cAAc,EAAE,OAAO,CAAC,cAAc;4BACtC,YAAY,EAAE,OAAO,CAAC,YAAY;4BAClC,oBAAoB,EAAE,OAAO,CAAC,oBAAoB;4BAClD,GAAG,OAAO,CAAC,MAAM;yBAClB;qBACF;iBACF;gBACD,GAAG,qCAAoB,CAAC,OAAO,CAAC,eAAe,CAAC;aACjD;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const actions_core_1 = require("@segment/actions-core");
|
|
4
|
-
const
|
|
4
|
+
const ga4_functions_1 = require("../ga4-functions");
|
|
5
5
|
const ga4_properties_1 = require("../ga4-properties");
|
|
6
6
|
const action = {
|
|
7
7
|
title: 'Select Promotion',
|
|
@@ -48,8 +48,8 @@ const action = {
|
|
|
48
48
|
if (product.item_name === undefined && product.item_id === undefined) {
|
|
49
49
|
throw new actions_core_1.IntegrationError('One of product name or product id is required for product or impression data.', 'Misconfigured required field', 400);
|
|
50
50
|
}
|
|
51
|
-
if (product.currency
|
|
52
|
-
|
|
51
|
+
if (product.currency) {
|
|
52
|
+
ga4_functions_1.verifyCurrency(product.currency);
|
|
53
53
|
}
|
|
54
54
|
if (product.promotion_id === undefined && product.promotion_name === undefined) {
|
|
55
55
|
throw new actions_core_1.IntegrationError('One of promotion name or promotion id is required.', 'Misconfigured required field', 400);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/selectPromotion/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAC1E,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/selectPromotion/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAC1E,oDAAiD;AACjD,sDAa0B;AAK1B,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,kBAAkB;IACzB,WAAW,EAAE,4CAA4C;IACzD,mBAAmB,EAAE,gDAAgD;IACrE,MAAM,EAAE;QACN,SAAS,EAAE,EAAE,GAAG,0BAAS,EAAE;QAC3B,OAAO,EAAE,EAAE,GAAG,wBAAO,EAAE;QACvB,aAAa,EAAE,EAAE,GAAG,8BAAa,EAAE;QACnC,aAAa,EAAE,EAAE,GAAG,8BAAa,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,uBAAuB,EAAE,EAAE;QAClF,WAAW,EAAE;YACX,KAAK,EAAE,aAAa;YACpB,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,yBAAyB;SACvC;QACD,YAAY,EAAE,EAAE,GAAG,6BAAY,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,2BAA2B,EAAE,EAAE;QACpF,cAAc,EAAE,EAAE,GAAG,+BAAc,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,mBAAmB,EAAE,EAAE;QAChF,KAAK,EAAE;YACL,GAAG,sCAAqB;YACxB,UAAU,EAAE;gBACV,GAAG,8BAAa,CAAC,UAAU;gBAC3B,aAAa,EAAE;oBACb,GAAG,8BAAa;iBACjB;gBACD,aAAa,EAAE;oBACb,GAAG,8BAAa;iBACjB;gBACD,cAAc,EAAE;oBACd,GAAG,+BAAc;iBAClB;gBACD,YAAY,EAAE;oBACZ,GAAG,6BAAY;iBAChB;aACF;SACF;QACD,eAAe,EAAE,gCAAe;QAChC,oBAAoB,EAAE,qCAAoB;QAC1C,MAAM,EAAE,uBAAM;KACf;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;QAChC,IAAI,WAAW,GAA2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IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const actions_core_1 = require("@segment/actions-core");
|
|
4
|
-
const
|
|
4
|
+
const ga4_functions_1 = require("../ga4-functions");
|
|
5
5
|
const ga4_properties_1 = require("../ga4-properties");
|
|
6
6
|
const action = {
|
|
7
7
|
title: 'View Cart',
|
|
@@ -21,8 +21,8 @@ const action = {
|
|
|
21
21
|
params: ga4_properties_1.params
|
|
22
22
|
},
|
|
23
23
|
perform: (request, { payload }) => {
|
|
24
|
-
if (payload.currency
|
|
25
|
-
|
|
24
|
+
if (payload.currency) {
|
|
25
|
+
ga4_functions_1.verifyCurrency(payload.currency);
|
|
26
26
|
}
|
|
27
27
|
if (payload.value && payload.currency === undefined) {
|
|
28
28
|
throw new actions_core_1.IntegrationError('Currency is required if value is set.', 'Misconfigured required field', 400);
|
|
@@ -36,8 +36,8 @@ const action = {
|
|
|
36
36
|
if (product.item_name === undefined && product.item_id === undefined) {
|
|
37
37
|
throw new actions_core_1.IntegrationError('One of product name or product id is required for product or impression data.', 'Misconfigured required field', 400);
|
|
38
38
|
}
|
|
39
|
-
if (product.currency
|
|
40
|
-
|
|
39
|
+
if (product.currency) {
|
|
40
|
+
ga4_functions_1.verifyCurrency(product.currency);
|
|
41
41
|
}
|
|
42
42
|
return product;
|
|
43
43
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/viewCart/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAC1E,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/viewCart/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAC1E,oDAAiD;AACjD,sDAU0B;AAK1B,MAAM,MAAM,GAAwC;IAClD,K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AAC,OAAO,KAAK,SAAS,EAAE;oBACpE,MAAM,IAAI,+BAAgB,CACxB,+EAA+E,EAC/E,8BAA8B,EAC9B,GAAG,CACJ,CAAA;iBACF;gBAED,IAAI,OAAO,CAAC,QAAQ,EAAE;oBACpB,8BAAc,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAA;iBACjC;gBAED,OAAO,OAAsB,CAAA;YAC/B,CAAC,CAAC,CAAA;SACH;QAED,OAAO,OAAO,CAAC,6CAA6C,EAAE;YAC5D,MAAM,EAAE,MAAM;YACd,IAAI,EAAE;gBACJ,SAAS,EAAE,OAAO,CAAC,SAAS;gBAC5B,OAAO,EAAE,OAAO,CAAC,OAAO;gBACxB,MAAM,EAAE;oBACN;wBACE,IAAI,EAAE,WAAW;wBACjB,MAAM,EAAE;4BACN,QAAQ,EAAE,OAAO,CAAC,QAAQ;4BAC1B,KAAK,EAAE,OAAO,CAAC,KAAK;4BACpB,KAAK,EAAE,WAAW;4BAClB,oBAAoB,EAAE,OAAO,CAAC,oBAAoB;4BAClD,GAAG,OAAO,CAAC,MAAM;yBAClB;qBACF;iBACF;gBACD,GAAG,qCAAoB,CAAC,OAAO,CAAC,eAAe,CAAC;aACjD;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const actions_core_1 = require("@segment/actions-core");
|
|
4
|
-
const
|
|
4
|
+
const ga4_functions_1 = require("../ga4-functions");
|
|
5
5
|
const ga4_properties_1 = require("../ga4-properties");
|
|
6
6
|
const action = {
|
|
7
7
|
title: 'View Item',
|
|
@@ -21,8 +21,8 @@ const action = {
|
|
|
21
21
|
params: ga4_properties_1.params
|
|
22
22
|
},
|
|
23
23
|
perform: (request, { payload }) => {
|
|
24
|
-
if (payload.currency
|
|
25
|
-
|
|
24
|
+
if (payload.currency) {
|
|
25
|
+
ga4_functions_1.verifyCurrency(payload.currency);
|
|
26
26
|
}
|
|
27
27
|
let googleItems = [];
|
|
28
28
|
if (payload.items) {
|
|
@@ -30,8 +30,8 @@ const action = {
|
|
|
30
30
|
if (product.item_name === undefined && product.item_id === undefined) {
|
|
31
31
|
throw new actions_core_1.IntegrationError('One of product name or product id is required for product or impression data.', 'Misconfigured required field', 400);
|
|
32
32
|
}
|
|
33
|
-
if (product.currency
|
|
34
|
-
|
|
33
|
+
if (product.currency) {
|
|
34
|
+
ga4_functions_1.verifyCurrency(product.currency);
|
|
35
35
|
}
|
|
36
36
|
return {
|
|
37
37
|
item_id: product.item_id,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/viewItem/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAC1E,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/viewItem/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAC1E,oDAAiD;AACjD,sDAU0B;AAK1B,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,WAAW;IAClB,WAAW,EAAE,sCAAsC;IACnD,mBAAmB,EAAE,8CAA8C;IACnE,MAAM,EAAE;QACN,SAAS,EAAE,EAAE,GAAG,0BAAS,EAAE;QAC3B,OAAO,EAAE,EAAE,GAAG,wBAAO,EAAE;QACvB,QAAQ,EAAE,EAAE,GAAG,yBAAQ,EAAE;QACzB,KAAK,EAAE,EAAE,GAAG,sBAAK,EAAE;QACnB,KAAK,EAAE;YACL,GAAG,sCAAqB;YACxB,QAAQ,EAAE,IAAI;SACf;QACD,eAAe,EAAE,gCAAe;QAChC,oBAAoB,EAAE,qCAAoB;QAC1C,MAAM,EAAE,uBAAM;KACf;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;QAChC,IAAI,OAAO,CAAC,QAAQ,E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AAK,EAAE,WAAW;4BAClB,KAAK,EAAE,OAAO,CAAC,KAAK;4BACpB,oBAAoB,EAAE,OAAO,CAAC,oBAAoB;4BAClD,GAAG,OAAO,CAAC,MAAM;yBAClB;qBACF;iBACF;gBACD,GAAG,qCAAoB,CAAC,OAAO,CAAC,eAAe,CAAC;aACjD;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const actions_core_1 = require("@segment/actions-core");
|
|
4
|
-
const
|
|
4
|
+
const ga4_functions_1 = require("../ga4-functions");
|
|
5
5
|
const ga4_properties_1 = require("../ga4-properties");
|
|
6
6
|
const action = {
|
|
7
7
|
title: 'View Item List',
|
|
@@ -41,8 +41,8 @@ const action = {
|
|
|
41
41
|
if (product.item_name === undefined && product.item_id === undefined) {
|
|
42
42
|
throw new actions_core_1.IntegrationError('One of product name or product id is required for product or impression data.', 'Misconfigured required field', 400);
|
|
43
43
|
}
|
|
44
|
-
if (product.currency
|
|
45
|
-
|
|
44
|
+
if (product.currency) {
|
|
45
|
+
ga4_functions_1.verifyCurrency(product.currency);
|
|
46
46
|
}
|
|
47
47
|
return product;
|
|
48
48
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/viewItemList/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAC1E,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/viewItemList/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAC1E,oDAAiD;AACjD,sDAQ0B;AAS1B,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,gBAAgB;IACvB,WAAW,EAAE,2DAA2D;IACxE,mBAAmB,EAAE,kDAAkD;IACvE,MAAM,EAAE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AO;gBACxB,MAAM,EAAE;oBACN;wBACE,IAAI,EAAE,gBAAgB;wBACtB,MAAM,EAAE;4BACN,YAAY,EAAE,OAAO,CAAC,YAAY;4BAClC,cAAc,EAAE,OAAO,CAAC,cAAc;4BACtC,KAAK,EAAE,WAAW;4BAClB,oBAAoB,EAAE,OAAO,CAAC,oBAAoB;4BAClD,GAAG,OAAO,CAAC,MAAM;yBAClB;qBACF;iBACF;gBACD,GAAG,qCAAoB,CAAC,OAAO,CAAC,eAAe,CAAC;aACjD;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const actions_core_1 = require("@segment/actions-core");
|
|
4
|
-
const
|
|
4
|
+
const ga4_functions_1 = require("../ga4-functions");
|
|
5
5
|
const ga4_properties_1 = require("../ga4-properties");
|
|
6
6
|
const action = {
|
|
7
7
|
title: 'View Promotion',
|
|
@@ -52,8 +52,8 @@ const action = {
|
|
|
52
52
|
if (product.item_name === undefined && product.item_id === undefined) {
|
|
53
53
|
throw new actions_core_1.IntegrationError('One of item id or item name is required.', 'Misconfigured required field', 400);
|
|
54
54
|
}
|
|
55
|
-
if (product.currency
|
|
56
|
-
|
|
55
|
+
if (product.currency) {
|
|
56
|
+
ga4_functions_1.verifyCurrency(product.currency);
|
|
57
57
|
}
|
|
58
58
|
return product;
|
|
59
59
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/viewPromotion/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAC1E,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/viewPromotion/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAC1E,oDAAiD;AACjD,sDAa0B;AAS1B,MAA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