@segment/action-destinations 3.30.2-alpha.6 → 3.31.1-alpha.2

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.
Files changed (73) hide show
  1. package/dist/destinations/amplitude/generated-types.d.ts +1 -0
  2. package/dist/destinations/amplitude/groupIdentifyUser/index.js +5 -4
  3. package/dist/destinations/amplitude/groupIdentifyUser/index.js.map +1 -1
  4. package/dist/destinations/amplitude/identifyUser/index.js +15 -14
  5. package/dist/destinations/amplitude/identifyUser/index.js.map +1 -1
  6. package/dist/destinations/amplitude/index.js +21 -2
  7. package/dist/destinations/amplitude/index.js.map +1 -1
  8. package/dist/destinations/amplitude/logEvent/index.js +2 -3
  9. package/dist/destinations/amplitude/logEvent/index.js.map +1 -1
  10. package/dist/destinations/amplitude/mapUser/index.js +5 -4
  11. package/dist/destinations/amplitude/mapUser/index.js.map +1 -1
  12. package/dist/destinations/amplitude/regional-endpoints.d.ts +32 -0
  13. package/dist/destinations/amplitude/regional-endpoints.js +39 -0
  14. package/dist/destinations/amplitude/regional-endpoints.js.map +1 -0
  15. package/dist/destinations/facebook-conversions-api/custom/generated-types.d.ts +2 -2
  16. package/dist/destinations/facebook-conversions-api/custom/index.js +4 -5
  17. package/dist/destinations/facebook-conversions-api/custom/index.js.map +1 -1
  18. package/dist/destinations/facebook-conversions-api/viewContent/generated-types.d.ts +5 -5
  19. package/dist/destinations/facebook-conversions-api/viewContent/index.js +5 -5
  20. package/dist/destinations/facebook-conversions-api/viewContent/index.js.map +1 -1
  21. package/dist/destinations/google-analytics-4/addPaymentInfo/generated-types.d.ts +1 -1
  22. package/dist/destinations/google-analytics-4/addPaymentInfo/index.js +8 -138
  23. package/dist/destinations/google-analytics-4/addPaymentInfo/index.js.map +1 -1
  24. package/dist/destinations/google-analytics-4/addToCart/generated-types.d.ts +1 -1
  25. package/dist/destinations/google-analytics-4/addToCart/index.js +6 -127
  26. package/dist/destinations/google-analytics-4/addToCart/index.js.map +1 -1
  27. package/dist/destinations/google-analytics-4/addToWishlist/generated-types.d.ts +1 -1
  28. package/dist/destinations/google-analytics-4/addToWishlist/index.js +6 -125
  29. package/dist/destinations/google-analytics-4/addToWishlist/index.js.map +1 -1
  30. package/dist/destinations/google-analytics-4/beginCheckout/generated-types.d.ts +1 -1
  31. package/dist/destinations/google-analytics-4/beginCheckout/index.js +7 -138
  32. package/dist/destinations/google-analytics-4/beginCheckout/index.js.map +1 -1
  33. package/dist/destinations/google-analytics-4/customEvent/index.js +2 -13
  34. package/dist/destinations/google-analytics-4/customEvent/index.js.map +1 -1
  35. package/dist/destinations/google-analytics-4/ga4-properties.d.ts +17 -0
  36. package/dist/destinations/google-analytics-4/ga4-properties.js +276 -0
  37. package/dist/destinations/google-analytics-4/ga4-properties.js.map +1 -0
  38. package/dist/destinations/google-analytics-4/generateLead/index.js +4 -23
  39. package/dist/destinations/google-analytics-4/generateLead/index.js.map +1 -1
  40. package/dist/destinations/google-analytics-4/login/index.js +2 -13
  41. package/dist/destinations/google-analytics-4/login/index.js.map +1 -1
  42. package/dist/destinations/google-analytics-4/pageView/index.js +2 -13
  43. package/dist/destinations/google-analytics-4/pageView/index.js.map +1 -1
  44. package/dist/destinations/google-analytics-4/purchase/generated-types.d.ts +1 -1
  45. package/dist/destinations/google-analytics-4/purchase/index.js +11 -172
  46. package/dist/destinations/google-analytics-4/purchase/index.js.map +1 -1
  47. package/dist/destinations/google-analytics-4/refund/index.js +9 -148
  48. package/dist/destinations/google-analytics-4/refund/index.js.map +1 -1
  49. package/dist/destinations/google-analytics-4/removeFromCart/index.js +6 -125
  50. package/dist/destinations/google-analytics-4/removeFromCart/index.js.map +1 -1
  51. package/dist/destinations/google-analytics-4/search/index.js +2 -13
  52. package/dist/destinations/google-analytics-4/search/index.js.map +1 -1
  53. package/dist/destinations/google-analytics-4/selectItem/generated-types.d.ts +1 -1
  54. package/dist/destinations/google-analytics-4/selectItem/index.js +4 -114
  55. package/dist/destinations/google-analytics-4/selectItem/index.js.map +1 -1
  56. package/dist/destinations/google-analytics-4/selectPromotion/generated-types.d.ts +4 -4
  57. package/dist/destinations/google-analytics-4/selectPromotion/index.js +13 -145
  58. package/dist/destinations/google-analytics-4/selectPromotion/index.js.map +1 -1
  59. package/dist/destinations/google-analytics-4/signUp/index.js +2 -13
  60. package/dist/destinations/google-analytics-4/signUp/index.js.map +1 -1
  61. package/dist/destinations/google-analytics-4/viewCart/index.js +6 -125
  62. package/dist/destinations/google-analytics-4/viewCart/index.js.map +1 -1
  63. package/dist/destinations/google-analytics-4/viewItem/generated-types.d.ts +1 -1
  64. package/dist/destinations/google-analytics-4/viewItem/index.js +6 -130
  65. package/dist/destinations/google-analytics-4/viewItem/index.js.map +1 -1
  66. package/dist/destinations/google-analytics-4/viewItemList/index.js +4 -115
  67. package/dist/destinations/google-analytics-4/viewItemList/index.js.map +1 -1
  68. package/dist/destinations/google-analytics-4/viewPromotion/generated-types.d.ts +4 -4
  69. package/dist/destinations/google-analytics-4/viewPromotion/index.js +13 -154
  70. package/dist/destinations/google-analytics-4/viewPromotion/index.js.map +1 -1
  71. package/dist/destinations/slack/postToChannel/index.js +5 -5
  72. package/dist/destinations/slack/postToChannel/index.js.map +1 -1
  73. package/package.json +3 -3
