@metarouter/ajs-starter-kit 1.0.89 → 1.0.90

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 (29) hide show
  1. package/.dist/clinch/connection.etag.json +1 -0
  2. package/.dist/clinch/connection.json +20 -0
  3. package/.dist/clinch/kit.etag.json +1 -0
  4. package/.dist/clinch/metadata.json +20 -0
  5. package/.dist/clinch/playbook.etag.json +1 -0
  6. package/.dist/clinch/playbook.json +492 -0
  7. package/.dist/commission-junction/connection.etag.json +1 -1
  8. package/.dist/commission-junction/connection.json +3 -3
  9. package/.dist/commission-junction/kit.etag.json +1 -1
  10. package/.dist/commission-junction/metadata.json +5 -1
  11. package/.dist/commission-junction/playbook.etag.json +1 -1
  12. package/.dist/commission-junction/playbook.json +3 -75
  13. package/.dist/google-ads/kit.etag.json +1 -1
  14. package/.dist/google-ads/metadata.json +4 -0
  15. package/.dist/google-ads/playbook.etag.json +1 -1
  16. package/.dist/google-ads/playbook.json +1 -13
  17. package/.dist/google-analytics-4-collect/connection.etag.json +1 -0
  18. package/.dist/google-analytics-4-collect/connection.json +20 -0
  19. package/.dist/google-analytics-4-collect/kit.etag.json +1 -0
  20. package/.dist/google-analytics-4-collect/metadata.json +20 -0
  21. package/.dist/google-analytics-4-collect/playbook.etag.json +1 -0
  22. package/.dist/google-analytics-4-collect/playbook.json +677 -0
  23. package/.dist/movable-ink-customer-data/kit.etag.json +1 -1
  24. package/.dist/movable-ink-customer-data/metadata.json +5 -1
  25. package/.dist/movable-ink-customer-data/playbook.etag.json +1 -1
  26. package/.dist/movable-ink-customer-data/playbook.json +1 -1
  27. package/README.md +11 -5
  28. package/index.js +24 -0
  29. package/package.json +1 -1
