@metarouter/ajs-starter-kit 1.0.32 → 1.0.35

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 (41) hide show
  1. package/.dist/actioniq/endpoint_schema.etag.json +1 -1
  2. package/.dist/actioniq/endpoint_schema.json +18 -3
  3. package/.dist/actioniq/kit.etag.json +1 -1
  4. package/.dist/actioniq/metadata.json +4 -0
  5. package/.dist/amplitude/endpoint_schema.etag.json +1 -1
  6. package/.dist/amplitude/endpoint_schema.json +12 -1
  7. package/.dist/amplitude/kit.etag.json +1 -1
  8. package/.dist/amplitude/metadata.json +4 -0
  9. package/.dist/amplitude/playbook.etag.json +1 -1
  10. package/.dist/amplitude/playbook.json +769 -89
  11. package/.dist/blueshift/endpoint_schema.etag.json +1 -1
  12. package/.dist/blueshift/endpoint_schema.json +7 -2
  13. package/.dist/blueshift/kit.etag.json +1 -1
  14. package/.dist/blueshift/metadata.json +4 -0
  15. package/.dist/braze/endpoint_schema.etag.json +1 -1
  16. package/.dist/braze/endpoint_schema.json +41 -1
  17. package/.dist/braze/kit.etag.json +1 -1
  18. package/.dist/braze/metadata.json +4 -0
  19. package/.dist/braze/playbook.etag.json +1 -1
  20. package/.dist/braze/playbook.json +217 -22
  21. package/.dist/connection-schemas.json +12 -0
  22. package/.dist/facebook-pixel/endpoint_schema.etag.json +1 -1
  23. package/.dist/facebook-pixel/endpoint_schema.json +7 -2
  24. package/.dist/facebook-pixel/kit.etag.json +1 -1
  25. package/.dist/facebook-pixel/metadata.json +8 -0
  26. package/.dist/facebook-pixel/playbook.etag.json +1 -1
  27. package/.dist/facebook-pixel/playbook.json +321 -24
  28. package/.dist/mixpanel/endpoint_schema.etag.json +1 -0
  29. package/.dist/mixpanel/endpoint_schema.json +39 -0
  30. package/.dist/mixpanel/kit.etag.json +1 -0
  31. package/.dist/mixpanel/metadata.json +19 -0
  32. package/.dist/mixpanel/playbook.etag.json +1 -0
  33. package/.dist/mixpanel/playbook.json +71 -0
  34. package/.dist/roomvo/endpoint_schema.etag.json +1 -1
  35. package/.dist/roomvo/endpoint_schema.json +5 -0
  36. package/.dist/roomvo/kit.etag.json +1 -1
  37. package/.dist/roomvo/metadata.json +4 -0
  38. package/.dist/roomvo/playbook.etag.json +1 -1
  39. package/.dist/roomvo/playbook.json +31 -1
  40. package/index.js +15 -4
  41. package/package.json +1 -1
@@ -16,51 +16,155 @@
16
16
  ]
17
17
  }
18
18
  }
19
+ ],
20
+ "enrichments": [
21
+ {
22
+ "staticString": "website",
23
+ "outputKey": "action_source"
24
+ },
25
+ {
26
+ "timestamp": "seconds",
27
+ "outputKey": "event_time"
28
+ }
29
+ ],
30
+ "mappings": [
31
+ {
32
+ "inputKey": "input",
33
+ "outputKey": "user_data.em",
34
+ "transforms": [
35
+ {
36
+ "expression": {
37
+ "lang": "lua",
38
+ "body": "return TO_SHA256_HASH(LOWER(TRIM(input.context.traits.email)))"
39
+ }
40
+ }
41
+ ]
42
+ },
43
+ {
44
+ "inputKey": "messageId",
45
+ "outputKey": "event_id"
46
+ },
47
+ {
48
+ "inputKey": "context.page.url",
49
+ "outputKey": "event_source_url"
50
+ },
51
+ {
52
+ "inputKey": "context.ip",
53
+ "outputKey": "user_data.client_ip_address"
54
+ },
55
+ {
56
+ "inputKey": "context.userAgent",
57
+ "outputKey": "user_data.client_user_agent"
58
+ },
59
+ {
60
+ "inputKey": "anonymousId",
61
+ "outputKey": "user_data.external_id"
62
+ },
63
+ {
64
+ "inputKey": "context.providers.facebookPixel.fbc",
65
+ "outputKey": "user_data.fbc"
66
+ },
67
+ {
68
+ "inputKey": "context.providers.facebookPixel.fbp",
69
+ "outputKey": "user_data.fbp"
70
+ }
19
71
  ]
