@metarouter/ajs-starter-kit 1.0.107 → 1.0.108

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 +1 @@
1
- "9950bbef42e82382c545c298996fe8ef"
1
+ "ce5f9b0337bc778fd4449449363e44a3"
@@ -32,6 +32,10 @@
32
32
  {
33
33
  "date": "2024-09-25T00:00:00.000Z",
34
34
  "note": "Version: 0.4.0\nAdding additional parameters\nAdding additional events:\n order completed\n cart viewed\n product added\n product removed\n product viewed"
35
+ },
36
+ {
37
+ "date": "2024-10-16T00:00:00.000Z",
38
+ "note": "Version: 0.5.0\nAdding additional parameters for missing reports:\n trackingCode\n siteSection\n referrer"
35
39
  }
36
40
  ]
37
41
  }
@@ -1 +1 @@
1
- "588702c0127eea405ad4e8b7c588a102"
1
+ "03308bad6d6b6bc728cccdccd58dbe58"
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.4.0",
2
+ "version": "0.5.0",
3
3
  "default": {
4
4
  "filters": [
5
5
  {
@@ -32,7 +32,7 @@
32
32
  "transforms": [
33
33
  {
34
34
  "expression": {
35
- "body": "local email = input.context.traits.email\nif email then\n return {{ id = TO_SHA256_HASH(LOWER(TRIM(email))), primary = false }}\nend\nreturn",
35
+ "body": "local email = input.traits.email or input.context.traits.email\nif email then\n return {{ id = TO_SHA256_HASH(LOWER(TRIM(email))), primary = false }}\nend\nreturn",
36
36
  "lang": "lua"
37
37
  }
38
38
  }
@@ -69,6 +69,10 @@
69
69
  {
70
70
  "inputKey": "context.ip",
71
71
  "outputKey": "event.xdm.environment.ipV4"
72
+ },
73
+ {
74
+ "inputKey": "context.campaign.name",
75
+ "outputKey": "event.xdm.marketing.trackingCode"
72
76
  }
73
77
  ]
74
78
  },
@@ -89,9 +93,17 @@
89
93
  "inputKey": "context.page.title",
90
94
  "outputKey": "event.xdm.web.webPageDetails.name"
91
95
  },
96
+ {
97
+ "inputKey": "properties.category",
98
+ "outputKey": "event.xdm.web.webPageDetails.siteSection"
99
+ },
92
100
  {
93
101
  "inputKey": "context.page.referrer",
94
102
  "outputKey": "event.data.prop1"
103
+ },
104
+ {
105
+ "inputKey": "context.page.referrer",
106
+ "outputKey": "event.xdm.web.webReferrer.URL"
95
107
  }
96
108
  ]
97
109
  },
@@ -1 +1 @@
1
- "e413e868ddbc12c84e8b7a74190589c0"
1
+ "79572c432e8a34693a36e5228b2a0697"
@@ -2,11 +2,16 @@
2
2
  "params": [
3
3
  {
4
4
  "name": "EVENT_API_KEY",
5
- "defaultValue": "my-event-api-key"
5
+ "exampleValue": "my-event-api-key"
6
+ },
7
+ {
8
+ "name": "API_BASE_URL",
9
+ "exampleValue": "my-api-base-url",
10
+ "defaultValue": "https://api.getblueshift.com"
6
11
  }
7
12
  ],
8
13
  "default": {
9
- "endpoint": "https://api.getblueshift.com/api/v1/bulkevents",
14
+ "endpoint": "$$API_BASE_URL$$/api/v1/bulkevents",
10
15
  "basicAuth": {
11
16
  "username": "$$EVENT_API_KEY$$"
12
17
  },
@@ -21,7 +26,7 @@
21
26
  }
22
27
  ],
23
28
  "method": "POST",
24
- "batchSize": 100,
29
+ "batchSize": 20,
25
30
  "transform": {
26
31
  "lang": "lua",
27
32
  "body": "request.body = { events = batch }\nreturn request"
@@ -1 +1 @@
1
- "24e695c1bec5fb3f139b8b5600d980b8"
1
+ "207166e7e8f3e6cf5ae79c6f472d5e1d"
@@ -36,6 +36,10 @@
36
36
  {
37
37
  "date": "2023-12-13T00:00:00.000Z",
38
38
  "note": "Marked as unstable version: 0.1.0"
39
+ },
40
+ {
41
+ "date": "2024-10-16T00:00:00.000Z",
42
+ "note": "Version: 0.2.0\nAdd mappings to playbook\nAdd tests"
39
43
  }
40
44
  ]