@@ -0,0 +1,677 @@
1
+ {
2
+ "version": "0.1.0",
3
+ "global": {
4
+ "mappings": [
5
+ {
6
+ "inputKey": "context.providers.googleGtag.data.gclid",
7
+ "outputKey": "gclid"
8
+ },
9
+ {
10
+ "inputKey": "context.providers.googleGtag.data.dclid",
11
+ "outputKey": "dclid"
12
+ },
13
+ {
14
+ "inputKey": "input",
15
+ "outputKey": "cid",
16
+ "transforms": [
17
+ {
18
+ "expression": {
19
+ "body": "local ga = SPLIT(input.context.providers.googleGtag.data.ga, \".\", 4) if ga and ga[4] then return ga[3] .. \".\" .. ga[4] end return input.anonymousId",
20
+ "lang": "lua"
21
+ }
22
+ }
23
+ ]
24
+ },
25
+ {
26
+ "inputKey": "context.page.url",
27
+ "outputKey": "dl"
28
+ },
29
+ {
30
+ "inputKey": "context.page.title",
31
+ "outputKey": "dt"
32
+ },
33
+ {
34
+ "inputKey": "context.page.referrer",
35
+ "outputKey": "dr"
36
+ },
37
+ {
38
+ "inputKey": "context.userAgent",
39
+ "outputKey": "ua"
40
+ },
41
+ {
42
+ "inputKey": "context.ip",
43
+ "outputKey": "_uip"
44
+ },
45
+ {
46
+ "inputKey": "context.campaign.id",
47
+ "outputKey": "ci"
48
+ },
49
+ {
50
+ "inputKey": "context.campaign.source",
51
+ "outputKey": "cs"
52
+ },
53
+ {
54
+ "inputKey": "context.campaign.medium",
55
+ "outputKey": "cm"
56
+ },
57
+ {
58
+ "inputKey": "context.campaign.name",
59
+ "outputKey": "cn"
60
+ },
61
+ {
62
+ "inputKey": "context.campaign.content",
63
+ "outputKey": "cc"
64
+ },
65
+ {
66
+ "inputKey": "context.campaign.term",
67
+ "outputKey": "ck"
68
+ },
69
+ {
70
+ "inputKey": "context.providers.googleGtag.data.sessionID",
71
+ "outputKey": "sid"
72
+ },
73
+ {
74
+ "inputKey": "context.providers.googleGtag.data.sessionCount",
75
+ "outputKey": "sct"
76
+ },
77
+ {
78
+ "inputKey": "properties.engagement_time_milliseconds",
79
+ "outputKey": "_et",
80
+ "defaultString": "1"
81
+ }
82
+ ],
83
+ "enrichments": [
84
+ {
85
+ "outputKey": "tid",
86
+ "staticString": "$$MEASUREMENT_ID$$"
87
+ },
88
+ {
89
+ "outputKey": "v",
90
+ "staticString": "2"
91
+ },
92
+ {
93
+ "outputKey": "isDebugMode",
94
+ "staticBool": false
95
+ }
96
+ ]
97
+ },
98
+ "params": [
99
+ {
100
+ "name": "MEASUREMENT_ID",
101
+ "isOptional": false,
102
+ "exampleValue": "my-measurement-id"
103
+ }
104
+ ],
105
+ "default": {
106
+ "mappings": [
107
+ {
108
+ "inputKey": "input",
109
+ "outputKey": "en",
110
+ "transforms": [
111
+ {
112
+ "expression": {
113
+ "body": "return input.event or input.type",
114
+ "lang": "lua"
115
+ }
116
+ }
117
+ ]
118
+ }
119
+ ]
120
+ },
121
+ "eventSpecific": {
122
+ "page": {
123
+ "enrichments": [
124
+ {
125
+ "outputKey": "en",
126
+ "staticString": "page_view"
127
+ },
128
+ {
129
+ "outputKey": "isConversion",
130
+ "staticBool": true
131
+ }
132
+ ]
133
+ },
134
+ "products_searched": {
135
+ "mappings": [
136
+ {
137
+ "inputKey": "properties.query",
138
+ "outputKey": "ep-search_term"
139
+ }
140
+ ],
141
+ "enrichments": [
142
+ {
143
+ "outputKey": "en",
144
+ "staticString": "search"
145
+ }
146
+ ]
147
+ },
148
+ "product_list_viewed": {
149
+ "mappings": [
150
+ {
151
+ "inputKey": "properties.list_id",
152
+ "outputKey": "ep-item_list_id"
153
+ },
154
+ {
155
+ "inputKey": "properties.category",
156
+ "outputKey": "ep-item_list_name"
157
+ }
158
+ ],
159
+ "enrichments": [
160
+ {
161
+ "outputKey": "en",
162
+ "staticString": "view_item_list"
163
+ }
164
+ ],
165
+ "expressions": [
166
+ {
167
+ "lang": "lua",
168
+ "body": "local items = {}\nif (input.properties.products) then\n for inputIndex, product in pairs(input.properties.products) do\n local index = 'pr' .. inputIndex\n product_details = {}\n if (product.product_id or product.sku) then table.insert(product_details, 'id' .. (product.product_id or product.sku)) end\n if product.name then table.insert(product_details, 'nm' .. product.name) end\n if product.affiliation then table.insert(product_details, 'af' .. product.affiliation) end\n if product.coupon then table.insert(product_details, 'cp' .. product.coupon) end\n if product.discount then table.insert(product_details, 'ds' .. product.discount) end\n if product.position then table.insert(product_details, 'lp' .. product.position) end\n if product.brand then table.insert(product_details, 'br' .. product.brand) end\n if product.category then table.insert(product_details, 'ca' .. product.category) end\n if product.variant then table.insert(product_details, 'va' .. product.variant) end\n if product.price then table.insert(product_details, 'pr' .. product.price) end\n if product.quantity then table.insert(product_details, 'qt' .. product.quantity) end\n items[index] = JOIN(product_details, '~')\n end\nend\nreturn items"
169
+ }
170
+ ]
171
+ },
172
+ "product_clicked": {
173
+ "mappings": [
174
+ {
175
+ "inputKey": "input",
176
+ "outputKey": "pr1",
177
+ "transforms": [
178
+ {
179
+ "expression": {
180
+ "body": "product_details = {} if (input.properties.product_id or input.properties.sku) then table.insert(product_details, 'id' .. (input.properties.product_id or input.properties.sku)) end if input.properties.name then table.insert(product_details, 'nm' .. input.properties.name) end if input.properties.affiliation then table.insert(product_details, 'af' .. input.properties.affiliation) end if input.properties.coupon then table.insert(product_details, 'cp' .. input.properties.coupon) end if input.properties.discount then table.insert(product_details, 'ds' .. input.properties.discount) end if input.properties.position then table.insert(product_details, 'lp' .. input.properties.position) end if input.properties.brand then table.insert(product_details, 'br' .. input.properties.brand) end if input.properties.category then table.insert(product_details, 'ca' .. input.properties.category) end if input.properties.variant then table.insert(product_details, 'va' .. input.properties.variant) end if input.properties.price then table.insert(product_details, 'pr' .. input.properties.price) end if input.properties.quantity then table.insert(product_details, 'qt' .. input.properties.quantity) end return JOIN(product_details, '~')",
181
+ "lang": "lua"
182
+ }
183
+ }
184
+ ]
185
+ }
186
+ ],
187
+ "enrichments": [
188
+ {
189
+ "outputKey": "en",
190
+ "staticString": "select_item"
191
+ }
192
+ ]
193
+ },
194
+ "product_viewed": {
195
+ "mappings": [
196
+ {
197
+ "inputKey": "properties.currency",
198
+ "outputKey": "cu",
199
+ "transforms": [
200
+ {
201
+ "modifyString": "uppercase"
202
+ }
203
+ ],
204
+ "defaultString": "USD"
205
+ },
206
+ {
207
+ "inputKey": "input",
208
+ "outputKey": "epn-value",
209
+ "transforms": [
210
+ {
211
+ "expression": {
212
+ "body": "return input.properties.value or ((input.properties.price or 0) * (input.properties.quantity or 1))",
213
+ "lang": "lua"
214
+ }
215
+ }
216
+ ]
217
+ },
218
+ {
219
+ "inputKey": "input",
220
+ "outputKey": "pr1",
221
+ "transforms": [
222
+ {
223
+ "expression": {
224
+ "body": "product_details = {} if (input.properties.product_id or input.properties.sku) then table.insert(product_details, 'id' .. (input.properties.product_id or input.properties.sku)) end if input.properties.name then table.insert(product_details, 'nm' .. input.properties.name) end if input.properties.affiliation then table.insert(product_details, 'af' .. input.properties.affiliation) end if input.properties.coupon then table.insert(product_details, 'cp' .. input.properties.coupon) end if input.properties.discount then table.insert(product_details, 'ds' .. input.properties.discount) end if input.properties.position then table.insert(product_details, 'lp' .. input.properties.position) end if input.properties.brand then table.insert(product_details, 'br' .. input.properties.brand) end if input.properties.category then table.insert(product_details, 'ca' .. input.properties.category) end if input.properties.variant then table.insert(product_details, 'va' .. input.properties.variant) end if input.properties.price then table.insert(product_details, 'pr' .. input.properties.price) end if input.properties.quantity then table.insert(product_details, 'qt' .. input.properties.quantity) end return JOIN(product_details, '~')",
225
+ "lang": "lua"
226
+ }
227
+ }
228
+ ]
229
+ }
230
+ ],
231
+ "enrichments": [
232
+ {
233
+ "outputKey": "en",
234
+ "staticString": "view_item"
235
+ }
236
+ ]
237
+ },
238
+ "product_added": {
239
+ "mappings": [
240
+ {
241
+ "inputKey": "properties.currency",
242
+ "outputKey": "cu",
243
+ "transforms": [
244
+ {
245
+ "modifyString": "uppercase"
246
+ }
247
+ ],
248
+ "defaultString": "USD"
249
+ },
250
+ {
251
+ "inputKey": "input",
252
+ "outputKey": "epn-value",
253
+ "transforms": [
254
+ {
255
+ "expression": {
256
+ "body": "return input.properties.value or ((input.properties.price or 0) * (input.properties.quantity or 1))",
257
+ "lang": "lua"
258
+ }
259
+ }
260
+ ]
261
+ },
262
+ {
263
+ "inputKey": "input",
264
+ "outputKey": "pr1",
265
+ "transforms": [
266
+ {
267
+ "expression": {
268
+ "body": "product_details = {} if (input.properties.product_id or input.properties.sku) then table.insert(product_details, 'id' .. (input.properties.product_id or input.properties.sku)) end if input.properties.name then table.insert(product_details, 'nm' .. input.properties.name) end if input.properties.affiliation then table.insert(product_details, 'af' .. input.properties.affiliation) end if input.properties.coupon then table.insert(product_details, 'cp' .. input.properties.coupon) end if input.properties.discount then table.insert(product_details, 'ds' .. input.properties.discount) end if input.properties.position then table.insert(product_details, 'lp' .. input.properties.position) end if input.properties.brand then table.insert(product_details, 'br' .. input.properties.brand) end if input.properties.category then table.insert(product_details, 'ca' .. input.properties.category) end if input.properties.variant then table.insert(product_details, 'va' .. input.properties.variant) end if input.properties.price then table.insert(product_details, 'pr' .. input.properties.price) end if input.properties.quantity then table.insert(product_details, 'qt' .. input.properties.quantity) end return JOIN(product_details, '~')",
269
+ "lang": "lua"
270
+ }
271
+ }
272
+ ]
273
+ }
274
+ ],
275
+ "enrichments": [
276
+ {
277
+ "outputKey": "isConversion",
278
+ "staticBool": true
279
+ },
280
+ {
281
+ "outputKey": "en",
282
+ "staticString": "add_to_cart"
283
+ }
284
+ ]
285
+ },
286
+ "product_added_to_wishlist": {
287
+ "mappings": [
288
+ {
289
+ "inputKey": "properties.currency",
290
+ "outputKey": "cu",
291
+ "transforms": [
292
+ {
293
+ "modifyString": "uppercase"
294
+ }
295
+ ],
296
+ "defaultString": "USD"
297
+ },
298
+ {
299
+ "inputKey": "input",
300
+ "outputKey": "epn-value",
301
+ "transforms": [
302
+ {
303
+ "expression": {
304
+ "body": "return input.properties.value or ((input.properties.price or 0) * (input.properties.quantity or 1))",
305
+ "lang": "lua"
306
+ }
307
+ }
308
+ ]
309
+ },
310
+ {
311
+ "inputKey": "input",
312
+ "outputKey": "pr1",
313
+ "transforms": [
314
+ {
315
+ "expression": {
316
+ "body": "product_details = {} if (input.properties.product_id or input.properties.sku) then table.insert(product_details, 'id' .. (input.properties.product_id or input.properties.sku)) end if input.properties.name then table.insert(product_details, 'nm' .. input.properties.name) end if input.properties.affiliation then table.insert(product_details, 'af' .. input.properties.affiliation) end if input.properties.coupon then table.insert(product_details, 'cp' .. input.properties.coupon) end if input.properties.discount then table.insert(product_details, 'ds' .. input.properties.discount) end if input.properties.position then table.insert(product_details, 'lp' .. input.properties.position) end if input.properties.brand then table.insert(product_details, 'br' .. input.properties.brand) end if input.properties.category then table.insert(product_details, 'ca' .. input.properties.category) end if input.properties.variant then table.insert(product_details, 'va' .. input.properties.variant) end if input.properties.price then table.insert(product_details, 'pr' .. input.properties.price) end if input.properties.quantity then table.insert(product_details, 'qt' .. input.properties.quantity) end return JOIN(product_details, '~')",
317
+ "lang": "lua"
318
+ }
319
+ }
320
+ ]
321
+ }
322
+ ],
323
+ "enrichments": [
324
+ {
325
+ "outputKey": "en",
326
+ "staticString": "add_to_wishlist"
327
+ }
328
+ ]
329
+ },
330
+ "product_removed": {
331
+ "mappings": [
332
+ {
333
+ "inputKey": "properties.currency",
334
+ "outputKey": "cu",
335
+ "transforms": [
336
+ {
337
+ "modifyString": "uppercase"
338
+ }
339
+ ],
340
+ "defaultString": "USD"
341
+ },
342
+ {
343
+ "inputKey": "input",
344
+ "outputKey": "epn-value",
345
+ "transforms": [
346
+ {
347
+ "expression": {
348
+ "body": "return input.properties.value or ((input.properties.price or 0) * (input.properties.quantity or 1))",
349
+ "lang": "lua"
350
+ }
351
+ }
352
+ ]
353
+ },
354
+ {
355
+ "inputKey": "input",
356
+ "outputKey": "pr1",
357
+ "transforms": [
358
+ {
359
+ "expression": {
360
+ "body": "product_details = {} if (input.properties.product_id or input.properties.sku) then table.insert(product_details, 'id' .. (input.properties.product_id or input.properties.sku)) end if input.properties.name then table.insert(product_details, 'nm' .. input.properties.name) end if input.properties.affiliation then table.insert(product_details, 'af' .. input.properties.affiliation) end if input.properties.coupon then table.insert(product_details, 'cp' .. input.properties.coupon) end if input.properties.discount then table.insert(product_details, 'ds' .. input.properties.discount) end if input.properties.position then table.insert(product_details, 'lp' .. input.properties.position) end if input.properties.brand then table.insert(product_details, 'br' .. input.properties.brand) end if input.properties.category then table.insert(product_details, 'ca' .. input.properties.category) end if input.properties.variant then table.insert(product_details, 'va' .. input.properties.variant) end if input.properties.price then table.insert(product_details, 'pr' .. input.properties.price) end if input.properties.quantity then table.insert(product_details, 'qt' .. input.properties.quantity) end return JOIN(product_details, '~')",
361
+ "lang": "lua"
362
+ }
363
+ }
364
+ ]
365
+ }
366
+ ],
367
+ "enrichments": [
368
+ {
369
+ "outputKey": "en",
370
+ "staticString": "remove_from_cart"
371
+ }
372
+ ]
373
+ },
374
+ "cart_viewed": {
375
+ "mappings": [
376
+ {
377
+ "inputKey": "properties.currency",
378
+ "outputKey": "cu",
379
+ "transforms": [
380
+ {
381
+ "modifyString": "uppercase"
382
+ }
383
+ ],
384
+ "defaultString": "USD"
385
+ },
386
+ {
387
+ "inputKey": "input",
388
+ "outputKey": "epn-value",
389
+ "transforms": [
390
+ {
391
+ "expression": {
392
+ "body": "return SUM(MAP(input.properties.products, function (p) return (p.price or 0) * (p.quantity or 1) end))",
393
+ "lang": "lua"
394
+ }
395
+ }
396
+ ]
397
+ }
398
+ ],
399
+ "enrichments": [
400
+ {
401
+ "outputKey": "en",
402
+ "staticString": "view_cart"
403
+ }
404
+ ],
405
+ "expressions": [
406
+ {
407
+ "lang": "lua",
408
+ "body": "local items = {}\nif (input.properties.products) then\n for inputIndex, product in pairs(input.properties.products) do\n local index = 'pr' .. inputIndex\n product_details = {}\n if (product.product_id or product.sku) then table.insert(product_details, 'id' .. (product.product_id or product.sku)) end\n if product.name then table.insert(product_details, 'nm' .. product.name) end\n if product.affiliation then table.insert(product_details, 'af' .. product.affiliation) end\n if product.coupon then table.insert(product_details, 'cp' .. product.coupon) end\n if product.discount then table.insert(product_details, 'ds' .. product.discount) end\n if product.position then table.insert(product_details, 'lp' .. product.position) end\n if product.brand then table.insert(product_details, 'br' .. product.brand) end\n if product.category then table.insert(product_details, 'ca' .. product.category) end\n if product.variant then table.insert(product_details, 'va' .. product.variant) end\n if product.price then table.insert(product_details, 'pr' .. product.price) end\n if product.quantity then table.insert(product_details, 'qt' .. product.quantity) end\n items[index] = JOIN(product_details, '~')\n end\nend\nreturn items"
409
+ }
410
+ ]
411
+ },
412
+ "checkout_started": {
413
+ "mappings": [
414
+ {
415
+ "inputKey": "properties.currency",
416
+ "outputKey": "cu",
417
+ "transforms": [
418
+ {
419
+ "modifyString": "uppercase"
420
+ }
421
+ ],
422
+ "defaultString": "USD"
423
+ },
424
+ {
425
+ "inputKey": "properties.order_id",
426
+ "outputKey": "ep-transaction_id"
427
+ },
428
+ {
429
+ "inputKey": "properties.coupon",
430
+ "outputKey": "ep-coupon"
431
+ },
432
+ {
433
+ "inputKey": "input",
434
+ "outputKey": "epn-value",
435
+ "transforms": [
436
+ {
437
+ "expression": {
438
+ "body": "return SUM(MAP(input.properties.products, function (p) return (p.price or 0) * (p.quantity or 1) end))",
439
+ "lang": "lua"
440
+ }
441
+ }
442
+ ]
443
+ },
444
+ {
445
+ "inputKey": "properties.tax",
446
+ "outputKey": "epn-tax"
447
+ },
448
+ {
449
+ "inputKey": "properties.shipping",
450
+ "outputKey": "epn-shipping"
451
+ }
452
+ ],
453
+ "enrichments": [
454
+ {
455
+ "outputKey": "en",
456
+ "staticString": "begin_checkout"
457
+ }
458
+ ],
459
+ "expressions": [
460
+ {
461
+ "lang": "lua",
462
+ "body": "local items = {}\nif (input.properties.products) then\n for inputIndex, product in pairs(input.properties.products) do\n local index = 'pr' .. inputIndex\n product_details = {}\n if (product.product_id or product.sku) then table.insert(product_details, 'id' .. (product.product_id or product.sku)) end\n if product.name then table.insert(product_details, 'nm' .. product.name) end\n if product.affiliation then table.insert(product_details, 'af' .. product.affiliation) end\n if product.coupon then table.insert(product_details, 'cp' .. product.coupon) end\n if product.discount then table.insert(product_details, 'ds' .. product.discount) end\n if product.position then table.insert(product_details, 'lp' .. product.position) end\n if product.brand then table.insert(product_details, 'br' .. product.brand) end\n if product.category then table.insert(product_details, 'ca' .. product.category) end\n if product.variant then table.insert(product_details, 'va' .. product.variant) end\n if product.price then table.insert(product_details, 'pr' .. product.price) end\n if product.quantity then table.insert(product_details, 'qt' .. product.quantity) end\n items[index] = JOIN(product_details, '~')\n end\nend\nreturn items"
463
+ }
464
+ ]
465
+ },
466
+ "payment_info_entered": {
467
+ "mappings": [
468
+ {
469
+ "inputKey": "properties.currency",
470
+ "outputKey": "cu",
471
+ "transforms": [
472
+ {
473
+ "modifyString": "uppercase"
474
+ }
475
+ ],
476
+ "defaultString": "USD"
477
+ },
478
+ {
479
+ "inputKey": "properties.coupon",
480
+ "outputKey": "ep-coupon"
481
+ },
482
+ {
483
+ "inputKey": "properties.payment_method",
484
+ "outputKey": "ep-payment_type"
485
+ },
486
+ {
487
+ "inputKey": "input",
488
+ "outputKey": "epn-value",
489
+ "transforms": [
490
+ {
491
+ "expression": {
492
+ "body": "return SUM(MAP(input.properties.products, function (p) return (p.price or 0) * (p.quantity or 1) end))",
493
+ "lang": "lua"
494
+ }
495
+ }
496
+ ]
497
+ }
498
+ ],
499
+ "enrichments": [
500
+ {
501
+ "outputKey": "en",
502
+ "staticString": "add_payment_info"
503
+ }
504
+ ],
505
+ "expressions": [
506
+ {
507
+ "lang": "lua",
508
+ "body": "local items = {}\nif (input.properties.products) then\n for inputIndex, product in pairs(input.properties.products) do\n local index = 'pr' .. inputIndex\n product_details = {}\n if (product.product_id or product.sku) then table.insert(product_details, 'id' .. (product.product_id or product.sku)) end\n if product.name then table.insert(product_details, 'nm' .. product.name) end\n if product.affiliation then table.insert(product_details, 'af' .. product.affiliation) end\n if product.coupon then table.insert(product_details, 'cp' .. product.coupon) end\n if product.discount then table.insert(product_details, 'ds' .. product.discount) end\n if product.position then table.insert(product_details, 'lp' .. product.position) end\n if product.brand then table.insert(product_details, 'br' .. product.brand) end\n if product.category then table.insert(product_details, 'ca' .. product.category) end\n if product.variant then table.insert(product_details, 'va' .. product.variant) end\n if product.price then table.insert(product_details, 'pr' .. product.price) end\n if product.quantity then table.insert(product_details, 'qt' .. product.quantity) end\n items[index] = JOIN(product_details, '~')\n end\nend\nreturn items"
509
+ }
510
+ ]
511
+ },
512
+ "order_completed": {
513
+ "mappings": [
514
+ {
515
+ "inputKey": "properties.currency",
516
+ "outputKey": "cu",
517
+ "transforms": [
518
+ {
519
+ "modifyString": "uppercase"
520
+ }
521
+ ],
522
+ "defaultString": "USD"
523
+ },
524
+ {
525
+ "inputKey": "properties.order_id",
526
+ "outputKey": "ep-transaction_id"
527
+ },
528
+ {
529
+ "inputKey": "properties.coupon",
530
+ "outputKey": "ep-coupon"
531
+ },
532
+ {
533
+ "inputKey": "input",
534
+ "outputKey": "epn-value",
535
+ "transforms": [
536
+ {
537
+ "expression": {
538
+ "body": "return SUM(MAP(input.properties.products, function (p) return (p.price or 0) * (p.quantity or 1) end))",
539
+ "lang": "lua"
540
+ }
541
+ }
542
+ ]
543
+ },
544
+ {
545
+ "inputKey": "properties.tax",
546
+ "outputKey": "epn-tax"
547
+ },
548
+ {
549
+ "inputKey": "properties.shipping",
550
+ "outputKey": "epn-shipping"
551
+ }
552
+ ],
553
+ "enrichments": [
554
+ {
555
+ "outputKey": "isConversion",
556
+ "staticBool": true
557
+ },
558
+ {
559
+ "outputKey": "en",
560
+ "staticString": "purchase"
561
+ }
562
+ ],
563
+ "expressions": [
564
+ {
565
+ "lang": "lua",
566
+ "body": "local items = {}\nif (input.properties.products) then\n for inputIndex, product in pairs(input.properties.products) do\n local index = 'pr' .. inputIndex\n product_details = {}\n if (product.product_id or product.sku) then table.insert(product_details, 'id' .. (product.product_id or product.sku)) end\n if product.name then table.insert(product_details, 'nm' .. product.name) end\n if product.affiliation then table.insert(product_details, 'af' .. product.affiliation) end\n if product.coupon then table.insert(product_details, 'cp' .. product.coupon) end\n if product.discount then table.insert(product_details, 'ds' .. product.discount) end\n if product.position then table.insert(product_details, 'lp' .. product.position) end\n if product.brand then table.insert(product_details, 'br' .. product.brand) end\n if product.category then table.insert(product_details, 'ca' .. product.category) end\n if product.variant then table.insert(product_details, 'va' .. product.variant) end\n if product.price then table.insert(product_details, 'pr' .. product.price) end\n if product.quantity then table.insert(product_details, 'qt' .. product.quantity) end\n items[index] = JOIN(product_details, '~')\n end\nend\nreturn items"
567
+ }
568
+ ]
569
+ },
570
+ "order_refunded": {
571
+ "mappings": [
572
+ {
573
+ "inputKey": "properties.currency",
574
+ "outputKey": "cu",
575
+ "transforms": [
576
+ {
577
+ "modifyString": "uppercase"
578
+ }
579
+ ],
580
+ "defaultString": "USD"
581
+ },
582
+ {
583
+ "inputKey": "properties.order_id",
584
+ "outputKey": "ep-transaction_id"
585
+ },
586
+ {
587
+ "inputKey": "properties.coupon",
588
+ "outputKey": "ep-coupon"
589
+ },
590
+ {
591
+ "inputKey": "input",
592
+ "outputKey": "epn-value",
593
+ "transforms": [
594
+ {
595
+ "expression": {
596
+ "body": "return SUM(MAP(input.properties.products, function (p) return (p.price or 0) * (p.quantity or 1) end))",
597
+ "lang": "lua"
598
+ }
599
+ }
600
+ ]
601
+ },
602
+ {
603
+ "inputKey": "properties.tax",
604
+ "outputKey": "epn-tax"
605
+ },
606
+ {
607
+ "inputKey": "properties.shipping",
608
+ "outputKey": "epn-shipping"
609
+ }
610
+ ],
611
+ "enrichments": [
612
+ {
613
+ "outputKey": "en",
614
+ "staticString": "refund"
615
+ }
616
+ ],
617
+ "expressions": [
618
+ {
619
+ "lang": "lua",
620
+ "body": "local items = {}\nif (input.properties.products) then\n for inputIndex, product in pairs(input.properties.products) do\n local index = 'pr' .. inputIndex\n product_details = {}\n if (product.product_id or product.sku) then table.insert(product_details, 'id' .. (product.product_id or product.sku)) end\n if product.name then table.insert(product_details, 'nm' .. product.name) end\n if product.affiliation then table.insert(product_details, 'af' .. product.affiliation) end\n if product.coupon then table.insert(product_details, 'cp' .. product.coupon) end\n if product.discount then table.insert(product_details, 'ds' .. product.discount) end\n if product.position then table.insert(product_details, 'lp' .. product.position) end\n if product.brand then table.insert(product_details, 'br' .. product.brand) end\n if product.category then table.insert(product_details, 'ca' .. product.category) end\n if product.variant then table.insert(product_details, 'va' .. product.variant) end\n if product.price then table.insert(product_details, 'pr' .. product.price) end\n if product.quantity then table.insert(product_details, 'qt' .. product.quantity) end\n items[index] = JOIN(product_details, '~')\n end\nend\nreturn items"
621
+ }
622
+ ]
623
+ },
624
+ "promotion_clicked": {
625
+ "mappings": [
626
+ {
627
+ "inputKey": "properties.creative",
628
+ "outputKey": "ep-creative_name"
629
+ },
630
+ {
631
+ "inputKey": "properties.position",
632
+ "outputKey": "ep-creative_slot"
633
+ },
634
+ {
635
+ "inputKey": "properties.promotion_id",
636
+ "outputKey": "ep-promotion_id"
637
+ },
638
+ {
639
+ "inputKey": "properties.name",
640
+ "outputKey": "ep-promotion_name"
641
+ }
642
+ ],
643
+ "enrichments": [
644
+ {
645
+ "outputKey": "en",
646
+ "staticString": "select_promotion"
647
+ }
648
+ ]
649
+ },
650
+ "promotion_viewed": {
651
+ "mappings": [
652
+ {
653
+ "inputKey": "properties.creative",
654
+ "outputKey": "ep-creative_name"
655
+ },
656
+ {
657
+ "inputKey": "properties.position",
658
+ "outputKey": "ep-creative_slot"
659
+ },
660
+ {
661
+ "inputKey": "properties.promotion_id",
662
+ "outputKey": "ep-promotion_id"
663
+ },
664
+ {
665
+ "inputKey": "properties.name",
666
+ "outputKey": "ep-promotion_name"
667
+ }
668
+ ],
669
+ "enrichments": [
670
+ {
671
+ "outputKey": "en",
672
+ "staticString": "view_promotion"
673
+ }
674
+ ]
675
+ }
676
+ }
677
+ }
@@ -1 +1 @@
1
- "e9270d14fcb8a03044e65cbd0d2de54b"
1
+ "941b0d0afdb4121d4339cabd20a8e5d1"