@walkeros/web-destination-meta 2.0.0 → 2.1.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.
@@ -1,5 +1,5 @@
1
- import { Mapping as Mapping$1 } from '@walkeros/core';
2
1
  import { DestinationWeb } from '@walkeros/web-core';
2
+ import { Flow } from '@walkeros/core';
3
3
 
4
4
  declare global {
5
5
  interface Window {
@@ -7,10 +7,6 @@ declare global {
7
7
  fbq?: facebook.Pixel.Event;
8
8
  }
9
9
  }
10
- interface Mapping {
11
- track?: StandardEventNames;
12
- trackCustom?: string;
13
- }
14
10
  interface Env extends DestinationWeb.Env {
15
11
  window: {
16
12
  fbq: facebook.Pixel.Event;
@@ -23,8 +19,6 @@ interface Env extends DestinationWeb.Env {
23
19
  };
24
20
  };
25
21
  }
26
- type Rule = Mapping$1.Rule<Mapping>;
27
- type StandardEventNames = 'PageView' | 'AddPaymentInfo' | 'AddToCart' | 'AddToWishlist' | 'CompleteRegistration' | 'Contact' | 'CustomizeProduct' | 'Donate' | 'FindLocation' | 'InitiateCheckout' | 'Lead' | 'Purchase' | 'Schedule' | 'Search' | 'StartTrial' | 'SubmitApplication' | 'Subscribe' | 'ViewContent' | string;
28
22
 
29
23
  declare const init: Env | undefined;
30
24
  declare const push: Env;
@@ -35,39 +29,19 @@ declare namespace env {
35
29
  export { env_init as init, env_push as push };
36
30
  }
37
31
 
38
- declare function Purchase$1(): unknown[];
39
- declare function AddToCart$1(): unknown[];
40
- declare function InitiateCheckout$1(): unknown[];
41
- declare function ViewContent$1(): unknown[];
42
-
43
- declare namespace events {
44
- export { AddToCart$1 as AddToCart, InitiateCheckout$1 as InitiateCheckout, Purchase$1 as Purchase, ViewContent$1 as ViewContent };
45
- }
46
-
47
- declare const Purchase: Rule;
48
- declare const AddToCart: Rule;
49
- declare const InitiateCheckout: Rule;
50
- declare const ViewContent: Rule;
51
- declare const config: {
52
- order: {
53
- complete: Rule;
54
- };
55
- product: {
56
- view: Rule;
57
- add: Rule;
58
- };
59
- cart: {
60
- view: Rule;
61
- };
62
- };
63
-
64
- declare const mapping_AddToCart: typeof AddToCart;
65
- declare const mapping_InitiateCheckout: typeof InitiateCheckout;
66
- declare const mapping_Purchase: typeof Purchase;
67
- declare const mapping_ViewContent: typeof ViewContent;
68
- declare const mapping_config: typeof config;
69
- declare namespace mapping {
70
- export { mapping_AddToCart as AddToCart, mapping_InitiateCheckout as InitiateCheckout, mapping_Purchase as Purchase, mapping_ViewContent as ViewContent, mapping_config as config };
32
+ declare const purchase: Flow.StepExample;
33
+ declare const addToCart: Flow.StepExample;
34
+ declare const viewContent: Flow.StepExample;
35
+ declare const initiateCheckout: Flow.StepExample;
36
+ declare const pageView: Flow.StepExample;
37
+
38
+ declare const step_addToCart: typeof addToCart;
39
+ declare const step_initiateCheckout: typeof initiateCheckout;
40
+ declare const step_pageView: typeof pageView;
41
+ declare const step_purchase: typeof purchase;
42
+ declare const step_viewContent: typeof viewContent;
43
+ declare namespace step {
44
+ export { step_addToCart as addToCart, step_initiateCheckout as initiateCheckout, step_pageView as pageView, step_purchase as purchase, step_viewContent as viewContent };
71
45
  }
72
46
 
73
- export { env, events, mapping };
47
+ export { env, step };
@@ -1,5 +1,5 @@
1
- import { Mapping as Mapping$1 } from '@walkeros/core';
2
1
  import { DestinationWeb } from '@walkeros/web-core';
2
+ import { Flow } from '@walkeros/core';
3
3
 
4
4
  declare global {
5
5
  interface Window {
@@ -7,10 +7,6 @@ declare global {
7
7
  fbq?: facebook.Pixel.Event;
8
8
  }
9
9
  }
10
- interface Mapping {
11
- track?: StandardEventNames;
12
- trackCustom?: string;
13
- }
14
10
  interface Env extends DestinationWeb.Env {
15
11
  window: {
16
12
  fbq: facebook.Pixel.Event;
@@ -23,8 +19,6 @@ interface Env extends DestinationWeb.Env {
23
19
  };
24
20
  };
25
21
  }
26
- type Rule = Mapping$1.Rule<Mapping>;
27
- type StandardEventNames = 'PageView' | 'AddPaymentInfo' | 'AddToCart' | 'AddToWishlist' | 'CompleteRegistration' | 'Contact' | 'CustomizeProduct' | 'Donate' | 'FindLocation' | 'InitiateCheckout' | 'Lead' | 'Purchase' | 'Schedule' | 'Search' | 'StartTrial' | 'SubmitApplication' | 'Subscribe' | 'ViewContent' | string;
28
22
 
29
23
  declare const init: Env | undefined;
30
24
  declare const push: Env;
@@ -35,39 +29,19 @@ declare namespace env {
35
29
  export { env_init as init, env_push as push };
36
30
  }
37
31
 
38
- declare function Purchase$1(): unknown[];
39
- declare function AddToCart$1(): unknown[];
40
- declare function InitiateCheckout$1(): unknown[];
41
- declare function ViewContent$1(): unknown[];
42
-
43
- declare namespace events {
44
- export { AddToCart$1 as AddToCart, InitiateCheckout$1 as InitiateCheckout, Purchase$1 as Purchase, ViewContent$1 as ViewContent };
45
- }
46
-
47
- declare const Purchase: Rule;
48
- declare const AddToCart: Rule;
49
- declare const InitiateCheckout: Rule;
50
- declare const ViewContent: Rule;
51
- declare const config: {
52
- order: {
53
- complete: Rule;
54
- };
55
- product: {
56
- view: Rule;
57
- add: Rule;
58
- };
59
- cart: {
60
- view: Rule;
61
- };
62
- };
63
-
64
- declare const mapping_AddToCart: typeof AddToCart;
65
- declare const mapping_InitiateCheckout: typeof InitiateCheckout;
66
- declare const mapping_Purchase: typeof Purchase;
67
- declare const mapping_ViewContent: typeof ViewContent;
68
- declare const mapping_config: typeof config;
69
- declare namespace mapping {
70
- export { mapping_AddToCart as AddToCart, mapping_InitiateCheckout as InitiateCheckout, mapping_Purchase as Purchase, mapping_ViewContent as ViewContent, mapping_config as config };
32
+ declare const purchase: Flow.StepExample;
33
+ declare const addToCart: Flow.StepExample;
34
+ declare const viewContent: Flow.StepExample;
35
+ declare const initiateCheckout: Flow.StepExample;
36
+ declare const pageView: Flow.StepExample;
37
+
38
+ declare const step_addToCart: typeof addToCart;
39
+ declare const step_initiateCheckout: typeof initiateCheckout;
40
+ declare const step_pageView: typeof pageView;
41
+ declare const step_purchase: typeof purchase;
42
+ declare const step_viewContent: typeof viewContent;
43
+ declare namespace step {
44
+ export { step_addToCart as addToCart, step_initiateCheckout as initiateCheckout, step_pageView as pageView, step_purchase as purchase, step_viewContent as viewContent };
71
45
  }
72
46
 
73
- export { env, events, mapping };
47
+ export { env, step };
@@ -21,8 +21,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
21
21
  var examples_exports = {};
22
22
  __export(examples_exports, {
23
23
  env: () => env_exports,
24
- events: () => events_exports,
25
- mapping: () => mapping_exports
24
+ step: () => step_exports
26
25
  });
27
26
  module.exports = __toCommonJS(examples_exports);
28
27
 
@@ -86,223 +85,213 @@ var push = {
86
85
  }
87
86
  };
88
87
 
89
- // src/examples/events.ts
90
- var events_exports = {};
91
- __export(events_exports, {
92
- AddToCart: () => AddToCart,
93
- InitiateCheckout: () => InitiateCheckout,
94
- Purchase: () => Purchase,
95
- ViewContent: () => ViewContent
88
+ // src/examples/step.ts
89
+ var step_exports = {};
90
+ __export(step_exports, {
91
+ addToCart: () => addToCart,
92
+ initiateCheckout: () => initiateCheckout,
93
+ pageView: () => pageView,
94
+ purchase: () => purchase,
95
+ viewContent: () => viewContent
96
96
  });
97
97
 
98
98
  // ../../../core/dist/index.mjs
99
- var e = Object.defineProperty;
100
- var c = {};
101
- ((t, n) => {
102
- for (var o in n) e(t, o, { get: n[o], enumerable: true });
103
- })(c, { Level: () => u });
104
- var u = ((e2) => (e2[e2.ERROR = 0] = "ERROR", e2[e2.INFO = 1] = "INFO", e2[e2.DEBUG = 2] = "DEBUG", e2))(u || {});
105
- var A = { merge: true, shallow: true, extend: true };
106
- function P(e2, t = {}, n = {}) {
107
- n = { ...A, ...n };
108
- const o = Object.entries(t).reduce((t2, [o2, r]) => {
109
- const i = e2[o2];
110
- return n.merge && Array.isArray(i) && Array.isArray(r) ? t2[o2] = r.reduce((e3, t3) => e3.includes(t3) ? e3 : [...e3, t3], [...i]) : (n.extend || o2 in e2) && (t2[o2] = r), t2;
99
+ var t = Object.defineProperty;
100
+ var a = {};
101
+ ((e, n) => {
102
+ for (var o in n) t(e, o, { get: n[o], enumerable: true });
103
+ })(a, { Level: () => u });
104
+ var u = ((t2) => (t2[t2.ERROR = 0] = "ERROR", t2[t2.WARN = 1] = "WARN", t2[t2.INFO = 2] = "INFO", t2[t2.DEBUG = 3] = "DEBUG", t2))(u || {});
105
+ var D = { merge: true, shallow: true, extend: true };
106
+ function H(t2, e = {}, n = {}) {
107
+ n = { ...D, ...n };
108
+ const o = Object.entries(e).reduce((e2, [o2, r]) => {
109
+ const i = t2[o2];
110
+ return n.merge && Array.isArray(i) && Array.isArray(r) ? e2[o2] = r.reduce((t3, e3) => t3.includes(e3) ? t3 : [...t3, e3], [...i]) : (n.extend || o2 in t2) && (e2[o2] = r), e2;
111
111
  }, {});
112
- return n.shallow ? { ...e2, ...o } : (Object.assign(e2, o), e2);
112
+ return n.shallow ? { ...t2, ...o } : (Object.assign(t2, o), t2);
113
113
  }
114
- function _(e2) {
115
- return Array.isArray(e2);
114
+ function W(t2) {
115
+ return Array.isArray(t2);
116
116
  }
117
- function D(e2) {
118
- return "object" == typeof e2 && null !== e2 && !_(e2) && "[object Object]" === Object.prototype.toString.call(e2);
117
+ function Z(t2) {
118
+ return "object" == typeof t2 && null !== t2 && !W(t2) && "[object Object]" === Object.prototype.toString.call(t2);
119
119
  }
120
- function Z(e2 = {}) {
120
+ function nt(t2 = {}) {
121
121
  var _a;
122
- const t = e2.timestamp || (/* @__PURE__ */ new Date()).setHours(0, 13, 37, 0), n = e2.group || "gr0up", o = e2.count || 1, r = P({ name: "entity action", data: { string: "foo", number: 1, boolean: true, array: [0, "text", false], not: void 0 }, context: { dev: ["test", 1] }, globals: { lang: "elb" }, custom: { completely: "random" }, user: { id: "us3r", device: "c00k13", session: "s3ss10n" }, nested: [{ entity: "child", data: { is: "subordinated" }, nested: [], context: { element: ["child", 0] } }], consent: { functional: true }, id: `${t}-${n}-${o}`, trigger: "test", entity: "entity", action: "action", timestamp: t, timing: 3.14, group: n, count: o, version: { source: "2.0.0", tagging: 1 }, source: { type: "web", id: "https://localhost:80", previous_id: "http://remotehost:9001" } }, e2, { merge: false });
123
- if (e2.name) {
124
- const [t2, n2] = (_a = e2.name.split(" ")) != null ? _a : [];
125
- t2 && n2 && (r.entity = t2, r.action = n2);
122
+ const e = t2.timestamp || (/* @__PURE__ */ new Date()).setHours(0, 13, 37, 0), n = t2.group || "gr0up", o = t2.count || 1, r = H({ name: "entity action", data: { string: "foo", number: 1, boolean: true, array: [0, "text", false], not: void 0 }, context: { dev: ["test", 1] }, globals: { lang: "elb" }, custom: { completely: "random" }, user: { id: "us3r", device: "c00k13", session: "s3ss10n" }, nested: [{ entity: "child", data: { is: "subordinated" }, nested: [], context: { element: ["child", 0] } }], consent: { functional: true }, id: `${e}-${n}-${o}`, trigger: "test", entity: "entity", action: "action", timestamp: e, timing: 3.14, group: n, count: o, version: { source: "2.0.1", tagging: 1 }, source: { type: "web", id: "https://localhost:80", previous_id: "http://remotehost:9001" } }, t2, { merge: false });
123
+ if (t2.name) {
124
+ const [e2, n2] = (_a = t2.name.split(" ")) != null ? _a : [];
125
+ e2 && n2 && (r.entity = e2, r.action = n2);
126
126
  }
127
127
  return r;
128
128
  }
129
- function q(e2 = "entity action", t = {}) {
130
- const n = t.timestamp || (/* @__PURE__ */ new Date()).setHours(0, 13, 37, 0), o = { data: { id: "ers", name: "Everyday Ruck Snack", color: "black", size: "l", price: 420 } }, r = { data: { id: "cc", name: "Cool Cap", size: "one size", price: 42 } };
131
- return Z({ ...{ "cart view": { data: { currency: "EUR", value: 2 * o.data.price }, context: { shopping: ["cart", 0] }, globals: { pagegroup: "shop" }, nested: [{ entity: "product", data: { ...o.data, quantity: 2 }, context: { shopping: ["cart", 0] }, nested: [] }], trigger: "load" }, "checkout view": { data: { step: "payment", currency: "EUR", value: o.data.price + r.data.price }, context: { shopping: ["checkout", 0] }, globals: { pagegroup: "shop" }, nested: [{ entity: "product", ...o, context: { shopping: ["checkout", 0] }, nested: [] }, { entity: "product", ...r, context: { shopping: ["checkout", 0] }, nested: [] }], trigger: "load" }, "order complete": { data: { id: "0rd3r1d", currency: "EUR", shipping: 5.22, taxes: 73.76, total: 555 }, context: { shopping: ["complete", 0] }, globals: { pagegroup: "shop" }, nested: [{ entity: "product", ...o, context: { shopping: ["complete", 0] }, nested: [] }, { entity: "product", ...r, context: { shopping: ["complete", 0] }, nested: [] }, { entity: "gift", data: { name: "Surprise" }, context: { shopping: ["complete", 0] }, nested: [] }], trigger: "load" }, "page view": { data: { domain: "www.example.com", title: "walkerOS documentation", referrer: "https://www.walkeros.io/", search: "?foo=bar", hash: "#hash", id: "/docs/" }, globals: { pagegroup: "docs" }, trigger: "load" }, "product add": { ...o, context: { shopping: ["intent", 0] }, globals: { pagegroup: "shop" }, nested: [], trigger: "click" }, "product view": { ...o, context: { shopping: ["detail", 0] }, globals: { pagegroup: "shop" }, nested: [], trigger: "load" }, "product visible": { data: { ...o.data, position: 3, promo: true }, context: { shopping: ["discover", 0] }, globals: { pagegroup: "shop" }, nested: [], trigger: "load" }, "promotion visible": { data: { name: "Setting up tracking easily", position: "hero" }, context: { ab_test: ["engagement", 0] }, globals: { pagegroup: "homepage" }, trigger: "visible" }, "session start": { data: { id: "s3ss10n", start: n, isNew: true, count: 1, runs: 1, isStart: true, storage: true, referrer: "", device: "c00k13" }, user: { id: "us3r", device: "c00k13", session: "s3ss10n", hash: "h4sh", address: "street number", email: "user@example.com", phone: "+49 123 456 789", userAgent: "Mozilla...", browser: "Chrome", browserVersion: "90", deviceType: "desktop", language: "de-DE", country: "DE", region: "HH", city: "Hamburg", zip: "20354", timezone: "Berlin", os: "walkerOS", osVersion: "1.0", screenSize: "1337x420", ip: "127.0.0.0", internal: true, custom: "value" } } }[e2], ...t, name: e2 });
129
+ function ot(t2 = "entity action", e = {}) {
130
+ const n = e.timestamp || (/* @__PURE__ */ new Date()).setHours(0, 13, 37, 0), o = { data: { id: "ers", name: "Everyday Ruck Snack", color: "black", size: "l", price: 420 } }, r = { data: { id: "cc", name: "Cool Cap", size: "one size", price: 42 } };
131
+ return nt({ ...{ "cart view": { data: { currency: "EUR", value: 2 * o.data.price }, context: { shopping: ["cart", 0] }, globals: { pagegroup: "shop" }, nested: [{ entity: "product", data: { ...o.data, quantity: 2 }, context: { shopping: ["cart", 0] }, nested: [] }], trigger: "load" }, "checkout view": { data: { step: "payment", currency: "EUR", value: o.data.price + r.data.price }, context: { shopping: ["checkout", 0] }, globals: { pagegroup: "shop" }, nested: [{ entity: "product", ...o, context: { shopping: ["checkout", 0] }, nested: [] }, { entity: "product", ...r, context: { shopping: ["checkout", 0] }, nested: [] }], trigger: "load" }, "order complete": { data: { id: "0rd3r1d", currency: "EUR", shipping: 5.22, taxes: 73.76, total: 555 }, context: { shopping: ["complete", 0] }, globals: { pagegroup: "shop" }, nested: [{ entity: "product", ...o, context: { shopping: ["complete", 0] }, nested: [] }, { entity: "product", ...r, context: { shopping: ["complete", 0] }, nested: [] }, { entity: "gift", data: { name: "Surprise" }, context: { shopping: ["complete", 0] }, nested: [] }], trigger: "load" }, "page view": { data: { domain: "www.example.com", title: "walkerOS documentation", referrer: "https://www.walkeros.io/", search: "?foo=bar", hash: "#hash", id: "/docs/" }, globals: { pagegroup: "docs" }, trigger: "load" }, "product add": { ...o, context: { shopping: ["intent", 0] }, globals: { pagegroup: "shop" }, nested: [], trigger: "click" }, "product view": { ...o, context: { shopping: ["detail", 0] }, globals: { pagegroup: "shop" }, nested: [], trigger: "load" }, "product visible": { data: { ...o.data, position: 3, promo: true }, context: { shopping: ["discover", 0] }, globals: { pagegroup: "shop" }, nested: [], trigger: "load" }, "promotion visible": { data: { name: "Setting up tracking easily", position: "hero" }, context: { ab_test: ["engagement", 0] }, globals: { pagegroup: "homepage" }, trigger: "visible" }, "session start": { data: { id: "s3ss10n", start: n, isNew: true, count: 1, runs: 1, isStart: true, storage: true, referrer: "", device: "c00k13" }, user: { id: "us3r", device: "c00k13", session: "s3ss10n", hash: "h4sh", address: "street number", email: "user@example.com", phone: "+49 123 456 789", userAgent: "Mozilla...", browser: "Chrome", browserVersion: "90", deviceType: "desktop", language: "de-DE", country: "DE", region: "HH", city: "Hamburg", zip: "20354", timezone: "Berlin", os: "walkerOS", osVersion: "1.0", screenSize: "1337x420", ip: "127.0.0.0", internal: true, custom: "value" } } }[t2], ...e, name: t2 });
132
132
  }
133
133
 
134
- // src/examples/events.ts
135
- function Purchase() {
136
- const event = q("order complete");
137
- return [
134
+ // src/examples/step.ts
135
+ var purchase = {
136
+ in: ot("order complete", { timestamp: 17e8 }),
137
+ mapping: {
138
+ name: "Purchase",
139
+ data: {
140
+ map: {
141
+ value: "data.total",
142
+ currency: { value: "EUR" },
143
+ contents: {
144
+ loop: [
145
+ "nested",
146
+ {
147
+ condition: (entity) => Z(entity) && entity.entity === "product",
148
+ map: {
149
+ id: "data.id",
150
+ quantity: { key: "data.quantity", value: 1 }
151
+ }
152
+ }
153
+ ]
154
+ },
155
+ content_type: { value: "product" },
156
+ num_items: {
157
+ fn: (event) => event.nested.filter(
158
+ (item) => item.entity === "product"
159
+ ).length
160
+ }
161
+ }
162
+ }
163
+ },
164
+ out: [
138
165
  "track",
139
166
  "Purchase",
140
167
  {
141
- value: event.data.total,
168
+ value: 555,
142
169
  currency: "EUR",
143
- contents: event.nested.filter((item) => item.entity === "product").map((item) => ({ id: item.data.id, quantity: 1 })),
170
+ contents: [
171
+ { id: "ers", quantity: 1 },
172
+ { id: "cc", quantity: 1 }
173
+ ],
144
174
  content_type: "product",
145
175
  num_items: 2
146
176
  },
147
- { eventID: event.id }
148
- ];
149
- }
150
- function AddToCart() {
151
- const event = q("product add");
152
- return [
177
+ { eventID: "1700000000-gr0up-1" }
178
+ ]
179
+ };
180
+ var addToCart = {
181
+ in: ot("product add", { timestamp: 1700000001 }),
182
+ mapping: {
183
+ name: "AddToCart",
184
+ data: {
185
+ map: {
186
+ value: "data.price",
187
+ currency: { value: "EUR" },
188
+ contents: {
189
+ set: [
190
+ {
191
+ map: {
192
+ id: "data.id",
193
+ quantity: { key: "data.quantity", value: 1 }
194
+ }
195
+ }
196
+ ]
197
+ },
198
+ content_type: { value: "product" }
199
+ }
200
+ }
201
+ },
202
+ out: [
153
203
  "track",
154
204
  "AddToCart",
155
205
  {
156
206
  currency: "EUR",
157
- value: event.data.price,
158
- contents: [{ id: event.data.id, quantity: 1 }],
207
+ value: 420,
208
+ contents: [{ id: "ers", quantity: 1 }],
159
209
  content_type: "product"
160
210
  },
161
- { eventID: event.id }
162
- ];
163
- }
164
- function InitiateCheckout() {
165
- const event = q("cart view");
166
- return [
167
- "track",
168
- "InitiateCheckout",
169
- {
170
- currency: "EUR",
171
- value: event.data.value,
172
- contents: event.nested.filter((entity) => entity.entity === "product").map((entity) => ({
173
- id: entity.data.id,
174
- quantity: entity.data.quantity
175
- })),
176
- num_items: event.nested.filter((item) => item.entity === "product").length
177
- },
178
- { eventID: event.id }
179
- ];
180
- }
181
- function ViewContent() {
182
- const event = q("product view");
183
- return [
211
+ { eventID: "1700000001-gr0up-1" }
212
+ ]
213
+ };
214
+ var viewContent = {
215
+ in: ot("product view", { timestamp: 1700000002 }),
216
+ mapping: {
217
+ name: "ViewContent",
218
+ data: {
219
+ map: {
220
+ value: "data.price",
221
+ currency: { value: "EUR" },
222
+ content_type: { value: "product" },
223
+ contents: {
224
+ set: [
225
+ {
226
+ map: {
227
+ id: "data.id",
228
+ quantity: { key: "data.quantity", value: 1 }
229
+ }
230
+ }
231
+ ]
232
+ }
233
+ }
234
+ }
235
+ },
236
+ out: [
184
237
  "track",
185
238
  "ViewContent",
186
239
  {
187
240
  currency: "EUR",
188
- value: event.data.price,
189
- contents: [{ id: event.data.id, quantity: 1 }],
241
+ value: 420,
242
+ contents: [{ id: "ers", quantity: 1 }],
190
243
  content_type: "product"
191
244
  },
192
- { eventID: event.id }
193
- ];
194
- }
195
-
196
- // src/examples/mapping.ts
197
- var mapping_exports = {};
198
- __export(mapping_exports, {
199
- AddToCart: () => AddToCart2,
200
- InitiateCheckout: () => InitiateCheckout2,
201
- Purchase: () => Purchase2,
202
- ViewContent: () => ViewContent2,
203
- config: () => config
204
- });
205
- var Purchase2 = {
206
- name: "Purchase",
207
- data: {
208
- map: {
209
- value: "data.total",
210
- currency: { value: "EUR" },
211
- contents: {
212
- loop: [
213
- "nested",
214
- {
215
- condition: (entity) => D(entity) && entity.entity === "product",
216
- map: {
217
- id: "data.id",
218
- quantity: { key: "data.quantity", value: 1 }
219
- }
220
- }
221
- ]
222
- },
223
- content_type: { value: "product" },
224
- num_items: {
225
- fn: (event) => event.nested.filter(
226
- (item) => item.entity === "product"
227
- ).length
228
- }
229
- }
230
- }
231
- };
232
- var AddToCart2 = {
233
- name: "AddToCart",
234
- data: {
235
- map: {
236
- value: "data.price",
237
- currency: { value: "EUR" },
238
- contents: {
239
- set: [
240
- {
241
- map: {
242
- id: "data.id",
243
- quantity: { key: "data.quantity", value: 1 }
244
- }
245
- }
246
- ]
247
- },
248
- content_type: { value: "product" }
249
- }
250
- }
251
- };
252
- var InitiateCheckout2 = {
253
- name: "InitiateCheckout",
254
- data: {
255
- map: {
256
- value: "data.value",
257
- currency: { value: "EUR" },
258
- contents: {
259
- loop: [
260
- "nested",
261
- {
262
- condition: (entity) => D(entity) && entity.entity === "product",
263
- map: {
264
- id: "data.id",
265
- quantity: { key: "data.quantity", value: 1 }
266
- }
267
- }
268
- ]
269
- },
270
- num_items: {
271
- fn: (event) => event.nested.filter(
272
- (item) => item.entity === "product"
273
- ).length
274
- }
275
- }
276
- }
245
+ { eventID: "1700000002-gr0up-1" }
246
+ ]
277
247
  };
278
- var ViewContent2 = {
279
- name: "ViewContent",
280
- data: {
281
- map: {
282
- value: "data.price",
283
- currency: { value: "EUR" },
284
- content_type: { value: "product" },
285
- contents: {
286
- set: [
287
- {
288
- map: {
289
- id: "data.id",
290
- quantity: { key: "data.quantity", value: 1 }
248
+ var initiateCheckout = {
249
+ in: ot("cart view", { timestamp: 1700000003 }),
250
+ mapping: {
251
+ name: "InitiateCheckout",
252
+ data: {
253
+ map: {
254
+ value: "data.value",
255
+ currency: { value: "EUR" },
256
+ contents: {
257
+ loop: [
258
+ "nested",
259
+ {
260
+ condition: (entity) => Z(entity) && entity.entity === "product",
261
+ map: {
262
+ id: "data.id",
263
+ quantity: { key: "data.quantity", value: 1 }
264
+ }
291
265
  }
292
- }
293
- ]
266
+ ]
267
+ },
268
+ num_items: {
269
+ fn: (event) => event.nested.filter(
270
+ (item) => item.entity === "product"
271
+ ).length
272
+ }
294
273
  }
295
274
  }
296
- }
275
+ },
276
+ out: [
277
+ "track",
278
+ "InitiateCheckout",
279
+ {
280
+ currency: "EUR",
281
+ value: 840,
282
+ contents: [{ id: "ers", quantity: 2 }],
283
+ num_items: 1
284
+ },
285
+ { eventID: "1700000003-gr0up-1" }
286
+ ]
297
287
  };
298
- var config = {
299
- order: { complete: Purchase2 },
300
- product: { view: ViewContent2, add: AddToCart2 },
301
- cart: { view: InitiateCheckout2 }
288
+ var pageView = {
289
+ in: ot("page view", { timestamp: 1700000004 }),
290
+ mapping: void 0,
291
+ out: ["track", "PageView", {}, { eventID: "1700000004-gr0up-1" }]
302
292
  };
303
293
  // Annotate the CommonJS export names for ESM import in node:
304
294
  0 && (module.exports = {
305
295
  env,
306
- events,
307
- mapping
296
+ step
308
297
  });