20
72
  },
21
73
  "eventSpecific": {
22
74
  "page": {
75
+ "enrichments": [
76
+ {
77
+ "staticString": "PageView",
78
+ "outputKey": "event_name"
79
+ }
80
+ ],
23
81
  "mappings": [
82
+ {
83
+ "inputKey": "properties.category",
84
+ "outputKey": "custom_data.content_category"
85
+ },
86
+ {
87
+ "inputKey": "properties.name",
88
+ "outputKey": "custom_data.content_name"
89
+ }
90
+ ]
91
+ },
92
+ "products_searched": {
93
+ "enrichments": [
94
+ {
95
+ "staticString": "Search",
96
+ "outputKey": "event_name"
97
+ }
98
+ ],
99
+ "mappings": [
100
+ {
101
+ "inputKey": "properties.query",
102
+ "outputKey": "custom_data.search_string"
103
+ }
104
+ ]
105
+ },
106
+ "product_viewed": {
107
+ "enrichments": [
108
+ {
109
+ "staticString": "ViewContent",
110
+ "outputKey": "event_name"
111
+ },
112
+ {
113
+ "staticString": "product",
114
+ "outputKey": "custom_data.content_type"
115
+ }
116
+ ],
117
+ "mappings": [
118
+ {
119
+ "inputKey": "properties.category",
120
+ "outputKey": "custom_data.content_category"
121
+ },
122
+ {
123
+ "inputKey": "properties.name",
124
+ "outputKey": "custom_data.content_name"
125
+ },
24
126
  {
25
127
  "inputKey": "input",
26
- "outputKey": "data",
128
+ "outputKey": "custom_data.content_ids",
27
129
  "transforms": [
28
130
  {
29
131
  "expression": {
30
132
  "lang": "lua",
31
- "body": "local userData = {\n client_ip_address=input.context.ip,\n client_user_agent=input.context.userAgent,\n fbc=input.context.providers.facebookPixel.fbc,\n fbp=input.context.providers.facebookPixel.fbp,\n external_id=input.anonymousId,\n em=TO_SHA256_HASH(LOWER(TRIM(input.context.traits.email)))\n}\nlocal customData = {\n content_category=input.properties.category,\n content_name=input.properties.name\n}\nlocal data = {\n action_source='website',\n event_id=input.messageId,\n event_source_url=input.context.page.url,\n event_name='PageView',\n event_time=SECONDS_SINCE_EPOCH(),\n user_data=userData,\n custom_data=customData\n}\nreturn { data }"
133
+ "body": "return { input.properties.product_id }"
32
134
  }
33
135
  }
34
136
  ]
35
- }
36
- ]
37
- },
38
- "products_searched": {
39
- "mappings": [
137
+ },
138
+ {
139
+ "inputKey": "properties.currency",
140
+ "outputKey": "custom_data.currency",
141
+ "transforms": [
142
+ {
143
+ "modifyString": "uppercase"
144
+ }
145
+ ],
146
+ "defaultString": "USD"
147
+ },
40
148
  {
41
149
  "inputKey": "input",
42
- "outputKey": "data",
150
+ "outputKey": "custom_data.value",
43
151
  "transforms": [
44
152
  {
45
153
  "expression": {
46
154
  "lang": "lua",
47
- "body": "local userData = {\n client_ip_address=input.context.ip,\n client_user_agent=input.context.userAgent,\n fbc=input.context.providers.facebookPixel.fbc,\n fbp=input.context.providers.facebookPixel.fbp,\n external_id=input.anonymousId,\n em=TO_SHA256_HASH(LOWER(TRIM(input.context.traits.email)))\n}\nlocal customData = {\n search_string=input.properties.query\n}\nlocal data = {\n action_source='website',\n event_id=input.messageId,\n event_source_url=input.context.page.url,\n event_name='Search',\n event_time=SECONDS_SINCE_EPOCH(),\n user_data=userData,\n custom_data=customData\n}\nreturn { data }"
155
+ "body": "return input.properties.price * (input.properties.quantity or 1)"
48
156
  }
49
157
  }
50
158
  ]
51
- }
52
- ]
53
- },
54
- "product_viewed": {
55
- "mappings": [
159
+ },
56
160
  {
57
161
  "inputKey": "input",
58
- "outputKey": "data",
162
+ "outputKey": "custom_data.contents",
59
163
  "transforms": [
60
164
  {
61
165
  "expression": {
62
166
  "lang": "lua",
63
- "body": "local userData = {\n client_ip_address=input.context.ip,\n client_user_agent=input.context.userAgent,\n fbc=input.context.providers.facebookPixel.fbc,\n fbp=input.context.providers.facebookPixel.fbp,\n external_id=input.anonymousId,\n em=TO_SHA256_HASH(LOWER(TRIM(input.context.traits.email)))\n}\nlocal customData = {\n content_ids={ input.properties.product_id } or {},\n content_category=input.properties.category,\n content_name=input.properties.name,\n content_type='product',\n contents={{\n id=input.properties.product_id,\n quantity=input.properties.quantity or 1,\n item_price=input.properties.price\n }},\n currency=UPPER(input.properties.currency) or 'USD',\n value=input.properties.price * (input.properties.quantity or 1)\n}\nlocal data = {\n action_source='website',\n event_id=input.messageId,\n event_source_url=input.context.page.url,\n event_name='ViewContent',\n event_time=SECONDS_SINCE_EPOCH(),\n user_data=userData,\n custom_data=customData\n}\nreturn { data }"
167
+ "body": "return {{\n id=input.properties.product_id,\n quantity=input.properties.quantity or 1,\n item_price=input.properties.price\n}}"
64
168
  }
65
169
  }
66
170
  ]
@@ -68,15 +172,66 @@
68
172
  ]
69
173
  },
