@segment/action-destinations 3.32.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/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/package.json +2 -2
|
@@ -2,185 +2,24 @@
|
|
|
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: 'Purchase',
|
|
7
8
|
description: 'Send event when a user completes a purchase',
|
|
8
9
|
defaultSubscription: 'type = "track" and event = "Order Completed"',
|
|
9
10
|
fields: {
|
|
10
|
-
client_id: {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
required: true,
|
|
15
|
-
default: {
|
|
16
|
-
'@if': {
|
|
17
|
-
exists: { '@path': '$.userId' },
|
|
18
|
-
then: { '@path': '$.userId' },
|
|
19
|
-
else: { '@path': '$.anonymousId' }
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
},
|
|
23
|
-
affiliation: {
|
|
24
|
-
label: 'Affiliation',
|
|
25
|
-
type: 'string',
|
|
26
|
-
description: 'Store or affiliation from which this transaction occurred (e.g. Google Store).',
|
|
27
|
-
default: {
|
|
28
|
-
'@path': '$.properties.affiliation'
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
coupon: {
|
|
32
|
-
label: 'Coupon',
|
|
33
|
-
type: 'string',
|
|
34
|
-
description: 'Coupon code used for a purchase.',
|
|
35
|
-
default: {
|
|
36
|
-
'@path': '$.properties.coupon'
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
|
-
currency: {
|
|
40
|
-
label: 'Currency',
|
|
41
|
-
type: 'string',
|
|
42
|
-
description: 'Currency of the purchase or items associated with the event, in 3-letter ISO 4217 format.',
|
|
43
|
-
required: true,
|
|
44
|
-
default: {
|
|
45
|
-
'@path': '$.properties.currency'
|
|
46
|
-
}
|
|
47
|
-
},
|
|
11
|
+
client_id: { ...ga4_properties_1.client_id },
|
|
12
|
+
affiliation: { ...ga4_properties_1.affiliation },
|
|
13
|
+
coupon: { ...ga4_properties_1.coupon, default: { '@path': '$.properties.coupon' } },
|
|
14
|
+
currency: { ...ga4_properties_1.currency, required: true },
|
|
48
15
|
items: {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
type: 'object',
|
|
52
|
-
multiple: true,
|
|
53
|
-
properties: {
|
|
54
|
-
item_id: {
|
|
55
|
-
label: 'Product ID',
|
|
56
|
-
type: 'string',
|
|
57
|
-
description: 'Identifier for the product being purchased.'
|
|
58
|
-
},
|
|
59
|
-
item_name: {
|
|
60
|
-
label: 'Name',
|
|
61
|
-
type: 'string',
|
|
62
|
-
description: 'Name of the product being purchased.'
|
|
63
|
-
},
|
|
64
|
-
affiliation: {
|
|
65
|
-
label: 'Affiliation',
|
|
66
|
-
type: 'string',
|
|
67
|
-
description: 'A product affiliation to designate a supplying company or brick and mortar store location.'
|
|
68
|
-
},
|
|
69
|
-
coupon: {
|
|
70
|
-
label: 'Coupon',
|
|
71
|
-
type: 'string',
|
|
72
|
-
description: 'Coupon code used for a purchase.'
|
|
73
|
-
},
|
|
74
|
-
currency: {
|
|
75
|
-
label: 'Currency',
|
|
76
|
-
type: 'string',
|
|
77
|
-
description: 'Currency of the purchase or items associated with the event, in 3-letter ISO 4217 format.'
|
|
78
|
-
},
|
|
79
|
-
discount: {
|
|
80
|
-
label: 'Discount',
|
|
81
|
-
type: 'number',
|
|
82
|
-
description: 'Monetary value of discount associated with a purchase.'
|
|
83
|
-
},
|
|
84
|
-
index: {
|
|
85
|
-
label: 'Index',
|
|
86
|
-
type: 'number',
|
|
87
|
-
description: 'The index of the item in a list.'
|
|
88
|
-
},
|
|
89
|
-
item_brand: {
|
|
90
|
-
label: 'Brand',
|
|
91
|
-
type: 'string',
|
|
92
|
-
description: 'Brand associated with the product.'
|
|
93
|
-
},
|
|
94
|
-
item_category: {
|
|
95
|
-
label: 'Category',
|
|
96
|
-
type: 'string',
|
|
97
|
-
description: 'Category of the product.'
|
|
98
|
-
},
|
|
99
|
-
item_category2: {
|
|
100
|
-
label: 'Category2',
|
|
101
|
-
type: 'string',
|
|
102
|
-
description: 'The second category of the product.'
|
|
103
|
-
},
|
|
104
|
-
item_category3: {
|
|
105
|
-
label: 'Category3',
|
|
106
|
-
type: 'string',
|
|
107
|
-
description: 'The third category of the product.'
|
|
108
|
-
},
|
|
109
|
-
item_category4: {
|
|
110
|
-
label: 'Category4',
|
|
111
|
-
type: 'string',
|
|
112
|
-
description: 'The fourth category of the product.'
|
|
113
|
-
},
|
|
114
|
-
item_category5: {
|
|
115
|
-
label: 'Category5',
|
|
116
|
-
type: 'string',
|
|
117
|
-
description: 'The fifth category of the product.'
|
|
118
|
-
},
|
|
119
|
-
item_list_id: {
|
|
120
|
-
label: 'Item List Name',
|
|
121
|
-
type: 'string',
|
|
122
|
-
description: 'The ID of the list in which the item was presented to the user.'
|
|
123
|
-
},
|
|
124
|
-
item_list_name: {
|
|
125
|
-
label: 'Item List Name',
|
|
126
|
-
type: 'string',
|
|
127
|
-
description: 'The name of the list in which the item was presented to the user.'
|
|
128
|
-
},
|
|
129
|
-
item_variant: {
|
|
130
|
-
label: 'Variant',
|
|
131
|
-
type: 'string',
|
|
132
|
-
description: 'Variant of the product (e.g. Black).'
|
|
133
|
-
},
|
|
134
|
-
location_id: {
|
|
135
|
-
label: 'Location ID',
|
|
136
|
-
type: 'string',
|
|
137
|
-
description: 'The location associated with the item.'
|
|
138
|
-
},
|
|
139
|
-
price: {
|
|
140
|
-
label: 'Price',
|
|
141
|
-
type: 'number',
|
|
142
|
-
description: 'Price of the product being purchased, in units of the specified currency parameter.'
|
|
143
|
-
},
|
|
144
|
-
quantity: {
|
|
145
|
-
label: 'Quantity',
|
|
146
|
-
type: 'integer',
|
|
147
|
-
description: 'Item quantity.'
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
},
|
|
151
|
-
transaction_id: {
|
|
152
|
-
label: 'Order Id',
|
|
153
|
-
type: 'string',
|
|
154
|
-
description: 'The unique identifier of a transaction.',
|
|
155
|
-
required: true,
|
|
156
|
-
default: {
|
|
157
|
-
'@path': '$.properties.order_id'
|
|
158
|
-
}
|
|
159
|
-
},
|
|
160
|
-
shipping: {
|
|
161
|
-
label: 'Shipping',
|
|
162
|
-
type: 'number',
|
|
163
|
-
description: 'Shipping cost associated with the transaction.',
|
|
164
|
-
default: {
|
|
165
|
-
'@path': '$.properties.shipping'
|
|
166
|
-
}
|
|
16
|
+
...ga4_properties_1.items_multi_products,
|
|
17
|
+
required: true
|
|
167
18
|
},
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
default: {
|
|
173
|
-
'@path': '$.properties.tax'
|
|
174
|
-
}
|
|
175
|
-
},
|
|
176
|
-
value: {
|
|
177
|
-
label: 'Value',
|
|
178
|
-
type: 'number',
|
|
179
|
-
description: 'The monetary value of the event, in units of the specified currency parameter.',
|
|
180
|
-
default: {
|
|
181
|
-
'@path': '$.properties.total'
|
|
182
|
-
}
|
|
183
|
-
}
|
|
19
|
+
transaction_id: { ...ga4_properties_1.transaction_id, required: true },
|
|
20
|
+
shipping: { ...ga4_properties_1.shipping },
|
|
21
|
+
tax: { ...ga4_properties_1.tax },
|
|
22
|
+
value: { ...ga4_properties_1.value, default: { '@path': '$.properties.total' } }
|
|
184
23
|
},
|
|
185
24
|
perform: (request, { payload }) => {
|
|
186
25
|
if (!constants_1.CURRENCY_ISO_CODES.includes(payload.currency)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/purchase/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAG1E,4CAAiD;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/purchase/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAG1E,4CAAiD;AAEjD,sDAU0B;AAI1B,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,UAAU;IACjB,WAAW,EAAE,6CAA6C;IAC1D,mBAAmB,EAAE,8CAA8C;IACnE,MAAM,EAAE;QACN,SAAS,EAAE,EAAE,GAAG,0BAAS,EAAE;QAC3B,WAAW,EAAE,EAAE,GAAG,4BAAW,EAAE;QAC/B,MAAM,EAAE,EAAE,GAAG,uBAAM,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,qBAAqB,EAAE,EAAE;QAClE,QAAQ,EAAE,EAAE,GAAG,yBAAQ,EAAE,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M;YACd,IAAI,EAAE;gBACJ,SAAS,EAAE,OAAO,CAAC,SAAS;gBAC5B,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;yBACjB;qBACF;iBACF;aACF;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -2,165 +2,26 @@
|
|
|
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: 'Refund',
|
|
7
8
|
description: 'Send event when a refund is issued',
|
|
8
9
|
defaultSubscription: 'type = "track" and event = "Order Refunded"',
|
|
9
10
|
fields: {
|
|
10
|
-
client_id: {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
-
},
|
|
28
|
-
transaction_id: {
|
|
29
|
-
label: 'Transaction ID',
|
|
30
|
-
type: 'string',
|
|
31
|
-
required: true,
|
|
32
|
-
description: 'The unique identifier of a transaction.',
|
|
33
|
-
default: {
|
|
34
|
-
'@path': '$.properties.order_id'
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
value: {
|
|
38
|
-
label: 'Value',
|
|
39
|
-
type: 'number',
|
|
40
|
-
description: 'The monetary value of the event.'
|
|
41
|
-
},
|
|
42
|
-
affiliation: {
|
|
43
|
-
label: 'Affiliation',
|
|
44
|
-
type: 'string',
|
|
45
|
-
description: 'A product affiliation to designate a supplying company or brick and mortar store location.'
|
|
46
|
-
},
|
|
47
|
-
coupon: {
|
|
48
|
-
label: 'Coupon',
|
|
49
|
-
type: 'string',
|
|
50
|
-
description: 'Coupon code used for a purchase.'
|
|
51
|
-
},
|
|
52
|
-
shipping: {
|
|
53
|
-
label: 'Shipping',
|
|
54
|
-
type: 'number',
|
|
55
|
-
description: 'Shipping cost associated with a transaction.'
|
|
56
|
-
},
|
|
11
|
+
client_id: { ...ga4_properties_1.client_id },
|
|
12
|
+
currency: { ...ga4_properties_1.currency },
|
|
13
|
+
transaction_id: { ...ga4_properties_1.transaction_id, required: true },
|
|
14
|
+
value: { ...ga4_properties_1.value, default: { '@path': '$.properties.total' } },
|
|
15
|
+
affiliation: { ...ga4_properties_1.affiliation },
|
|
16
|
+
coupon: { ...ga4_properties_1.coupon },
|
|
17
|
+
shipping: { ...ga4_properties_1.shipping },
|
|
57
18
|
tax: {
|
|
58
19
|
label: 'Tax',
|
|
59
20
|
type: 'number',
|
|
60
21
|
description: 'Tax cost associated with a transaction.'
|
|
61
22
|
},
|
|
62
23
|
items: {
|
|
63
|
-
|
|
64
|
-
description: 'The list of products purchased.',
|
|
65
|
-
type: 'object',
|
|
66
|
-
multiple: true,
|
|
67
|
-
properties: {
|
|
68
|
-
item_id: {
|
|
69
|
-
label: 'Product ID',
|
|
70
|
-
type: 'string',
|
|
71
|
-
description: 'Identifier for the product being purchased.'
|
|
72
|
-
},
|
|
73
|
-
item_name: {
|
|
74
|
-
label: 'Name',
|
|
75
|
-
type: 'string',
|
|
76
|
-
description: 'Name of the product being purchased.'
|
|
77
|
-
},
|
|
78
|
-
affiliation: {
|
|
79
|
-
label: 'Affiliation',
|
|
80
|
-
type: 'string',
|
|
81
|
-
description: 'A product affiliation to designate a supplying company or brick and mortar store location.'
|
|
82
|
-
},
|
|
83
|
-
coupon: {
|
|
84
|
-
label: 'Coupon',
|
|
85
|
-
type: 'string',
|
|
86
|
-
description: 'Coupon code used for a purchase.'
|
|
87
|
-
},
|
|
88
|
-
currency: {
|
|
89
|
-
label: 'Currency',
|
|
90
|
-
type: 'string',
|
|
91
|
-
description: 'Currency of the purchase or items associated with the event, in 3-letter ISO 4217 format.'
|
|
92
|
-
},
|
|
93
|
-
discount: {
|
|
94
|
-
label: 'Discount',
|
|
95
|
-
type: 'number',
|
|
96
|
-
description: 'Monetary value of discount associated with a purchase.'
|
|
97
|
-
},
|
|
98
|
-
index: {
|
|
99
|
-
label: 'Index',
|
|
100
|
-
type: 'number',
|
|
101
|
-
description: 'The index/position of the item in a list.'
|
|
102
|
-
},
|
|
103
|
-
item_brand: {
|
|
104
|
-
label: 'Brand',
|
|
105
|
-
type: 'string',
|
|
106
|
-
description: 'Brand associated with the product.'
|
|
107
|
-
},
|
|
108
|
-
item_category: {
|
|
109
|
-
label: 'Category',
|
|
110
|
-
type: 'string',
|
|
111
|
-
description: 'Product category.'
|
|
112
|
-
},
|
|
113
|
-
item_category2: {
|
|
114
|
-
label: 'Category 2',
|
|
115
|
-
type: 'string',
|
|
116
|
-
description: 'Product category 2.'
|
|
117
|
-
},
|
|
118
|
-
item_category3: {
|
|
119
|
-
label: 'Category 3',
|
|
120
|
-
type: 'string',
|
|
121
|
-
description: 'Product category 3.'
|
|
122
|
-
},
|
|
123
|
-
item_category4: {
|
|
124
|
-
label: 'Category 4',
|
|
125
|
-
type: 'string',
|
|
126
|
-
description: 'Product category 4.'
|
|
127
|
-
},
|
|
128
|
-
item_category5: {
|
|
129
|
-
label: 'Category 5',
|
|
130
|
-
type: 'string',
|
|
131
|
-
description: 'Product category 5.'
|
|
132
|
-
},
|
|
133
|
-
item_list_id: {
|
|
134
|
-
label: 'Item List ID',
|
|
135
|
-
type: 'string',
|
|
136
|
-
description: 'The ID of the list in which the item was presented to the user.'
|
|
137
|
-
},
|
|
138
|
-
item_list_name: {
|
|
139
|
-
label: 'Item List Name',
|
|
140
|
-
type: 'string',
|
|
141
|
-
description: 'The name of the list in which the item was presented to the user.'
|
|
142
|
-
},
|
|
143
|
-
item_variant: {
|
|
144
|
-
label: 'Variant',
|
|
145
|
-
type: 'string',
|
|
146
|
-
description: 'Variant of the product (e.g. Black).'
|
|
147
|
-
},
|
|
148
|
-
location_id: {
|
|
149
|
-
label: 'Location ID',
|
|
150
|
-
type: 'string',
|
|
151
|
-
description: 'The location associated with the item.'
|
|
152
|
-
},
|
|
153
|
-
price: {
|
|
154
|
-
label: 'Price',
|
|
155
|
-
type: 'number',
|
|
156
|
-
description: 'Price of the product being purchased, in units of the specified currency parameter.'
|
|
157
|
-
},
|
|
158
|
-
quantity: {
|
|
159
|
-
label: 'Quantity',
|
|
160
|
-
type: 'integer',
|
|
161
|
-
description: 'Item quantity.'
|
|
162
|
-
}
|
|
163
|
-
}
|
|
24
|
+
...ga4_properties_1.items_multi_products
|
|
164
25
|
}
|
|
165
26
|
},
|
|
166
27
|
perform: (request, { payload }) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/refund/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAC1E,4CAAiD;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/refund/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAC1E,4CAAiD;AACjD,sDAS0B;AAK1B,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,QAAQ;IACf,WAAW,E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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: 'Remove from Cart',
|
|
7
8
|
description: 'Send event when a user removes items from a cart',
|
|
8
9
|
defaultSubscription: 'type = "track" and event = "Product Removed"',
|
|
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 purchase or items associated with the event, in 3-letter ISO 4217 format.'
|
|
27
|
-
},
|
|
28
|
-
value: {
|
|
29
|
-
label: 'Value',
|
|
30
|
-
type: 'number',
|
|
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/removeFromCart/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAC1E,4CAAiD;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/removeFromCart/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAC1E,4CAAiD;AACjD,sDAAqF;AAKrF,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,kBAAkB;IACzB,WAAW,EAAE,kDAAkD;IAC/D,mBAAmB,EAAE,8CAA8C;IACnE,MAAM,EAAE;QACN,SAAS,EAAE,EAAE,GAAG,0BAA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AC,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,kBAAkB;wBACxB,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"}
|
|
@@ -1,23 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const ga4_properties_1 = require("../ga4-properties");
|
|
3
4
|
const action = {
|
|
4
5
|
title: 'Search',
|
|
5
6
|
description: 'Send event when a user searches your content',
|
|
6
7
|
defaultSubscription: 'type = "track" and event = "Products Searched"',
|
|
7
8
|
fields: {
|
|
8
|
-
client_id: {
|
|
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
|
+
client_id: { ...ga4_properties_1.client_id },
|
|
21
10
|
search_term: {
|
|
22
11
|
label: 'Search Term',
|
|
23
12
|
type: 'string',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/search/index.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/search/index.ts"],"names":[],"mappings":";;AAGA,sDAA6C;AAE7C,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,QAAQ;IACf,WAAW,EAAE,8CAA8C;IAC3D,mBAAmB,EAAE,gDAAgD;IACrE,MAAM,EAAE;QACN,SAAS,EAAE,EAAE,GAAG,0BAAS,EAAE;QAC3B,WAAW,EAAE;YACX,KAAK,EAAE,aAAa;YACpB,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,iCAAiC;YAC9C,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,oBAAoB;aAC9B;SACF;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,SAAS;gBAC5B,MAAM,EAAE;oBACN;wBACE,IAAI,EAAE,QAAQ;wBACd,MAAM,EAAE;4BACN,WAAW,EAAE,OAAO,CAAC,WAAW;yBACjC;qBACF;iBACF;aACF;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|