@@ -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
- label: 'Client ID',
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
- 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
- label: 'Products',
41
- description: 'The list of products in the event.',
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;AAKjD,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,gBAAgB;IACvB,WAAW,EAAE,wCAAwC;IACrD,mBAAmB,EAAE,+CAA+C;IACpE,MAAM,EAAE;QACN,SAAS,EAAE;YACT,KAAK,EAAE,WAAW;YAClB,WAAW,EAAE,sDAAsD;YACnE,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,KAAK,EAAE;oBACL,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;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AE,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;yBACrB;qBACF;iBACF;aACF;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
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,CAAC,QAAQ,CAAC,EAAE;YACtE,MAAM,IAAI,+BAAgB,CAAC,GAAG,OAAO,CAAC,QAAQ,gCAAgC,EAAE,wBAAwB,EAAE,GAAG,CAAC,CAAA;SAC/G;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,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,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;yBACrB;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: '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.',
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/customEvent/index.ts"],"names":[],"mappings":";;AAIA,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,cAAc;IACrB,WAAW,EAAE,uBAAuB;IACpC,mBAAmB,EAAE,gBAAgB;IACrC,MAAM,EAAE;QACN,QAAQ,EAAE;YACR,KAAK,EAAE,WAAW;YAClB,WAAW,EAAE,sDAAsD;YACnE,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,KAAK,EAAE;oBACL,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;oBAC/B,IAAI,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;oBAC7B,IAAI,EAAE,EAAE,OAAO,EAAE,eAAe,EAAE;iBACnC;aACF;SACF;QACD,IAAI,EAAE;YACJ,KAAK,EAAE,YAAY;YACnB,WAAW,EAAE,qDAAqD;YAClE,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;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"}
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;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;
@@ -0,0 +1,276 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.items_multi_products = exports.items_single_products = exports.minimal_items = exports.payment_type = exports.coupon = exports.value = exports.currency = exports.client_id = exports.affiliation = exports.transaction_id = exports.shipping = exports.tax = exports.creative_name = exports.creative_slot = exports.promotion_name = exports.promotion_id = void 0;
4
+ exports.promotion_id = {
5
+ label: 'Promotion ID',
6
+ type: 'string',
7
+ description: 'The ID of the promotion associated with the event.'
8
+ };
9
+ exports.promotion_name = {
10
+ label: 'Promotion Name',
11
+ type: 'string',
12
+ description: 'The name of the promotion associated with the event.'
13
+ };
14
+ exports.creative_slot = {
15
+ label: 'Creative Slot',
16
+ type: 'string',
17
+ description: 'The name of the promotional creative slot associated with the event.'
18
+ };
19
+ exports.creative_name = {
20
+ label: 'Creative Name',
21
+ type: 'string',
22
+ description: 'The name of the promotional creative.'
23
+ };
24
+ exports.tax = {
25
+ label: 'Tax',
26
+ type: 'number',
27
+ description: 'Total tax associated with the transaction.',
28
+ default: {
29
+ '@path': '$.properties.tax'
30
+ }
31
+ };
32
+ exports.shipping = {
33
+ label: 'Shipping',
34
+ type: 'number',
35
+ description: 'Shipping cost associated with the transaction.',
36
+ default: {
37
+ '@path': '$.properties.shipping'
38
+ }
39
+ };
40
+ exports.transaction_id = {
41
+ label: 'Order Id',
42
+ type: 'string',
43
+ description: 'The unique identifier of a transaction.',
44
+ default: {
45
+ '@path': '$.properties.order_id'
46
+ }
47
+ };
48
+ exports.affiliation = {
49
+ label: 'Affiliation',
50
+ type: 'string',
51
+ description: 'Store or affiliation from which this transaction occurred (e.g. Google Store).',
52
+ default: {
53
+ '@path': '$.properties.affiliation'
54
+ }
55
+ };
56
+ exports.client_id = {
57
+ label: 'Client ID',
58
+ description: 'Uniquely identifies a user instance of a web client.',
59
+ type: 'string',
60
+ required: true,
61
+ default: {
62
+ '@if': {
63
+ exists: { '@path': '$.userId' },
64
+ then: { '@path': '$.userId' },
65
+ else: { '@path': '$.anonymousId' }
66
+ }
67
+ }
68
+ };
69
+ exports.currency = {
70
+ label: 'Currency',
71
+ type: 'string',
72
+ description: 'Currency of the items associated with the event, in 3-letter ISO 4217 format.',
73
+ default: { '@path': '$.properties.currency' }
74
+ };
75
+ exports.value = {
76
+ label: 'Value',
77
+ type: 'number',
78
+ description: 'The monetary value of the event.',
79
+ default: {
80
+ '@path': '$.properties.value'
81
+ }
82
+ };
83
+ exports.coupon = {
84
+ label: 'Coupon',
85
+ type: 'string',
86
+ description: 'Coupon code used for a purchase.'
87
+ };
88
+ exports.payment_type = {
89
+ label: 'Payment Type',
90
+ type: 'string',
91
+ description: 'The chosen method of payment.',
92
+ default: {
93
+ '@path': '$.properties.payment_method'
94
+ }
95
+ };
96
+ exports.minimal_items = {
97
+ label: 'Products',
98
+ description: 'The list of products purchased.',
99
+ type: 'object',
100
+ multiple: true,
101
+ properties: {
102
+ item_id: {
103
+ label: 'Product ID',
104
+ type: 'string',
105
+ description: 'Identifier for the product being purchased.'
106
+ },
107
+ item_name: {
108
+ label: 'Name',
109
+ type: 'string',
110
+ description: 'Name of the product being purchased.'
111
+ },
112
+ affiliation: {
113
+ label: 'Affiliation',
114
+ type: 'string',
115
+ description: 'A product affiliation to designate a supplying company or brick and mortar store location.'
116
+ },
117
+ coupon: {
118
+ label: 'Coupon',
119
+ type: 'string',
120
+ description: 'Coupon code used for a purchase.'
121
+ },
122
+ currency: {
123
+ label: 'Currency',
124
+ type: 'string',
125
+ description: 'Currency of the purchase or items associated with the event, in 3-letter ISO 4217 format.'
126
+ },
127
+ discount: {
128
+ label: 'Discount',
129
+ type: 'number',
130
+ description: 'Monetary value of discount associated with a purchase.'
131
+ },
132
+ index: {
133
+ label: 'Index',
134
+ type: 'number',
135
+ description: 'The index/position of the item in a list.'
136
+ },
137
+ item_brand: {
138
+ label: 'Brand',
139
+ type: 'string',
140
+ description: 'Brand associated with the product.'
141
+ },
142
+ item_category: {
143
+ label: 'Category',
144
+ type: 'string',
145
+ description: 'Product category.'
146
+ },
147
+ item_category2: {
148
+ label: 'Category 2',
149
+ type: 'string',
150
+ description: 'Product category 2.'
151
+ },
152
+ item_category3: {
153
+ label: 'Category 3',
154
+ type: 'string',
155
+ description: 'Product category 3.'
156
+ },
157
+ item_category4: {
158
+ label: 'Category 4',
159
+ type: 'string',
160
+ description: 'Product category 4.'
161
+ },
162
+ item_category5: {
163
+ label: 'Category 5',
164
+ type: 'string',
165
+ description: 'Product category 5.'
166
+ },
167
+ item_list_id: {
168
+ label: 'Item List ID',
169
+ type: 'string',
170
+ description: 'The ID of the list in which the item was presented to the user.'
171
+ },
172
+ item_list_name: {
173
+ label: 'Item List Name',
174
+ type: 'string',
175
+ description: 'The name of the list in which the item was presented to the user.'
176
+ },
177
+ item_variant: {
178
+ label: 'Variant',
179
+ type: 'string',
180
+ description: 'Variant of the product (e.g. Black).'
181
+ },
182
+ location_id: {
183
+ label: 'Location ID',
184
+ type: 'string',
185
+ description: 'The location associated with the item.'
186
+ },
187
+ price: {
188
+ label: 'Price',
189
+ type: 'number',
190
+ description: 'Price of the product being purchased, in units of the specified currency parameter.'
191
+ },
192
+ quantity: {
193
+ label: 'Quantity',
194
+ type: 'integer',
195
+ description: 'Item quantity.'
196
+ }
197
+ }
198
+ };
199
+ exports.items_single_products = {
200
+ ...exports.minimal_items,
201
+ default: {
202
+ '@arrayPath': [
203
+ '$.properties',
204
+ {
205
+ item_id: {
206
+ '@path': '$.product_id'
207
+ },
208
+ item_name: {
209
+ '@path': '$.name'
210
+ },
211
+ affiliation: {
212
+ '@path': '$.affiliation'
213
+ },
214
+ coupon: {
215
+ '@path': '$.coupon'
216
+ },
217
+ item_brand: {
218
+ '@path': '$.brand'
219
+ },
220
+ item_category: {
221
+ '@path': '$.category'
222
+ },
223
+ item_variant: {
224
+ '@path': '$.variant'
225
+ },
226
+ price: {
227
+ '@path': '$.price'
228
+ },
229
+ quantity: {
230
+ '@path': '$.quantity'
231
+ }
232
+ }
233
+ ]
234
+ }
235
+ };
236
+ exports.items_multi_products = {
237
+ ...exports.minimal_items,
238
+ default: {
239
+ '@arrayPath': [
240
+ '$.properties.products',
241
+ {
242
+ item_id: {
243
+ '@path': '$.product_id'
244
+ },
245
+ item_name: {
246
+ '@path': '$.name'
247
+ },
248
+ affiliation: {
249
+ '@path': '$.affiliation'
250
+ },
251
+ coupon: {
252
+ '@path': '$.coupon'
253
+ },
254
+ index: {
255
+ '@path': '$.position'
256
+ },
257
+ item_brand: {
258
+ '@path': '$.brand'
259
+ },
260
+ item_category: {
261
+ '@path': '$.category'
262
+ },
263
+ item_variant: {
264
+ '@path': '$.variant'
265
+ },
266
+ price: {
267
+ '@path': '$.price'
268
+ },
269
+ quantity: {
270
+ '@path': '$.quantity'
271
+ }
272
+ }
273
+ ]
274
+ }
275
+ };
276
+ //# sourceMappingURL=ga4-properties.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ga4-properties.js","sourceRoot":"","sources":["../../../src/destinations/google-analytics-4/ga4-properties.ts"],"names":[],"mappings":";;;AAEa,QAAA,YAAY,GAAe;IACtC,KAAK,EAAE,cAAc;IACrB,IAAI,EAAE,QAAQ;IACd,WAAW,EAAE,oDAAoD;CAClE,CAAA;AAEY,QAAA,cAAc,GAAe;IACxC,KAAK,EAAE,gBAAgB;IACvB,IAAI,EAAE,QAAQ;IACd,WAAW,EAAE,sDAAsD;CACpE,CAAA;AAEY,QAAA,aAAa,GAAe;IACvC,KAAK,EAAE,eAAe;IACtB,IAAI,EAAE,QAAQ;IACd,WAAW,EAAE,sEAAsE;CACpF,CAAA;AAEY,QAAA,aAAa,GAAe;IACvC,KAAK,EAAE,eAAe;I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AE;YACZ,cAAc;YACd;gBACE,OAAO,EAAE;oBACP,OAAO,EAAE,cAAc;iBACxB;gBACD,SAAS,EAAE;oBACT,OAAO,EAAE,QAAQ;iBAClB;gBACD,WAAW,EAAE;oBACX,OAAO,EAAE,eAAe;iBACzB;gBACD,MAAM,EAAE;oBACN,OAAO,EAAE,UAAU;iBACpB;gBACD,UAAU,EAAE;oBACV,OAAO,EAAE,SAAS;iBACnB;gBACD,aAAa,EAAE;oBACb,OAAO,EAAE,YAAY;iBACtB;gBACD,YAAY,EAAE;oBACZ,OAAO,EAAE,WAAW;iBACrB;gBACD,KAAK,EAAE;oBACL,OAAO,EAAE,SAAS;iBACnB;gBACD,QAAQ,EAAE;oBACR,OAAO,EAAE,YAAY;iBACtB;aACF;SACF;KACF;CACF,CAAA;AACY,QAAA,oBAAoB,GAAe;IAC9C,GAAG,qBAAa;IAChB,OAAO,EAAE;QACP,YAAY,EAAE;YACZ,uBAAuB;YACvB;gBACE,OAAO,EAAE;oBACP,OAAO,EAAE,cAAc;iBACxB;gBACD,SAAS,EAAE;oBACT,OAAO,EAAE,QAAQ;iBAClB;gBACD,WAAW,EAAE;oBACX,OAAO,EAAE,eAAe;iBACzB;gBACD,MAAM,EAAE;oBACN,OAAO,EAAE,UAAU;iBACpB;gBACD,KAAK,EAAE;oBACL,OAAO,EAAE,YAAY;iBACtB;gBACD,UAAU,EAAE;oBACV,OAAO,EAAE,SAAS;iBACnB;gBACD,aAAa,EAAE;oBACb,OAAO,EAAE,YAAY;iBACtB;gBACD,YAAY,EAAE;oBACZ,OAAO,EAAE,WAAW;iBACrB;gBACD,KAAK,EAAE;oBACL,OAAO,EAAE,SAAS;iBACnB;gBACD,QAAQ,EAAE;oBACR,OAAO,EAAE,YAAY;iBACtB;aACF;SACF;KACF;CACF,CAAA"}
@@ -2,34 +2,15 @@
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: 'Generate Lead',
7
8
  description: 'Send event when a user submits a form or request for information',