70
174
  "product_list_viewed": {
175
+ "enrichments": [
176
+ {
177
+ "staticString": "ViewContent",
178
+ "outputKey": "event_name"
179
+ },
180
+ {
181
+ "staticString": "product",
182
+ "outputKey": "custom_data.content_type"
183
+ }
184
+ ],
71
185
  "mappings": [
186
+ {
187
+ "inputKey": "properties.category",
188
+ "outputKey": "custom_data.content_category"
189
+ },
190
+ {
191
+ "inputKey": "properties.list_id",
192
+ "outputKey": "custom_data.content_name"
193
+ },
194
+ {
195
+ "inputKey": "properties.products",
196
+ "outputKey": "custom_data.content_ids",
197
+ "transforms": [
198
+ {
199
+ "pluckValues": {
200
+ "extractKey": "product_id"
201
+ }
202
+ }
203
+ ]
204
+ },
205
+ {
206
+ "inputKey": "properties.currency",
207
+ "outputKey": "custom_data.currency",
208
+ "transforms": [
209
+ {
210
+ "modifyString": "uppercase"
211
+ }
212
+ ],
213
+ "defaultString": "USD"
214
+ },
215
+ {
216
+ "inputKey": "input",
217
+ "outputKey": "custom_data.value",
218
+ "transforms": [
219
+ {
220
+ "expression": {
221
+ "lang": "lua",
222
+ "body": "return SUM(MAP(input.properties.products, function (p) return p.price * (p.quantity or 1) end))"
223
+ }
224
+ }
225
+ ]
226
+ },
72
227
  {
73
228
  "inputKey": "input",
74
- "outputKey": "data",
229
+ "outputKey": "custom_data.contents",
75
230
  "transforms": [
76
231
  {
77
232
  "expression": {
78
233
  "lang": "lua",
79
- "body": "local userData = {\n client_ip_address=input.context.ip,\n client_user_agent=input.context.userAgent,\n fbc=input.context.providers.facebookPixel.fbc,\n fbp=input.context.providers.facebookPixel.fbp,\n external_id=input.anonymousId,\n em=TO_SHA256_HASH(LOWER(TRIM(input.context.traits.email)))\n}\nlocal customData = {\n content_ids=PLUCK(input.properties.products, 'product_id') or {},\n content_category=input.properties.category,\n content_name=input.properties.list_id,\n content_type='product',\n contents=MAP(\n input.properties.products,\n function (p)\n return {\n id=p.product_id,\n quantity=p.quantity or 1,\n item_price=p.price\n }\n end\n ),\n currency=UPPER(input.properties.currency) or 'USD',\n value=SUM(MAP(input.properties.products, function (p) return p.price * (p.quantity or 1) end))\n}\nlocal data = {\n action_source='website',\n event_id=input.messageId,\n event_source_url=input.context.page.url,\n event_name='ViewContent',\n event_time=SECONDS_SINCE_EPOCH(),\n user_data=userData,\n custom_data=customData\n}\nreturn { data }"
234
+ "body": "return MAP(\n input.properties.products,\n function (p)\n return {\n id=p.product_id,\n quantity=p.quantity or 1,\n item_price=p.price\n }\n end\n)"
80
235
  }
81
236
  }
82
237
  ]
@@ -84,15 +239,67 @@
84
239
  ]
85
240
  },
86
241
  "product_added": {
242
+ "enrichments": [
243
+ {
244
+ "staticString": "AddToCart",
245
+ "outputKey": "event_name"
246
+ },
247
+ {
248
+ "staticString": "product",
249
+ "outputKey": "custom_data.content_type"
250
+ }
251
+ ],
87
252
  "mappings": [
253
+ {
254
+ "inputKey": "properties.category",
255
+ "outputKey": "custom_data.content_category"
256
+ },
257
+ {
258
+ "inputKey": "properties.name",
259
+ "outputKey": "custom_data.content_name"
260
+ },
261
+ {
262
+ "inputKey": "input",
263
+ "outputKey": "custom_data.content_ids",
264
+ "transforms": [
265
+ {
266
+ "expression": {
267
+ "lang": "lua",
268
+ "body": "return { input.properties.product_id }"
269
+ }
270
+ }
271
+ ]
272
+ },
273
+ {
274
+ "inputKey": "properties.currency",
275
+ "outputKey": "custom_data.currency",
276
+ "transforms": [
277
+ {
278
+ "modifyString": "uppercase"
279
+ }
280
+ ],
281
+ "defaultString": "USD"
282
+ },
88
283
  {
89
284
  "inputKey": "input",
90
- "outputKey": "data",
285
+ "outputKey": "custom_data.value",
91
286
  "transforms": [
92
287
  {
93
288
  "expression": {
94
289
  "lang": "lua",
95
- "body": "local userData = {\n client_ip_address=input.context.ip,\n client_user_agent=input.context.userAgent,\n fbc=input.context.providers.facebookPixel.fbc,\n fbp=input.context.providers.facebookPixel.fbp,\n external_id=input.anonymousId,\n em=TO_SHA256_HASH(LOWER(TRIM(input.context.traits.email)))\n}\nlocal customData = {\n content_ids={ input.properties.product_id } or {},\n content_category=input.properties.category,\n content_name=input.properties.name,\n content_type='product',\n contents={{\n id=input.properties.product_id,\n quantity=input.properties.quantity or 1,\n item_price=input.properties.price\n }},\n currency=UPPER(input.properties.currency) or 'USD',\n value=input.properties.price * (input.properties.quantity or 1)\n}\nlocal data = {\n action_source='website',\n event_id=input.messageId,\n event_source_url=input.context.page.url,\n event_name='AddToCart',\n event_time=SECONDS_SINCE_EPOCH(),\n user_data=userData,\n custom_data=customData\n}\nreturn { data }"
290
+ "body": "return input.properties.price * (input.properties.quantity or 1)"
291
+ }
292
+ }
293
+ ]
294
+ },
295
+ {
296
+ "inputKey": "input",
297
+ "outputKey": "custom_data.contents",
298
+ "transforms": [
299
+ {
300
+ "expression": {
301
+ "lang": "lua",
302
+ "body": "return {{\n id=input.properties.product_id,\n quantity=input.properties.quantity or 1,\n item_price=input.properties.price\n}}"
96
303
  }
97
304
  }
98
305
  ]
@@ -100,15 +307,58 @@
100
307
  ]
101
308
  },
102
309
  "cart_viewed": {
310
+ "enrichments": [
311
+ {
312
+ "staticString": "ViewContent",
313
+ "outputKey": "event_name"
314
+ },
315
+ {
316
+ "staticString": "product",
317
+ "outputKey": "custom_data.content_type"
318
+ }
319
+ ],
103
320
  "mappings": [
321
+ {
322
+ "inputKey": "properties.products",
323
+ "outputKey": "custom_data.content_ids",
324
+ "transforms": [
325
+ {
326
+ "pluckValues": {
327
+ "extractKey": "product_id"
328
+ }
329
+ }
330
+ ]
331
+ },
332
+ {
333
+ "inputKey": "properties.currency",
334
+ "outputKey": "custom_data.currency",
335
+ "transforms": [
336
+ {
337
+ "modifyString": "uppercase"
338
+ }
339
+ ],
340
+ "defaultString": "USD"
341
+ },
342
+ {
343
+ "inputKey": "input",
344
+ "outputKey": "custom_data.value",
345
+ "transforms": [
346
+ {
347
+ "expression": {
348
+ "lang": "lua",
349
+ "body": "return SUM(MAP(input.properties.products, function (p) return p.price * (p.quantity or 1) end))"
350
+ }
351
+ }
352
+ ]
353
+ },
104
354
  {
105
355
  "inputKey": "input",
106
- "outputKey": "data",
356
+ "outputKey": "custom_data.contents",
107
357
  "transforms": [
108
358
  {
109
359
  "expression": {
110
360
  "lang": "lua",
111
- "body": "local userData = {\n client_ip_address=input.context.ip,\n client_user_agent=input.context.userAgent,\n fbc=input.context.providers.facebookPixel.fbc,\n fbp=input.context.providers.facebookPixel.fbp,\n external_id=input.anonymousId,\n em=TO_SHA256_HASH(LOWER(TRIM(input.context.traits.email)))\n}\nlocal customData = {\n content_ids=PLUCK(input.properties.products, 'product_id') or {},\n content_type='product',\n contents=MAP(\n input.properties.products,\n function (p)\n return {\n id=p.product_id,\n quantity=p.quantity or 1,\n item_price=p.price\n }\n end\n ),\n currency=UPPER(input.properties.currency) or 'USD',\n value=SUM(MAP(input.properties.products, function (p) return p.price * (p.quantity or 1) end))\n}\nlocal data = {\n action_source='website',\n event_id=input.messageId,\n event_source_url=input.context.page.url,\n event_name='ViewContent',\n event_time=SECONDS_SINCE_EPOCH(),\n user_data=userData,\n custom_data=customData\n}\nreturn { data }"
361
+ "body": "return MAP(\n input.properties.products,\n function (p)\n return {\n id=p.product_id,\n quantity=p.quantity or 1,\n item_price=p.price\n }\n end\n)"
112
362
  }
113
363
  }
114
364
  ]
@@ -116,18 +366,65 @@
116
366
  ]
117
367
  },
118
368
  "order_completed": {
369
+ "enrichments": [
370
+ {
371
+ "staticString": "Purchase",
372
+ "outputKey": "event_name"
373
+ },
374
+ {
375
+ "staticString": "product",
376
+ "outputKey": "custom_data.content_type"
377
+ }
378
+ ],
119
379
  "mappings": [
380
+ {
381
+ "inputKey": "properties.products",
382
+ "outputKey": "custom_data.content_ids",
383
+ "transforms": [
384
+ {
385
+ "pluckValues": {
386
+ "extractKey": "product_id"
387
+ }
388
+ }
389
+ ]
390
+ },
391
+ {
392
+ "inputKey": "properties.currency",
393
+ "outputKey": "custom_data.currency",
394
+ "transforms": [
395
+ {
396
+ "modifyString": "uppercase"
397
+ }
398
+ ],
399
+ "defaultString": "USD"
400
+ },
401
+ {
402
+ "inputKey": "input",
403
+ "outputKey": "custom_data.value",
404
+ "transforms": [
405
+ {
406
+ "expression": {
407
+ "lang": "lua",
408
+ "body": "return SUM(MAP(input.properties.products, function (p) return p.price * (p.quantity or 1) end))"
409
+ }
410
+ }
411
+ ]
412
+ },
120
413
  {
121
414
  "inputKey": "input",
122
- "outputKey": "data",
415
+ "outputKey": "custom_data.contents",
123
416
  "transforms": [
124
417
  {
125
418
  "expression": {
126
419
  "lang": "lua",
127
- "body": "local userData = {\n client_ip_address=input.context.ip,\n client_user_agent=input.context.userAgent,\n fbc=input.context.providers.facebookPixel.fbc,\n fbp=input.context.providers.facebookPixel.fbp,\n external_id=input.anonymousId,\n em=TO_SHA256_HASH(LOWER(TRIM(input.context.traits.email)))\n}\nlocal customData = {\n content_ids=PLUCK(input.properties.products, 'product_id') or {},\n content_type='product',\n contents=MAP(\n input.properties.products,\n function (p)\n return {\n id=p.product_id,\n quantity=p.quantity or 1,\n item_price=p.price\n }\n end\n ),\n currency=UPPER(input.properties.currency) or 'USD',\n value=SUM(MAP(input.properties.products, function (p) return p.price * (p.quantity or 1) end)),\n order_id=input.properties.order_id\n}\nlocal data = {\n action_source='website',\n event_id=input.messageId,\n event_source_url=input.context.page.url,\n event_name='Purchase',\n event_time=SECONDS_SINCE_EPOCH(),\n user_data=userData,\n custom_data=customData\n}\nreturn { data }"
420
+ "body": "return MAP(\n input.properties.products,\n function (p)\n return {\n id=p.product_id,\n quantity=p.quantity or 1,\n item_price=p.price\n }\n end\n)"
128
421
  }
129
422
  }
130
423
  ]
424
+ },
425
+ {
426
+ "inputKey": "properties.order_id",
427
+ "outputKey": "custom_data.order_id"
131
428
  }
132
429
  ]
133
430
  }
@@ -0,0 +1 @@
1
+ "212997f22690a4e5206f15e1a5c5b242"
@@ -0,0 +1,39 @@
1
+ {
2
+ "params": [
3
+ {
4
+ "name": "USERNAME",
5
+ "exampleValue": "my-username"
6
+ },
7
+ {
8
+ "name": "PASSWORD",
9
+ "exampleValue": "my-password"
10
+ },
11
+ {
12
+ "name": "PROJECT_ID",
13
+ "exampleValue": "my-project-id"
14
+ }
15
+ ],
16
+ "default": {
17
+ "endpoint": "https://api.mixpanel.com/import?strict=1&project_id=$$PROJECT_ID$$",
18
+ "basicAuth": {
19
+ "password": "$$PASSWORD$$",
20
+ "username": "$$USERNAME$$"
21
+ },
22
+ "headers": [
23
+ {
24
+ "key": "Content-Type",
25
+ "value": "application/json"
26
+ },
27
+ {
28
+ "key": "Accept",
29
+ "value": "application/json"
30
+ }
31
+ ],
32
+ "method": "POST",
33
+ "batchSize": 1000,
34
+ "transform": {
35
+ "lang": "lua",
36
+ "body": "request.body = batch\nreturn request"
37
+ }
38
+ }
39
+ }
@@ -0,0 +1 @@
1
+ "59e919b7e943ee362c17bd64d59c2aaa"
@@ -0,0 +1,19 @@
1
+ {
2
+ "isDraft": false,
3
+ "friendlyName": "Mixpanel",
4
+ "description": "Powerful, self-serve product analytics to help you convert, engage, and retain more users.",
5
+ "logo": "https://cdn.metarouter.io/logo.svg",
6
+ "color": "#7856ff",
7
+ "eventSource": {
8
+ "isAndroidApp": true,
9
+ "isIosApp": true,
10
+ "isWebApp": true
11
+ },
12
+ "inputSchema": "analytics_js",
13
+ "releaseNotes": [
14
+ {
15
+ "date": "2022-03-23T00:00:00.000Z",
16
+ "note": "Mixpanel initial release."
17
+ }
18
+ ]
19
+ }
@@ -0,0 +1 @@
1
+ "14de59c0146548355e75404cad9f3c9c"
@@ -0,0 +1,71 @@
1
+ {
2
+ "version": "1.0.0",
3
+ "global": {
4
+ "mappings": [
5
+ {
6
+ "inputKey": "properties",
7
+ "outputKey": "properties"
8
+ },
9
+ {
10
+ "inputKey": "input",
11
+ "outputKey": "properties.time",
12
+ "transforms": [
13
+ {
14
+ "expression": {
15
+ "lang": "lua",
16
+ "body": "local date = input.originalTimestamp or input.sentAt\nreturn MILLISECONDS_SINCE_EPOCH_FROM_RFC3999(TO_DATE_TIME(date, { inputFormat = \"2006-01-02T15:04:05Z07:00\" }))"
17
+ }
18
+ }
19
+ ]
20
+ },
21
+ {
22
+ "inputKey": "anonymousId",
23
+ "outputKey": "properties.distinct_id"
24
+ },
25
+ {
26
+ "inputKey": "context.page.url",
27
+ "outputKey": "properties.URL"
28
+ },
29
+ {
30
+ "inputKey": "anonymousId",
31
+ "outputKey": "properties.$anon_id"
32
+ },
33
+ {
34
+ "inputKey": "messageId",
35
+ "outputKey": "properties.$insert_id"
36
+ }
37
+ ]
38
+ },
39
+ "eventSpecific": {
40
+ "identify": {
41
+ "mappings": [
42
+ {
43
+ "inputKey": "userId",
44
+ "outputKey": "properties.$identified_id"
45
+ }
46
+ ],
47
+ "enrichments": [
48
+ {
49
+ "staticString": "$identify",
50
+ "outputKey": "event"
51
+ }
52
+ ]
53
+ },
54
+ "page": {
55
+ "mappings": [
56
+ {
57
+ "inputKey": "type",
58
+ "outputKey": "event"
59
+ }
60
+ ]
61
+ }
62
+ },
63
+ "default": {
64
+ "mappings": [
65
+ {
66
+ "inputKey": "event",
67
+ "outputKey": "event"
68
+ }
69
+ ]
70
+ }
71
+ }
@@ -1 +1 @@
1
- "c2c614345961a7fe739d2c3069b6584c"
1
+ "252b65e36d2cc36c9d2ab136f728ffeb"
@@ -12,6 +12,11 @@
12
12
  "roomvo": {
13
13
  "refreshToken": "$$REFRESH_TOKEN$$"
14
14
  }
15
+ },
16
+ "batchSize": 100,
17
+ "transform": {
18
+ "lang": "lua",
19
+ "body": "request.body = batch\nreturn request"
15
20
  }
16
21
  }
17
22
  }