41
45
  }
@@ -1 +1 @@
1
- "f16c24c256a8b248553c8ae3bd5d5384"
1
+ "16fe8a88208a4afe094a992a29f3bfa7"
@@ -1,3 +1,499 @@
1
1
  {
2
- "version": "0.1.0"
2
+ "version": "0.2.0",
3
+ "global": {
4
+ "mappings": [
5
+ {
6
+ "inputKey": "timestamp",
7
+ "outputKey": "timestamp"
8
+ },
9
+ {
10
+ "inputKey": "context.ip",
11
+ "outputKey": "ip"
12
+ },
13
+ {
14
+ "inputKey": "traits.email",
15
+ "outputKey": "email"
16
+ },
17
+ {
18
+ "inputKey": "input",
19
+ "outputKey": "customer_id",
20
+ "transforms": [
21
+ {
22
+ "expression": {
23
+ "lang": "lua",
24
+ "body": "return input.userId or input.anonymousId"
25
+ }
26
+ }
27
+ ]
28
+ },
29
+ {
30
+ "inputKey": "anonymousId",
31
+ "outputKey": "cookie"
32
+ },
33
+ {
34
+ "inputKey": "context.userAgent",
35
+ "outputKey": "user_agent"
36
+ },
37
+ {
38
+ "inputKey": "input",
39
+ "outputKey": "device_id",
40
+ "transforms": [
41
+ {
42
+ "expression": {
43
+ "lang": "lua",
44
+ "body": "if input.context.device.adTrackingEnabled then\n return input.context.device.advertisingId\nend\nreturn input.anonymousId"
45
+ }
46
+ }
47
+ ]
48
+ }
49
+ ]
50
+ },
51
+ "default": {
52
+ "mappings": [
53
+ {
54
+ "inputKey": "input",
55
+ "outputKey": "event",
56
+ "transforms": [
57
+ {
58
+ "expression": {
59
+ "lang": "lua",
60
+ "body": "if input.type == \"track\" then\n return input.event\nend\nreturn input.type"
61
+ }
62
+ }
63
+ ]
64
+ }
65
+ ],
66
+ "expressions": [
67
+ {
68
+ "lang": "lua",
69
+ "body": "return input.properties"
70
+ }
71
+ ]
72
+ },
73
+ "eventSpecific": {
74
+ "page": {
75
+ "enrichments": [
76
+ {
77
+ "staticString": "pageload",
78
+ "outputKey": "event"
79
+ }
80
+ ],
81
+ "mappings": [
82
+ {
83
+ "inputKey": "context.page.url",
84
+ "outputKey": "url"
85
+ },
86
+ {
87
+ "inputKey": "context.page.referrer",
88
+ "outputKey": "referrer"
89
+ },
90
+ {
91
+ "inputKey": "properties.category",
92
+ "outputKey": "category"
93
+ },
94
+ {
95
+ "inputKey": "properties.name",
96
+ "outputKey": "name"
97
+ }
98
+ ]
99
+ },
100
+ "identify": {
101
+ "enrichments": [
102
+ {
103
+ "staticString": "identify",
104
+ "outputKey": "event"
105
+ }
106
+ ],
107
+ "mappings": [
108
+ {
109
+ "inputKey": "traits.firstName",
110
+ "outputKey": "firstname"
111
+ },
112
+ {
113
+ "inputKey": "traits.lastName",
114
+ "outputKey": "lastname"
115
+ },
116
+ {
117
+ "inputKey": "traits.gender",
118
+ "outputKey": "gender"
119
+ },
120
+ {
121
+ "inputKey": "traits.createdAt",
122
+ "outputKey": "joined_at"
123
+ },
124
+ {
125
+ "inputKey": "traits.phone",
126
+ "outputKey": "phone_number"
127
+ },
128
+ {
129
+ "inputKey": "input",
130
+ "outputKey": "birth_year",
131
+ "transforms": [
132
+ {
133
+ "expression": {
134
+ "lang": "lua",
135
+ "body": "local birthday = input.traits.birthday or input.context.traits.birthday\nif birthday then\n return tonumber(SPLIT(input.traits.birthday, \"-\", 1)[1])\nend"
136
+ }
137
+ }
138
+ ]
139
+ },
140
+ {
141
+ "inputKey": "input",
142
+ "outputKey": "birth_month",
143
+ "transforms": [
144
+ {
145
+ "expression": {
146
+ "lang": "lua",
147
+ "body": "local birthday = input.traits.birthday or input.context.traits.birthday\nif birthday then\n return tonumber(SPLIT(input.traits.birthday, \"-\", 2)[2])\nend"
148
+ }
149
+ }
150
+ ]
151
+ },
152
+ {
153
+ "inputKey": "input",
154
+ "outputKey": "birth_dayofmonth",
155
+ "transforms": [
156
+ {
157
+ "expression": {
158
+ "lang": "lua",
159
+ "body": "local birthday = input.traits.birthday or input.context.traits.birthday\nif birthday then\n return tonumber(SPLIT(SPLIT(input.traits.birthday, \"-\", 3)[3], \"T\", 1)[1])\nend"
160
+ }
161
+ }
162
+ ]
163
+ },
164
+ {
165
+ "inputKey": "traits.address",
166
+ "outputKey": "address"
167
+ },
168
+ {
169
+ "inputKey": "traits.age",
170
+ "outputKey": "age"
171
+ },
172
+ {
173
+ "inputKey": "traits.avatar",
174
+ "outputKey": "avatar"
175
+ },
176
+ {
177
+ "inputKey": "traits.company",
178
+ "outputKey": "company"
179
+ },
180
+ {
181
+ "inputKey": "traits.description",
182
+ "outputKey": "description"
183
+ },
184
+ {
185
+ "inputKey": "traits.id",
186
+ "outputKey": "id"
187
+ },
188
+ {
189
+ "inputKey": "traits.name",
190
+ "outputKey": "name"
191
+ },
192
+ {
193
+ "inputKey": "traits.title",
194
+ "outputKey": "title"
195
+ },
196
+ {
197
+ "inputKey": "traits.username",
198
+ "outputKey": "username"
199
+ },
200
+ {
201
+ "inputKey": "traits.website",
202
+ "outputKey": "website"
203
+ }
204
+ ]
205
+ },
206
+ "product_viewed": {
207
+ "enrichments": [
208
+ {
209
+ "staticString": "view",
210
+ "outputKey": "event"
211
+ }
212
+ ],
213
+ "mappings": [
214
+ {
215
+ "inputKey": "input",
216
+ "outputKey": "product_id",
217
+ "transforms": [
218
+ {
219
+ "expression": {
220
+ "lang": "lua",
221
+ "body": "if input.properties.product_id then\n return input.properties.product_id\nend\nreturn input.properties.sku"
222
+ }
223
+ }
224
+ ]
225
+ },
226
+ {
227
+ "inputKey": "properties.name",
228
+ "outputKey": "title"
229
+ },
230
+ {
231
+ "inputKey": "properties.url",
232
+ "outputKey": "web_link"
233
+ },
234
+ {
235
+ "inputKey": "properties.image_url",
236
+ "outputKey": "image"
237
+ },
238
+ {
239
+ "inputKey": "properties.price",
240
+ "outputKey": "price"
241
+ },
242
+ {
243
+ "inputKey": "input",
244
+ "outputKey": "category",
245
+ "transforms": [
246
+ {
247
+ "expression": {
248
+ "lang": "lua",
249
+ "body": "return { input.properties.category }"
250
+ }
251
+ }
252
+ ]
253
+ },
254
+ {
255
+ "inputKey": "properties.brand",
256
+ "outputKey": "brand"
257
+ },
258
+ {
259
+ "inputKey": "properties.sku",
260
+ "outputKey": "parent_sku"
261
+ },
262
+ {
263
+ "inputKey": "properties.variant",
264
+ "outputKey": "variant"
265
+ },
266
+ {
267
+ "inputKey": "properties.quantity",
268
+ "outputKey": "quantity"
269
+ },
270
+ {
271
+ "inputKey": "properties.coupon",
272
+ "outputKey": "coupon"
273
+ },
274
+ {
275
+ "inputKey": "properties.currency",
276
+ "outputKey": "currency"
277
+ },
278
+ {
279
+ "inputKey": "properties.position",
280
+ "outputKey": "position"
281
+ },
282
+ {
283
+ "inputKey": "properties.value",
284
+ "outputKey": "value"
285
+ }
286
+ ]
287
+ },
288
+ "product_added": {
289
+ "enrichments": [
290
+ {
291
+ "staticString": "add_to_cart",
292
+ "outputKey": "event"
293
+ }
294
+ ],
295
+ "mappings": [
296
+ {
297
+ "inputKey": "properties.cart_id",
298
+ "outputKey": "cart_id"
299
+ },
300
+ {
301
+ "inputKey": "input",
302
+ "outputKey": "product_id",
303
+ "transforms": [
304
+ {
305
+ "expression": {
306
+ "lang": "lua",
307
+ "body": "if input.properties.product_id then\n return input.properties.product_id\nend\nreturn input.properties.sku"
308
+ }
309
+ }
310
+ ]
311
+ },
312
+ {
313
+ "inputKey": "properties.name",
314
+ "outputKey": "title"
315
+ },
316
+ {
317
+ "inputKey": "properties.url",
318
+ "outputKey": "web_link"
319
+ },
320
+ {
321
+ "inputKey": "properties.image_url",
322
+ "outputKey": "image"
323
+ },
324
+ {
325
+ "inputKey": "properties.price",
326
+ "outputKey": "price"
327
+ },
328
+ {
329
+ "inputKey": "input",
330
+ "outputKey": "category",
331
+ "transforms": [
332
+ {
333
+ "expression": {
334
+ "lang": "lua",
335
+ "body": "return { input.properties.category }"
336
+ }
337
+ }
338
+ ]
339
+ },
340
+ {
341
+ "inputKey": "properties.brand",
342
+ "outputKey": "brand"
343
+ },
344
+ {
345
+ "inputKey": "properties.sku",
346
+ "outputKey": "parent_sku"
347
+ },
348
+ {
349
+ "inputKey": "properties.variant",
350
+ "outputKey": "variant"
351
+ },
352
+ {
353
+ "inputKey": "properties.quantity",
354
+ "outputKey": "quantity"
355
+ },
356
+ {
357
+ "inputKey": "properties.coupon",
358
+ "outputKey": "coupon"
359
+ },
360
+ {
361
+ "inputKey": "properties.position",
362
+ "outputKey": "position"
363
+ }
364
+ ]
365
+ },
366
+ "product_removed": {
367
+ "enrichments": [
368
+ {
369
+ "staticString": "remove_from_cart",
370
+ "outputKey": "event"
371
+ }
372
+ ],
373
+ "mappings": [
374
+ {
375
+ "inputKey": "properties.cart_id",
376
+ "outputKey": "cart_id"
377
+ },
378
+ {
379
+ "inputKey": "input",
380
+ "outputKey": "product_id",
381
+ "transforms": [
382
+ {
383
+ "expression": {
384
+ "lang": "lua",
385
+ "body": "if input.properties.product_id then\n return input.properties.product_id\nend\nreturn input.properties.sku"
386
+ }
387
+ }
388
+ ]
389
+ },
390
+ {
391
+ "inputKey": "properties.name",
392
+ "outputKey": "title"
393
+ },
394
+ {
395
+ "inputKey": "properties.url",
396
+ "outputKey": "web_link"
397
+ },
398
+ {
399
+ "inputKey": "properties.image_url",
400
+ "outputKey": "image"
401
+ },
402
+ {
403
+ "inputKey": "properties.price",
404
+ "outputKey": "price"
405
+ },
406
+ {
407
+ "inputKey": "input",
408
+ "outputKey": "category",
409
+ "transforms": [
410
+ {
411
+ "expression": {
412
+ "lang": "lua",
413
+ "body": "return { input.properties.category }"
414
+ }
415
+ }
416
+ ]
417
+ },
418
+ {
419
+ "inputKey": "properties.brand",
420
+ "outputKey": "brand"
421
+ },
422
+ {
423
+ "inputKey": "properties.sku",
424
+ "outputKey": "parent_sku"
425
+ },
426
+ {
427
+ "inputKey": "properties.variant",
428
+ "outputKey": "variant"
429
+ },
430
+ {
431
+ "inputKey": "properties.quantity",
432
+ "outputKey": "quantity"
433
+ },
434
+ {
435
+ "inputKey": "properties.coupon",
436
+ "outputKey": "coupon"
437
+ },
438
+ {
439
+ "inputKey": "properties.position",
440
+ "outputKey": "position"
441
+ }
442
+ ]
443
+ },
444
+ "checkout_started": {
445
+ "enrichments": [
446
+ {
447
+ "staticString": "checkout",
448
+ "outputKey": "event"
449
+ }
450
+ ],
451
+ "mappings": [
452
+ {
453
+ "inputKey": "properties.value",
454
+ "outputKey": "total"
455
+ },
456
+ {
457
+ "inputKey": "input",
458
+ "outputKey": "products",
459
+ "transforms": [
460
+ {
461
+ "expression": {
462
+ "lang": "lua",
463
+ "body": "local function get_content(p)\nlocal p_product_id = p.product_id\nif p.product_id == nil then\n p_product_id = p.sku\nend\nreturn {\n product_id = p_product_id,\n name = p.name,\n web_link = p.url,\n image = p.image_url,\n price = p.price,\n category = { p.category },\n brand = p.brand,\n parent_sku = p.sku,\n sku = p.sku,\n variant = p.variant,\n quantity = p.quantity,\n coupon = p.coupon,\n position = p.position\n}\nend\nlocal prods = input.properties.products or {input.properties}\nreturn MAP(prods, get_content)"
464
+ }
465
+ }
466
+ ]
467
+ }
468
+ ]
469
+ },
470
+ "order_completed": {
471
+ "enrichments": [
472
+ {
473
+ "staticString": "purchase",
474
+ "outputKey": "event"
475
+ }
476
+ ],
477
+ "expressions": [
478
+ {
479
+ "lang": "lua",
480
+ "body": "return input.properties"
481
+ }
482
+ ]
483
+ },
484
+ "products_searched": {
485
+ "enrichments": [
486
+ {
487
+ "staticString": "search",
488
+ "outputKey": "event"
489
+ }
490
+ ],
491
+ "mappings": [
492
+ {
493
+ "inputKey": "properties.query",
494
+ "outputKey": "keywords"
495
+ }
496
+ ]
497
+ }
498
+ }
3
499
  }