8
9
  defaultSubscription: 'type = "track"',
9
10
  fields: {
10
- client_id: {
11
- label: 'Client ID',
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 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
  },
34
15
  perform: (request, { payload }) => {
35
16
  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/generateLead/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAC1E,4CAAiD;AAIjD,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,eAAe;IACtB,WAAW,EAAE,kEAAkE;IAC/E,mBAAmB,EAAE,gBAAgB;IACrC,MAAM,EAAE;QACN,SAAS,EAAE;YACT,KAAK,EAAE,WAAW;YAClB,WAAW,EAAE,sDAAsD;YACnE,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,KAAK,EAAE;oBACL,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;oBAC/B,IAAI,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;oBAC7B,IAAI,EAAE,EAAE,OAAO,EAAE,eAAe,EAAE;iBACnC;aACF;SACF;QACD,QAAQ,EAAE;YACR,KAAK,EAAE,UAAU;YACjB,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,+EAA+E;SAC7F;QACD,KAAK,EAAE;YACL,KAAK,EAAE,OAAO;YACd,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,kCAAkC;SAChD;KACF;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;QAChC,IAAI,OAAO,CAAC,QAAQ,IAAI,CAAC,8BAAkB,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;YACtE,MAAM,IAAI,+BAAgB,CAAC,GAAG,OAAO,CAAC,QAAQ,gCAAgC,EAAE,wBAAwB,EAAE,GAAG,CAAC,CAAA;SAC/G;QAGD,IAAI,OAAO,CAAC,KAAK,IAAI,OAAO,CAAC,QAAQ,KAAK,SAAS,EAAE;YACnD,MAAM,IAAI,+BAAgB,CAAC,uCAAuC,EAAE,8BAA8B,EAAE,GAAG,CAAC,CAAA;SACzG;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,eAAe;wBACrB,MAAM,EAAE;4BACN,QAAQ,EAAE,OAAO,CAAC,QAAQ;4BAC1B,KAAK,EAAE,OAAO,CAAC,KAAK;yBACrB;qBACF;iBACF;aACF;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/generateLead/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAC1E,4CAAiD;AAGjD,sDAA8D;AAE9D,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,eAAe;IACtB,WAAW,EAAE,kEAAkE;IAC/E,mBAAmB,EAAE,gBAAgB;IACrC,MAAM,EAAE;QACN,SAAS,EAAE,EAAE,GAAG,0BAAS,EAAE;QAC3B,QAAQ,EAAE,EAAE,GAAG,yBAAQ,EAAE;QACzB,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,CAAC,QAAQ,CAAC,EAAE;YACtE,MAAM,IAAI,+BAAgB,CAAC,GAAG,OAAO,CAAC,QAAQ,gCAAgC,EAAE,wBAAwB,EAAE,GAAG,CAAC,CAAA;SAC/G;QAGD,IAAI,OAAO,CAAC,KAAK,IAAI,OAAO,CAAC,QAAQ,KAAK,SAAS,EAAE;YACnD,MAAM,IAAI,+BAAgB,CAAC,uCAAuC,EAAE,8BAA8B,EAAE,GAAG,CAAC,CAAA;SACzG;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,eAAe;wBACrB,MAAM,EAAE;4BACN,QAAQ,EAAE,OAAO,CAAC,QAAQ;4BAC1B,KAAK,EAAE,OAAO,CAAC,KAAK;yBACrB;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: 'Login',
5
6
  description: 'Send event when a user logs in',
6
7
  defaultSubscription: 'type = "track" and event = "Signed In"',
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
  method: {
22
11
  label: 'Method',
23
12
  type: 'string',
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/login/index.ts"],"names":[],"mappings":";;AAIA,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,OAAO;IACd,WAAW,EAAE,gCAAgC;IAC7C,mBAAmB,EAAE,wCAAwC;IAC7D,MAAM,EAAE;QACN,SAAS,EAAE;YACT,KAAK,EAAE,WAAW;YAClB,WAAW,EAAE,sDAAsD;YACnE,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,KAAK,EAAE;oBACL,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;oBAC/B,IAAI,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;oBAC7B,IAAI,EAAE,EAAE,OAAO,EAAE,eAAe,EAAE;iBACnC;aACF;SACF;QACD,MAAM,EAAE;YACN,KAAK,EAAE,QAAQ;YACf,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,2BAA2B;SACzC;KACF;IAED,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,OAAO;wBACb,MAAM,EAAE;4BACN,MAAM,EAAE,OAAO,CAAC,MAAM;yBACvB;qBACF;iBACF;aACF;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/login/index.ts"],"names":[],"mappings":";;AAGA,sDAA6C;AAE7C,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,OAAO;IACd,WAAW,EAAE,gCAAgC;IAC7C,mBAAmB,EAAE,wCAAwC;IAC7D,MAAM,EAAE;QACN,SAAS,EAAE,EAAE,GAAG,0BAAS,EAAE;QAC3B,MAAM,EAAE;YACN,KAAK,EAAE,QAAQ;YACf,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,2BAA2B;SACzC;KACF;IAED,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,OAAO;wBACb,MAAM,EAAE;4BACN,MAAM,EAAE,OAAO,CAAC,MAAM;yBACvB;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: 'Page View',
5
6
  description: 'Send page view when a user views a page',
6
7
  defaultSubscription: 'type = "page"',
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
  page_location: {
22
11
  label: 'Page Location',
23
12
  type: 'string',
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/pageView/index.ts"],"names":[],"mappings":";;AAIA,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,WAAW;IAClB,WAAW,EAAE,yCAAyC;IACtD,mBAAmB,EAAE,eAAe;IACpC,MAAM,EAAE;QACN,QAAQ,EAAE;YACR,KAAK,EAAE,WAAW;YAClB,WAAW,EAAE,sDAAsD;YACnE,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,KAAK,EAAE;oBACL,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;oBAC/B,IAAI,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;oBAC7B,IAAI,EAAE,EAAE,OAAO,EAAE,eAAe,EAAE;iBACnC;aACF;SACF;QACD,aAAa,EAAE;YACb,KAAK,EAAE,eAAe;YACtB,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,sBAAsB;YACnC,OAAO,EAAE;gBACP,OAAO,EAAE,oBAAoB;aAC9B;SACF;QACD,aAAa,EAAE;YACb,KAAK,EAAE,eAAe;YACtB,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,mBAAmB;YAChC,OAAO,EAAE;gBACP,OAAO,EAAE,yBAAyB;aACnC;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,QAAQ;gBAC3B,MAAM,EAAE;oBACN;wBACE,IAAI,EAAE,WAAW;wBACjB,MAAM,EAAE;4BACN,aAAa,EAAE,OAAO,CAAC,aAAa;4BACpC,aAAa,EAAE,OAAO,CAAC,aAAa;yBACrC;qBACF;iBACF;aACF;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/pageView/index.ts"],"names":[],"mappings":";;AAGA,sDAA6C;AAE7C,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,WAAW;IAClB,WAAW,EAAE,yCAAyC;IACtD,mBAAmB,EAAE,eAAe;IACpC,MAAM,EAAE;QACN,QAAQ,EAAE,EAAE,GAAG,0BAAS,EAAE;QAC1B,aAAa,EAAE;YACb,KAAK,EAAE,eAAe;YACtB,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,sBAAsB;YACnC,OAAO,EAAE;gBACP,OAAO,EAAE,oBAAoB;aAC9B;SACF;QACD,aAAa,EAAE;YACb,KAAK,EAAE,eAAe;YACtB,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,mBAAmB;YAChC,OAAO,EAAE;gBACP,OAAO,EAAE,yBAAyB;aACnC;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,QAAQ;gBAC3B,MAAM,EAAE;oBACN;wBACE,IAAI,EAAE,WAAW;wBACjB,MAAM,EAAE;4BACN,aAAa,EAAE,OAAO,CAAC,aAAa;4BACpC,aAAa,EAAE,OAAO,CAAC,aAAa;yBACrC;qBACF;iBACF;aACF;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
@@ -3,7 +3,7 @@ export interface Payload {
3
3
  affiliation?: string;
4
4
  coupon?: string;
5
5
  currency: string;
6
- items?: {
6
+ items: {
7
7
  item_id?: string;
8
8
  item_name?: string;
9
9
  affiliation?: string;