@@ -1 +1 @@
1
- "c4e65ee3ea3ad954fa0993cef56535c1"
1
+ "4ab47e329f4f1c4a073cad569a9d16c9"
@@ -14,6 +14,10 @@
14
14
  {
15
15
  "date": "2021-08-10T00:00:00.000Z",
16
16
  "note": "Roomvo initial release."
17
+ },
18
+ {
19
+ "date": "2021-11-26T00:00:00.000Z",
20
+ "note": "uses batch endpoint"
17
21
  }
18
22
  ]
19
23
  }
@@ -1 +1 @@
1
- "ca8aa3db6fd15a8f8909979bc39d3063"
1
+ "ba863da722785c53ccc756a276d8125e"
@@ -36,10 +36,40 @@
36
36
  }
37
37
  }
38
38
  ],
39
+ "mappings": [
40
+ {
41
+ "inputKey": "properties.total",
42
+ "outputKey": "total",
43
+ "transforms": [
44
+ {
45
+ "toScalar": "float"
46
+ }
47
+ ]
48
+ },
49
+ {
50
+ "inputKey": "properties.currency",
51
+ "outputKey": "currency",
52
+ "transforms": [
53
+ {
54
+ "modifyString": "uppercase"
55
+ }
56
+ ]
57
+ },
58
+ {
59
+ "inputKey": "properties.order_id",
60
+ "outputKey": "transaction"
61
+ }
62
+ ],
63
+ "enrichments": [
64
+ {
65
+ "staticString": "$$VENDOR$$",
66
+ "outputKey": "vendor"
67
+ }
68
+ ],
39
69
  "expressions": [
40
70
  {
41
71
  "lang": "lua",
42
- "body": "function getVisitorIds(t, value)\n local anonymousId = REPLACE(input.anonymousId, \"-\", \"\")\n if (t == nil or t == '') then\n return anonymousId\n else\n for k,v in pairs(t) do\n if string.find(k, value) then return v end\n end\n return anonymousId\n end\nend\n\nreturn {\n roomvo = {{\n visitor = getVisitorIds(input.context.providers.roomvo.ffvisitorids, \"$$CATEGORY$$\"),\n vendor = \"$$VENDOR$$\",\n products = MAP(\n input.properties.products,\n function (p)\n return {\n sku=p.sku,\n price=TO_FLOAT(p.price),\n quantity=TO_TRUNCATED_INT(p.quantity) or 1\n }\n end\n ),\n total = TO_FLOAT(input.properties.total),\n currency = UPPER(input.properties.currency),\n transaction = input.properties.order_id\n }}\n}"
72
+ "body": "function getVisitorIds(t, value)\n local anonymousId = REPLACE(input.anonymousId, \"-\", \"\")\n if (t == nil or t == '') then\n return anonymousId\n else\n for k,v in pairs(t) do\n if string.find(k, value) then return v end\n end\n return anonymousId\n end\nend\n\nreturn {\n visitor = getVisitorIds(input.context.providers.roomvo.ffvisitorids, \"$$CATEGORY$$\"),\n products = MAP(\n input.properties.products,\n function (p)\n return {\n sku=p.sku,\n price=TO_FLOAT(p.price),\n quantity=TO_TRUNCATED_INT(p.quantity) or 1\n }\n end\n ),\n}"
43
73
  }
44
74
  ]
45
75
  }