@segment/action-destinations 3.31.0 → 3.33.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/amplitude/generated-types.d.ts +1 -0
- package/dist/destinations/amplitude/groupIdentifyUser/index.js +3 -2
- package/dist/destinations/amplitude/groupIdentifyUser/index.js.map +1 -1
- package/dist/destinations/amplitude/identifyUser/index.js +2 -1
- package/dist/destinations/amplitude/identifyUser/index.js.map +1 -1
- package/dist/destinations/amplitude/index.js +21 -2
- package/dist/destinations/amplitude/index.js.map +1 -1
- package/dist/destinations/amplitude/logEvent/index.js +2 -3
- package/dist/destinations/amplitude/logEvent/index.js.map +1 -1
- package/dist/destinations/amplitude/mapUser/index.js +2 -1
- package/dist/destinations/amplitude/mapUser/index.js.map +1 -1
- package/dist/destinations/amplitude/regional-endpoints.d.ts +32 -0
- package/dist/destinations/amplitude/regional-endpoints.js +39 -0
- package/dist/destinations/amplitude/regional-endpoints.js.map +1 -0
- package/dist/destinations/customerio/createUpdatePerson/index.js +11 -8
- package/dist/destinations/customerio/createUpdatePerson/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/addPaymentInfo/generated-types.d.ts +1 -1
- package/dist/destinations/google-analytics-4/addPaymentInfo/index.js +8 -138
- package/dist/destinations/google-analytics-4/addPaymentInfo/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/addToCart/generated-types.d.ts +1 -1
- package/dist/destinations/google-analytics-4/addToCart/index.js +6 -127
- package/dist/destinations/google-analytics-4/addToCart/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/addToWishlist/generated-types.d.ts +1 -1
- package/dist/destinations/google-analytics-4/addToWishlist/index.js +6 -125
- package/dist/destinations/google-analytics-4/addToWishlist/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/beginCheckout/generated-types.d.ts +1 -1
- package/dist/destinations/google-analytics-4/beginCheckout/index.js +7 -138
- package/dist/destinations/google-analytics-4/beginCheckout/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/customEvent/index.js +6 -14
- package/dist/destinations/google-analytics-4/customEvent/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/ga4-properties.d.ts +17 -0
- package/dist/destinations/google-analytics-4/ga4-properties.js +276 -0
- package/dist/destinations/google-analytics-4/ga4-properties.js.map +1 -0
- package/dist/destinations/google-analytics-4/generateLead/index.js +4 -23
- package/dist/destinations/google-analytics-4/generateLead/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/login/index.js +2 -13
- package/dist/destinations/google-analytics-4/login/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/pageView/index.js +2 -13
- package/dist/destinations/google-analytics-4/pageView/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/purchase/generated-types.d.ts +1 -1
- package/dist/destinations/google-analytics-4/purchase/index.js +11 -172
- package/dist/destinations/google-analytics-4/purchase/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/refund/index.js +9 -148
- package/dist/destinations/google-analytics-4/refund/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/removeFromCart/index.js +6 -125
- package/dist/destinations/google-analytics-4/removeFromCart/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/search/index.js +2 -13
- package/dist/destinations/google-analytics-4/search/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/selectItem/generated-types.d.ts +1 -1
- package/dist/destinations/google-analytics-4/selectItem/index.js +4 -114
- package/dist/destinations/google-analytics-4/selectItem/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/selectPromotion/generated-types.d.ts +4 -4
- package/dist/destinations/google-analytics-4/selectPromotion/index.js +13 -145
- package/dist/destinations/google-analytics-4/selectPromotion/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/signUp/index.js +2 -13
- package/dist/destinations/google-analytics-4/signUp/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/viewCart/index.js +6 -125
- package/dist/destinations/google-analytics-4/viewCart/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/viewItem/generated-types.d.ts +1 -1
- package/dist/destinations/google-analytics-4/viewItem/index.js +6 -130
- package/dist/destinations/google-analytics-4/viewItem/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/viewItemList/index.js +4 -115
- package/dist/destinations/google-analytics-4/viewItemList/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/viewPromotion/generated-types.d.ts +4 -4
- package/dist/destinations/google-analytics-4/viewPromotion/index.js +13 -154
- package/dist/destinations/google-analytics-4/viewPromotion/index.js.map +1 -1
- package/dist/destinations/mixpanel/alias/generated-types.d.ts +1 -1
- package/dist/destinations/mixpanel/alias/index.js +6 -6
- package/dist/destinations/mixpanel/alias/index.js.map +1 -1
- package/dist/destinations/mixpanel/groupIdentifyUser/generated-types.d.ts +1 -0
- package/dist/destinations/mixpanel/groupIdentifyUser/index.js +14 -9
- package/dist/destinations/mixpanel/groupIdentifyUser/index.js.map +1 -1
- package/dist/destinations/mixpanel/identifyUser/generated-types.d.ts +1 -0
- package/dist/destinations/mixpanel/identifyUser/index.js +43 -10
- package/dist/destinations/mixpanel/identifyUser/index.js.map +1 -1
- package/dist/destinations/mixpanel/trackEvent/generated-types.d.ts +1 -0
- package/dist/destinations/mixpanel/trackEvent/index.js +9 -0
- package/dist/destinations/mixpanel/trackEvent/index.js.map +1 -1
- package/dist/destinations/mixpanel/trackEvent/types.d.ts +1 -0
- package/package.json +2 -2
|
@@ -2,140 +2,19 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const actions_core_1 = require("@segment/actions-core");
|
|
4
4
|
const constants_1 = require("../constants");
|
|
5
|
+
const ga4_properties_1 = require("../ga4-properties");
|
|
5
6
|
const action = {
|
|
6
7
|
title: 'Add to Cart',
|
|
7
8
|
description: 'Send event when a user adds items to a cart',
|
|
8
9
|
defaultSubscription: 'type = "track" and event = "Product Added"',
|
|
9
10
|
fields: {
|
|
10
|
-
client_id: {
|
|
11
|
-
|
|
12
|
-
description: 'Uniquely identifies a user instance of a web client.',
|
|
13
|
-
type: 'string',
|
|
14
|
-
required: true,
|
|
15
|
-
default: {
|
|
16
|
-
'@if': {
|
|
17
|
-
exists: { '@path': '$.userId' },
|
|
18
|
-
then: { '@path': '$.userId' },
|
|
19
|
-
else: { '@path': '$.anonymousId' }
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
},
|
|
23
|
-
currency: {
|
|
24
|
-
label: 'Currency',
|
|
25
|
-
type: 'string',
|
|
26
|
-
description: 'Currency of the purchase or items associated with the event, in 3-letter ISO 4217 format.'
|
|
27
|
-
},
|
|
11
|
+
client_id: { ...ga4_properties_1.client_id },
|
|
12
|
+
currency: { ...ga4_properties_1.currency },
|
|
28
13
|
items: {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
type: 'object',
|
|
32
|
-
multiple: true,
|
|
33
|
-
properties: {
|
|
34
|
-
item_id: {
|
|
35
|
-
label: 'Product ID',
|
|
36
|
-
type: 'string',
|
|
37
|
-
description: 'Identifier for the product being purchased.'
|
|
38
|
-
},
|
|
39
|
-
item_name: {
|
|
40
|
-
label: 'Name',
|
|
41
|
-
type: 'string',
|
|
42
|
-
description: 'Name of the product being purchased.'
|
|
43
|
-
},
|
|
44
|
-
affiliation: {
|
|
45
|
-
label: 'Affiliation',
|
|
46
|
-
type: 'string',
|
|
47
|
-
description: 'A product affiliation to designate a supplying company or brick and mortar store location.'
|
|
48
|
-
},
|
|
49
|
-
coupon: {
|
|
50
|
-
label: 'Coupon',
|
|
51
|
-
type: 'string',
|
|
52
|
-
description: 'Coupon code used for a purchase.'
|
|
53
|
-
},
|
|
54
|
-
currency: {
|
|
55
|
-
label: 'Currency',
|
|
56
|
-
type: 'string',
|
|
57
|
-
description: 'Currency of the purchase or items associated with the event, in 3-letter ISO 4217 format.'
|
|
58
|
-
},
|
|
59
|
-
discount: {
|
|
60
|
-
label: 'Discount',
|
|
61
|
-
type: 'number',
|
|
62
|
-
description: 'Monetary value of discount associated with a purchase.'
|
|
63
|
-
},
|
|
64
|
-
index: {
|
|
65
|
-
label: 'Index',
|
|
66
|
-
type: 'number',
|
|
67
|
-
description: 'The index of the item in a list.'
|
|
68
|
-
},
|
|
69
|
-
item_brand: {
|
|
70
|
-
label: 'Brand',
|
|
71
|
-
type: 'string',
|
|
72
|
-
description: 'Brand associated with the product.'
|
|
73
|
-
},
|
|
74
|
-
item_category: {
|
|
75
|
-
label: 'Category',
|
|
76
|
-
type: 'string',
|
|
77
|
-
description: 'Category of the product.'
|
|
78
|
-
},
|
|
79
|
-
item_category2: {
|
|
80
|
-
label: 'Category2',
|
|
81
|
-
type: 'string',
|
|
82
|
-
description: 'The second category of the product.'
|
|
83
|
-
},
|
|
84
|
-
item_category3: {
|
|
85
|
-
label: 'Category3',
|
|
86
|
-
type: 'string',
|
|
87
|
-
description: 'The third category of the product.'
|
|
88
|
-
},
|
|
89
|
-
item_category4: {
|
|
90
|
-
label: 'Category4',
|
|
91
|
-
type: 'string',
|
|
92
|
-
description: 'The fourth category of the product.'
|
|
93
|
-
},
|
|
94
|
-
item_category5: {
|
|
95
|
-
label: 'Category5',
|
|
96
|
-
type: 'string',
|
|
97
|
-
description: 'The fifth category of the product.'
|
|
98
|
-
},
|
|
99
|
-
item_list_id: {
|
|
100
|
-
label: 'Item List Name',
|
|
101
|
-
type: 'string',
|
|
102
|
-
description: 'The ID of the list in which the item was presented to the user.'
|
|
103
|
-
},
|
|
104
|
-
item_list_name: {
|
|
105
|
-
label: 'Item List Name',
|
|
106
|
-
type: 'string',
|
|
107
|
-
description: 'The name of the list in which the item was presented to the user.'
|
|
108
|
-
},
|
|
109
|
-
item_variant: {
|
|
110
|
-
label: 'Variant',
|
|
111
|
-
type: 'string',
|
|
112
|
-
description: 'Variant of the product (e.g. Black).'
|
|
113
|
-
},
|
|
114
|
-
location_id: {
|
|
115
|
-
label: 'Location ID',
|
|
116
|
-
type: 'string',
|
|
117
|
-
description: 'The location associated with the item.'
|
|
118
|
-
},
|
|
119
|
-
price: {
|
|
120
|
-
label: 'Price',
|
|
121
|
-
type: 'number',
|
|
122
|
-
description: 'Price of the product being purchased, in units of the specified currency parameter.'
|
|
123
|
-
},
|
|
124
|
-
quantity: {
|
|
125
|
-
label: 'Quantity',
|
|
126
|
-
type: 'integer',
|
|
127
|
-
description: 'Item quantity.'
|
|
128
|
-
}
|
|
129
|
-
}
|
|
14
|
+
...ga4_properties_1.items_single_products,
|
|
15
|
+
required: true
|
|
130
16
|
},
|
|
131
|
-
value: {
|
|
132
|
-
label: 'Value',
|
|
133
|
-
type: 'number',
|
|
134
|
-
description: 'The monetary value of the event, in units of the specified currency parameter.',
|
|
135
|
-
default: {
|
|
136
|
-
'@path': '$.properties.value'
|
|
137
|
-
}
|
|
138
|
-
}
|
|
17
|
+
value: { ...ga4_properties_1.value }
|
|
139
18
|
},
|
|
140
19
|
perform: (request, { payload }) => {
|
|
141
20
|
let googleItems = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/addToCart/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAI1E,4CAAiD;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/addToCart/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAI1E,4CAAiD;AACjD,sDAAqF;AAErF,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,QAAQ,EAAE,EAAE,GAAG,yBAAQ,EAAE;QACzB,KAAK,EAAE;YACL,GAAG,sCAAqB;YACxB,QAAQ,EAAE,IAAI;SACf;QACD,KAAK,EAAE,EAAE,GAAG,sBAAK,EAAE;KACpB;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;QAChC,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,IAAI,CAAC,8BAAkB,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;oBACtE,MAAM,IAAI,+BAAgB,CAAC,GAAG,OAAO,CAAC,QAAQ,gCAAgC,EAAE,wBAAwB,EAAE,GAAG,CAAC,CAAA;iBAC/G;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,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;yBACrB;qBACF;iBACF;aACF;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -2,137 +2,18 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const actions_core_1 = require("@segment/actions-core");
|
|
4
4
|
const constants_1 = require("../constants");
|
|
5
|
+
const ga4_properties_1 = require("../ga4-properties");
|
|
5
6
|
const action = {
|
|
6
7
|
title: 'Add to Wishlist',
|
|
7
8
|
description: 'Send event when a user adds items to a wishlist',
|
|
8
9
|
defaultSubscription: 'type = "track" and event = "Product Added to Wishlist"',
|
|
9
10
|
fields: {
|
|
10
|
-
client_id: {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
type: 'string',
|
|
14
|
-
required: true,
|
|
15
|
-
default: {
|
|
16
|
-
'@if': {
|
|
17
|
-
exists: { '@path': '$.userId' },
|
|
18
|
-
then: { '@path': '$.userId' },
|
|
19
|
-
else: { '@path': '$.anonymousId' }
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
},
|
|
23
|
-
currency: {
|
|
24
|
-
label: 'Currency',
|
|
25
|
-
type: 'string',
|
|
26
|
-
description: 'Currency of the items associated with the event, in 3-letter ISO 4217 format.'
|
|
27
|
-
},
|
|
28
|
-
value: {
|
|
29
|
-
label: 'Value',
|
|
30
|
-
type: 'string',
|
|
31
|
-
description: 'The monetary value of the event.'
|
|
32
|
-
},
|
|
11
|
+
client_id: { ...ga4_properties_1.client_id },
|
|
12
|
+
currency: { ...ga4_properties_1.currency },
|
|
13
|
+
value: { ...ga4_properties_1.value },
|
|
33
14
|
items: {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
type: 'object',
|
|
37
|
-
multiple: true,
|
|
38
|
-
required: true,
|
|
39
|
-
properties: {
|
|
40
|
-
item_id: {
|
|
41
|
-
label: 'Product ID',
|
|
42
|
-
type: 'string',
|
|
43
|
-
description: 'Identifier for the product being purchased.'
|
|
44
|
-
},
|
|
45
|
-
item_name: {
|
|
46
|
-
label: 'Name',
|
|
47
|
-
type: 'string',
|
|
48
|
-
description: 'Name of the product being purchased.'
|
|
49
|
-
},
|
|
50
|
-
affiliation: {
|
|
51
|
-
label: 'Affiliation',
|
|
52
|
-
type: 'string',
|
|
53
|
-
description: 'A product affiliation to designate a supplying company or brick and mortar store location.'
|
|
54
|
-
},
|
|
55
|
-
coupon: {
|
|
56
|
-
label: 'Coupon',
|
|
57
|
-
type: 'string',
|
|
58
|
-
description: 'Coupon code used for a purchase.'
|
|
59
|
-
},
|
|
60
|
-
currency: {
|
|
61
|
-
label: 'Currency',
|
|
62
|
-
type: 'string',
|
|
63
|
-
description: 'Currency of the purchase or items associated with the event, in 3-letter ISO 4217 format.'
|
|
64
|
-
},
|
|
65
|
-
discount: {
|
|
66
|
-
label: 'Discount',
|
|
67
|
-
type: 'number',
|
|
68
|
-
description: 'Monetary value of discount associated with a purchase.'
|
|
69
|
-
},
|
|
70
|
-
index: {
|
|
71
|
-
label: 'Index',
|
|
72
|
-
type: 'number',
|
|
73
|
-
description: 'The index/position of the item in a list.'
|
|
74
|
-
},
|
|
75
|
-
item_brand: {
|
|
76
|
-
label: 'Brand',
|
|
77
|
-
type: 'string',
|
|
78
|
-
description: 'Brand associated with the product.'
|
|
79
|
-
},
|
|
80
|
-
item_category: {
|
|
81
|
-
label: 'Category',
|
|
82
|
-
type: 'string',
|
|
83
|
-
description: 'Product category.'
|
|
84
|
-
},
|
|
85
|
-
item_category2: {
|
|
86
|
-
label: 'Category 2',
|
|
87
|
-
type: 'string',
|
|
88
|
-
description: 'Product category 2.'
|
|
89
|
-
},
|
|
90
|
-
item_category3: {
|
|
91
|
-
label: 'Category 3',
|
|
92
|
-
type: 'string',
|
|
93
|
-
description: 'Product category 3.'
|
|
94
|
-
},
|
|
95
|
-
item_category4: {
|
|
96
|
-
label: 'Category 4',
|
|
97
|
-
type: 'string',
|
|
98
|
-
description: 'Product category 4.'
|
|
99
|
-
},
|
|
100
|
-
item_category5: {
|
|
101
|
-
label: 'Category 5',
|
|
102
|
-
type: 'string',
|
|
103
|
-
description: 'Product category 5.'
|
|
104
|
-
},
|
|
105
|
-
item_list_id: {
|
|
106
|
-
label: 'Item List ID',
|
|
107
|
-
type: 'string',
|
|
108
|
-
description: 'The ID of the list in which the item was presented to the user.'
|
|
109
|
-
},
|
|
110
|
-
item_list_name: {
|
|
111
|
-
label: 'Item List Name',
|
|
112
|
-
type: 'string',
|
|
113
|
-
description: 'The name of the list in which the item was presented to the user.'
|
|
114
|
-
},
|
|
115
|
-
item_variant: {
|
|
116
|
-
label: 'Variant',
|
|
117
|
-
type: 'string',
|
|
118
|
-
description: 'Variant of the product (e.g. Black).'
|
|
119
|
-
},
|
|
120
|
-
location_id: {
|
|
121
|
-
label: 'Location ID',
|
|
122
|
-
type: 'string',
|
|
123
|
-
description: 'The location associated with the item.'
|
|
124
|
-
},
|
|
125
|
-
price: {
|
|
126
|
-
label: 'Price',
|
|
127
|
-
type: 'number',
|
|
128
|
-
description: 'Price of the product being purchased, in units of the specified currency parameter.'
|
|
129
|
-
},
|
|
130
|
-
quantity: {
|
|
131
|
-
label: 'Quantity',
|
|
132
|
-
type: 'integer',
|
|
133
|
-
description: 'Item quantity.'
|
|
134
|
-
}
|
|
135
|
-
}
|
|
15
|
+
...ga4_properties_1.items_single_products,
|
|
16
|
+
required: true
|
|
136
17
|
}
|
|
137
18
|
},
|
|
138
19
|
perform: (request, { payload }) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/addToWishlist/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAC1E,4CAAiD;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/addToWishlist/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAC1E,4CAAiD;AAIjD,sDAAqF;AAErF,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,QAAQ,EAAE,EAAE,GAAG,yBAAQ,EAAE;QACzB,KAAK,EAAE,EAAE,GAAG,sBAAK,EAAE;QACnB,KAAK,EAAE;YACL,GAAG,sCAAqB;YACxB,QAAQ,EAAE,IAAI;SACf;KACF;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,OAAO,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AAO,CAAC,6CAA6C,EAAE;YAC5D,MAAM,EAAE,MAAM;YACd,IAAI,EAAE;gBACJ,SAAS,EAAE,OAAO,CAAC,SAAS;gBAC5B,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;yBACnB;qBACF;iBACF;aACF;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -2,151 +2,20 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const actions_core_1 = require("@segment/actions-core");
|
|
4
4
|
const constants_1 = require("../constants");
|
|
5
|
+
const ga4_properties_1 = require("../ga4-properties");
|
|
5
6
|
const action = {
|
|
6
7
|
title: 'Begin Checkout',
|
|
7
8
|
description: 'Send event when a user begins checkout',
|
|
8
9
|
defaultSubscription: 'type = "track" and event = "Checkout Started"',
|
|
9
10
|
fields: {
|
|
10
|
-
client_id: {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
type: 'string',
|
|
14
|
-
required: true,
|
|
15
|
-
default: {
|
|
16
|
-
'@if': {
|
|
17
|
-
exists: { '@path': '$.userId' },
|
|
18
|
-
then: { '@path': '$.userId' },
|
|
19
|
-
else: { '@path': '$.anonymousId' }
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
},
|
|
23
|
-
coupon: {
|
|
24
|
-
label: 'Coupon',
|
|
25
|
-
type: 'string',
|
|
26
|
-
description: 'Coupon code used for a purchase.',
|
|
27
|
-
default: {
|
|
28
|
-
'@path': '$.properties.coupon'
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
currency: {
|
|
32
|
-
label: 'Currency',
|
|
33
|
-
type: 'string',
|
|
34
|
-
description: 'Currency of the purchase or items associated with the event, in 3-letter ISO 4217 format.',
|
|
35
|
-
default: {
|
|
36
|
-
'@path': '$.properties.currency'
|
|
37
|
-
}
|
|
38
|
-
},
|
|
11
|
+
client_id: { ...ga4_properties_1.client_id },
|
|
12
|
+
coupon: { ...ga4_properties_1.coupon, default: { '@path': '$.properties.coupon' } },
|
|
13
|
+
currency: { ...ga4_properties_1.currency },
|
|
39
14
|
items: {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
type: 'object',
|
|
43
|
-
multiple: true,
|
|
44
|
-
properties: {
|
|
45
|
-
item_id: {
|
|
46
|
-
label: 'Product ID',
|
|
47
|
-
type: 'string',
|
|
48
|
-
description: 'Identifier for the product being purchased.'
|
|
49
|
-
},
|
|
50
|
-
item_name: {
|
|
51
|
-
label: 'Name',
|
|
52
|
-
type: 'string',
|
|
53
|
-
description: 'Name of the product being purchased.'
|
|
54
|
-
},
|
|
55
|
-
affiliation: {
|
|
56
|
-
label: 'Affiliation',
|
|
57
|
-
type: 'string',
|
|
58
|
-
description: 'A product affiliation to designate a supplying company or brick and mortar store location.'
|
|
59
|
-
},
|
|
60
|
-
coupon: {
|
|
61
|
-
label: 'Coupon',
|
|
62
|
-
type: 'string',
|
|
63
|
-
description: 'Coupon code used for a purchase.'
|
|
64
|
-
},
|
|
65
|
-
currency: {
|
|
66
|
-
label: 'Currency',
|
|
67
|
-
type: 'string',
|
|
68
|
-
description: 'Currency of the purchase or items associated with the event, in 3-letter ISO 4217 format.'
|
|
69
|
-
},
|
|
70
|
-
discount: {
|
|
71
|
-
label: 'Discount',
|
|
72
|
-
type: 'number',
|
|
73
|
-
description: 'Monetary value of discount associated with a purchase.'
|
|
74
|
-
},
|
|
75
|
-
index: {
|
|
76
|
-
label: 'Index',
|
|
77
|
-
type: 'number',
|
|
78
|
-
description: 'The index of the item in a list.'
|
|
79
|
-
},
|
|
80
|
-
item_brand: {
|
|
81
|
-
label: 'Brand',
|
|
82
|
-
type: 'string',
|
|
83
|
-
description: 'Brand associated with the product.'
|
|
84
|
-
},
|
|
85
|
-
item_category: {
|
|
86
|
-
label: 'Category',
|
|
87
|
-
type: 'string',
|
|
88
|
-
description: 'Category of the product.'
|
|
89
|
-
},
|
|
90
|
-
item_category2: {
|
|
91
|
-
label: 'Category2',
|
|
92
|
-
type: 'string',
|
|
93
|
-
description: 'The second category of the product.'
|
|
94
|
-
},
|
|
95
|
-
item_category3: {
|
|
96
|
-
label: 'Category3',
|
|
97
|
-
type: 'string',
|
|
98
|
-
description: 'The third category of the product.'
|
|
99
|
-
},
|
|
100
|
-
item_category4: {
|
|
101
|
-
label: 'Category4',
|
|
102
|
-
type: 'string',
|
|
103
|
-
description: 'The fourth category of the product.'
|
|
104
|
-
},
|
|
105
|
-
item_category5: {
|
|
106
|
-
label: 'Category5',
|
|
107
|
-
type: 'string',
|
|
108
|
-
description: 'The fifth category of the product.'
|
|
109
|
-
},
|
|
110
|
-
item_list_id: {
|
|
111
|
-
label: 'Item List Name',
|
|
112
|
-
type: 'string',
|
|
113
|
-
description: 'The ID of the list in which the item was presented to the user.'
|
|
114
|
-
},
|
|
115
|
-
item_list_name: {
|
|
116
|
-
label: 'Item List Name',
|
|
117
|
-
type: 'string',
|
|
118
|
-
description: 'The name of the list in which the item was presented to the user.'
|
|
119
|
-
},
|
|
120
|
-
item_variant: {
|
|
121
|
-
label: 'Variant',
|
|
122
|
-
type: 'string',
|
|
123
|
-
description: 'Variant of the product (e.g. Black).'
|
|
124
|
-
},
|
|
125
|
-
location_id: {
|
|
126
|
-
label: 'Location ID',
|
|
127
|
-
type: 'string',
|
|
128
|
-
description: 'The location associated with the item.'
|
|
129
|
-
},
|
|
130
|
-
price: {
|
|
131
|
-
label: 'Price',
|
|
132
|
-
type: 'number',
|
|
133
|
-
description: 'Price of the product being purchased, in units of the specified currency parameter.'
|
|
134
|
-
},
|
|
135
|
-
quantity: {
|
|
136
|
-
label: 'Quantity',
|
|
137
|
-
type: 'integer',
|
|
138
|
-
description: 'Item quantity.'
|
|
139
|
-
}
|
|
140
|
-
}
|
|
15
|
+
...ga4_properties_1.items_multi_products,
|
|
16
|
+
required: true
|
|
141
17
|
},
|
|
142
|
-
value: {
|
|
143
|
-
label: 'Value',
|
|
144
|
-
type: 'number',
|
|
145
|
-
description: 'The monetary value of the event, in units of the specified currency parameter.',
|
|
146
|
-
default: {
|
|
147
|
-
'@path': '$.properties.value'
|
|
148
|
-
}
|
|
149
|
-
}
|
|
18
|
+
value: { ...ga4_properties_1.value }
|
|
150
19
|
},
|
|
151
20
|
perform: (request, { payload }) => {
|
|
152
21
|
if (payload.currency && !constants_1.CURRENCY_ISO_CODES.includes(payload.currency)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/beginCheckout/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAC1E,4CAAiD;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/beginCheckout/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAC1E,4CAAiD;AACjD,sDAA4F;AAK5F,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,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;KACpB;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;QAChC,IAAI,OAAO,CAAC,QAAQ,IAAI,CAAC,8BAAkB,CAAC,QAAQ,CAAC,OAAO,CA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{ value: true });
|
|
3
|
+
const ga4_properties_1 = require("../ga4-properties");
|
|
3
4
|
const action = {
|
|
4
5
|
title: 'Custom Event',
|
|
5
6
|
description: 'Send any custom event',
|
|
6
7
|
defaultSubscription: 'type = "track"',
|
|
7
8
|
fields: {
|
|
8
|
-
clientId: {
|
|
9
|
-
label: 'Client ID',
|
|
10
|
-
description: 'Uniquely identifies a user instance of a web client.',
|
|
11
|
-
type: 'string',
|
|
12
|
-
required: true,
|
|
13
|
-
default: {
|
|
14
|
-
'@if': {
|
|
15
|
-
exists: { '@path': '$.userId' },
|
|
16
|
-
then: { '@path': '$.userId' },
|
|
17
|
-
else: { '@path': '$.anonymousId' }
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
},
|
|
9
|
+
clientId: { ...ga4_properties_1.client_id },
|
|
21
10
|
name: {
|
|
22
11
|
label: 'Event Name',
|
|
23
12
|
description: 'The unique name of the custom event created in GA4.',
|
|
24
13
|
type: 'string',
|
|
25
|
-
required: true
|
|
14
|
+
required: true,
|
|
15
|
+
default: {
|
|
16
|
+
'@path': '$.event'
|
|
17
|
+
}
|
|
26
18
|
},
|
|
27
19
|
params: {
|
|
28
20
|
label: 'Event Parameters',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/customEvent/index.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/customEvent/index.ts"],"names":[],"mappings":";;AAGA,sDAA6C;AAE7C,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,cAAc;IACrB,WAAW,EAAE,uBAAuB;IACpC,mBAAmB,EAAE,gBAAgB;IACrC,MAAM,EAAE;QACN,QAAQ,EAAE,EAAE,GAAG,0BAAS,EAAE;QAC1B,IAAI,EAAE;YACJ,KAAK,EAAE,YAAY;YACnB,WAAW,EAAE,qDAAqD;YAClE,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,SAAS;aACnB;SACF;QACD,MAAM,EAAE;YACN,KAAK,EAAE,kBAAkB;YACzB,WAAW,EAAE,wCAAwC;YACrD,IAAI,EAAE,QAAQ;YACd,oBAAoB,EAAE,IAAI;YAC1B,OAAO,EAAE,EAAE,OAAO,EAAE,cAAc,EAAE;SACrC;KACF;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;QAChC,OAAO,OAAO,CAAC,6CAA6C,EAAE;YAC5D,MAAM,EAAE,MAAM;YACd,IAAI,EAAE;gBACJ,SAAS,EAAE,OAAO,CAAC,QAAQ;gBAC3B,MAAM,EAAE;oBACN;wBACE,IAAI,EAAE,OAAO,CAAC,IAAI;wBAClB,MAAM,EAAE,OAAO,CAAC,MAAM;qBACvB;iBACF;aACF;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { InputField } from '@segment/actions-core/src/destination-kit/types';
|
|
2
|
+
export declare const promotion_id: InputField;
|
|
3
|
+
export declare const promotion_name: InputField;
|
|
4
|
+
export declare const creative_slot: InputField;
|
|
5
|
+
export declare const creative_name: InputField;
|
|
6
|
+
export declare const tax: InputField;
|
|
7
|
+
export declare const shipping: InputField;
|
|
8
|
+
export declare const transaction_id: InputField;
|
|
9
|
+
export declare const affiliation: InputField;
|
|
10
|
+
export declare const client_id: InputField;
|
|
11
|
+
export declare const currency: InputField;
|
|
12
|
+
export declare const value: InputField;
|
|
13
|
+
export declare const coupon: InputField;
|
|
14
|
+
export declare const payment_type: InputField;
|
|
15
|
+
export declare const minimal_items: InputField;
|
|
16
|
+
export declare const items_single_products: InputField;
|
|
17
|
+
export declare const items_multi_products: InputField;
|