package/README.md CHANGED
@@ -6,11 +6,12 @@ server, and other sources. It is particularly useful for tracking the pages or s
6
6
  users visit, the actions they take on your property, and whether the user has been identified
7
7
  previously.
8
8
  ## 2024-10
9
+ - Adobe Analytics - Experience (BETA)
10
+ - Blueshift (BETA)
9
11
  - Google Analytics
10
12
 
11
13
  ## 2024-09
12
14
  - ActionIQ
13
- - Adobe Analytics - Experience (BETA)
14
15
  - CM360 - Floodlights (BETA)
15
16
  - Iterable (BETA)
16
17
  - TikTok
@@ -72,7 +73,6 @@ previously.
72
73
  - Amplitude
73
74
  - Microsoft Advertising (BETA)
74
75
  - Bloomreach CDP
75
- - Blueshift (BETA)
76
76
  - Braze
77
77
  - Convert (BETA)
78
78
  - Customer.io
@@ -98,9 +98,10 @@ previously.
98
98
 
99
99
  | Kit Name | Date | Latest Note |
100
100
  |----------|------|-------------|
101
+ | Adobe Analytics - Experience (BETA) | 2024-10 | Version: 0.5.0 Adding additional parameters for missing reports: trackingCode siteSection referrer |
102
+ | Blueshift (BETA) | 2024-10 | Version: 0.2.0 Add mappings to playbook Add tests |
101
103
  | Google Analytics | 2024-10 | Deprecating kit |
102
104
  | ActionIQ | 2024-09 | Version: 1.1.0 Added endpoint details for screen events Added screen event mappings to the playbook |
103
- | Adobe Analytics - Experience (BETA) | 2024-09 | Version: 0.4.0 Adding additional parameters Adding additional events: order completed cart viewed product added product removed product viewed |
104
105
  | CM360 - Floodlights (BETA) | 2024-09 | Version 0.4.0 Friendly name renaming Description and color updated |
105
106
  | Iterable (BETA) | 2024-09 | Version: 0.1.0 Beta Version Iterable initial release |
106
107
  | TikTok | 2024-09 | Version: 2.1.0 Stable release |
@@ -146,7 +147,6 @@ previously.
146
147
  | Amplitude | 2023-12 | Marked as stable version: 1.0.0 |
147
148
  | Microsoft Advertising (BETA) | 2023-12 | Marked as unstable version: 0.1.0 |
148
149
  | Bloomreach CDP | 2023-12 | Marked as stable version: 1.0.0 |
149
- | Blueshift (BETA) | 2023-12 | Marked as unstable version: 0.1.0 |
150
150
  | Braze | 2023-12 | Marked as stable version: 1.0.0 |
151
151
  | Convert (BETA) | 2023-12 | Marked as unstable version: 0.1.0 |
152
152
  | Customer.io | 2023-12 | Marked as stable version: 1.0.0 |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metarouter/ajs-starter-kit",
3
- "version": "1.0.107",
3
+ "version": "1.0.108",
4
4
  "description": "MetaRouter analytics.js starter kit",
5
5
  "main": "index.js",
6
6
  "scripts": {