@metarouter/ajs-starter-kit 1.0.65 → 1.0.66

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
- "73c6b6f474f87a38856041e850bebb14"
1
+ "3cceb92d73d335e9c013d6743bfd5cb9"
@@ -1,5 +1,5 @@
1
1
  {
2
- "isDraft": true,
2
+ "isDraft": false,
3
3
  "isBeta": true,
4
4
  "friendlyName": "Google Ads",
5
5
  "description": "Google Ads makes it easy to show the world what’s unique about your business, so you can reach customers searching for what you offer.",
@@ -19,10 +19,6 @@
19
19
  {
20
20
  "date": "2022-11-16T00:00:00.000Z",
21
21
  "note": "Add isBeta field"
22
- },
23
- {
24
- "date": "2023-07-04T00:00:00.000Z",
25
- "note": "Deprecating this in favor of the newly released Google Ads kit"
26
22
  }
27
23
  ]
28
24
  }
@@ -1 +1 @@
1
- "367871f405d0a7248e21e5d2082adc89"
1
+ "861bbf3e2f69d82bc666d311ea580f62"
@@ -11,11 +11,7 @@
11
11
  "key": "Accept-Encoding",
12
12
  "value": "application/json"
13
13
  }
14
- ],
15
- "transform": {
16
- "lang": "lua",
17
- "body": "request.body = {\n client_id = batch[1].client_id,\n user_id = batch[1].user_id,\n timestamp_micros = batch[1].timestamp_micros,\n events = { batch[1].event }\n}\nreturn request"
18
- }
14
+ ]
19
15
  },
20
16
  "params": [
21
17
  {
@@ -1 +1 @@
1
- "dca5841b9eb56f231eeecb81da0da760"
1
+ "6f425f03ed0c7cece997050145befbe7"
@@ -1 +1 @@
1
- "4f8f201e28e6eef7e88e9ead092d1e8e"
1
+ "cd606abbb639430e994aa75840b008fd"
@@ -1,12 +1,6 @@
1
1
  {
2
2
  "version": "v0.0.1",
3
3
  "global": {
4
- "enrichments": [
5
- {
6
- "outputKey": "event.params.data_source",
7
- "staticString": "S2S"
8
- }
9
- ],
10
4
  "mappings": [
11
5
  {
12
6
  "inputKey": "userId",
@@ -35,65 +29,35 @@
35
29
  }
36
30
  }
37
31
  ]
38
- },
39
- {
40
- "inputKey": "input",
41
- "outputKey": "event.params.gclid",
42
- "transforms": [
43
- {
44
- "expression": {
45
- "body": "return DECODE_URL_QUERY(input.context.page.url).gclid",
46
- "lang": "lua"
47
- }
48
- }
49
- ]
50
- },
51
- {
52
- "inputKey": "input",
53
- "outputKey": "event.params.dclid",
54
- "transforms": [
55
- {
56
- "expression": {
57
- "body": "return DECODE_URL_QUERY(input.context.page.url).dclid",
58
- "lang": "lua"
59
- }
60
- }
61
- ]
62
32
  }
63
33
  ]
64
34
  },
65
35
  "eventSpecific": {
66
36
  "page": {
67
- "enrichments": [
68
- {
69
- "outputKey": "event.name",
70
- "staticString": "page_view"
71
- }
72
- ],
73
37
  "mappings": [
74
- {
75
- "inputKey": "properties.title",
76
- "outputKey": "event.params.page_title"
77
- },
78
38
  {
79
39
  "inputKey": "input",
80
- "outputKey": "event.params.page_location",
40
+ "outputKey": "events",
81
41
  "transforms": [
82
42
  {
83
43
  "expression": {
84
- "body": "return SPLIT(input.properties.url, \"?\", 1)[1] or \"\"",
44
+ "body": "local event_details = {}\nevent_details.name = 'page_view'\nlocal params = {}\nparams.page_title = input.properties.title\nparams.page_location = SPLIT(input.properties.url, \"?\", 1)[1] or \"\"\nparams.page_referrer = SPLIT(input.properties.referrer, \"?\", 1)[1] or \"\"\nparams.page_type = input.properties.pageType\nparams.page_sub_category = input.properties.subCategory2\nlocal gclid = DECODE_URL_QUERY(input.context.page.url).gclid\nif gclid then params.gclid = gclid end\nlocal dclid = DECODE_URL_QUERY(input.context.page.url).dclid\nif dclid then params.dclid = dclid end\nparams.data_source = 'S2S'\nevent_details.params = params\nreturn { event_details }",
85
45
  "lang": "lua"
86
46
  }
87
47
  }
88
48
  ]
89
- },
49
+ }
50
+ ]
51
+ },
52
+ "products_searched": {
53
+ "mappings": [
90
54
  {
91
55
  "inputKey": "input",
92
- "outputKey": "event.params.page_referrer",
56
+ "outputKey": "events",
93
57
  "transforms": [
94
58
  {
95
59
  "expression": {
96
- "body": "return SPLIT(input.properties.referrer, \"?\", 1)[1] or \"\"",
60
+ "body": "local event_details = {}\nevent_details.name = 'search'\nlocal params = {}\nparams.search_term = input.properties.query\nlocal gclid = DECODE_URL_QUERY(input.context.page.url).gclid\nif gclid then params.gclid = gclid end\nlocal dclid = DECODE_URL_QUERY(input.context.page.url).dclid\nif dclid then params.dclid = dclid end\nparams.data_source = 'S2S'\nevent_details.params = params\nreturn { event_details }",
97
61
  "lang": "lua"
98
62
  }
99
63
  }
@@ -101,43 +65,15 @@
101
65
  }
102
66
  ]
103
67
  },
104
- "products_searched": {
105
- "enrichments": [
106
- {
107
- "outputKey": "event.name",
108
- "staticString": "search"
109
- }
110
- ],
111
- "mappings": [
112
- {
113
- "inputKey": "properties.query",
114
- "outputKey": "event.params.search_term"
115
- }
116
- ]
117
- },
118
68
  "product_list_viewed": {
119
- "enrichments": [
120
- {
121
- "outputKey": "event.name",
122
- "staticString": "view_item_list"
123
- }
124
- ],
125
69
  "mappings": [
126
- {
127
- "inputKey": "properties.list_id",
128
- "outputKey": "event.params.item_list_id"
129
- },
130
- {
131
- "inputKey": "properties.category",
132
- "outputKey": "event.params.item_list_name"
133
- },
134
70
  {
135
71
  "inputKey": "input",
136
- "outputKey": "event.params.items",
72
+ "outputKey": "events",
137
73
  "transforms": [
138
74
  {
139
75
  "expression": {
140
- "body": "local items = {}\nfor index, product in pairs(input.properties.products) do\n local item = {}\n item.coupon = product.coupon\n item.item_brand = product.brand\n item.item_category = product.category\n item.item_id = product.product_id\n item.item_name = product.name\n item.item_price = product.price\n item.item_quantity = product.quantity\n items[index] = item\nend\nreturn items",
76
+ "body": "local event_details = {}\nevent_details.name = 'view_item_list'\nlocal params = {}\nparams.item_list_id = input.properties.list_id\nparams.item_list_name = input.properties.category\nparams.items = input.properties.products\nlocal gclid = DECODE_URL_QUERY(input.context.page.url).gclid\nif gclid then params.gclid = gclid end\nlocal dclid = DECODE_URL_QUERY(input.context.page.url).dclid\nif dclid then params.dclid = dclid end\nparams.data_source = 'S2S'\nevent_details.params = params\nreturn { event_details }",
141
77
  "lang": "lua"
142
78
  }
143
79
  }
@@ -146,76 +82,46 @@
146
82
  ]
147
83
  },
148
84
  "promotion_viewed": {
149
- "enrichments": [
150
- {
151
- "outputKey": "event.name",
152
- "staticString": "view_promotion"
153
- }
154
- ],
155
85
  "mappings": [
156
86
  {
157
- "inputKey": "properties.promotion_id",
158
- "outputKey": "event.params.promotion_id"
159
- },
160
- {
161
- "inputKey": "properties.name",
162
- "outputKey": "event.params.promotion_name"
163
- },
164
- {
165
- "inputKey": "properties.creative",
166
- "outputKey": "event.params.creative_name"
167
- },
168
- {
169
- "inputKey": "properties.position",
170
- "outputKey": "event.params.creative_slot"
87
+ "inputKey": "input",
88
+ "outputKey": "events",
89
+ "transforms": [
90
+ {
91
+ "expression": {
92
+ "body": "local event_details = {}\nevent_details.name = 'view_promotion'\nlocal params = {}\nparams.promotion_id = input.properties.promotion_id\nparams.creative_name = input.properties.creative\nparams.promotion_name = input.properties.name\nparams.creative_slot = input.properties.position\nparams.items = input.properties.items\nlocal gclid = DECODE_URL_QUERY(input.context.page.url).gclid\nif gclid then params.gclid = gclid end\nlocal dclid = DECODE_URL_QUERY(input.context.page.url).dclid\nif dclid then params.dclid = dclid end\nparams.data_source = 'S2S'\nevent_details.params = params\nreturn { event_details }",
93
+ "lang": "lua"
94
+ }
95
+ }
96
+ ]
171
97
  }
172
98
  ]
173
99
  },
174
100
  "promotion_clicked": {
175
- "enrichments": [
176
- {
177
- "outputKey": "event.name",
178
- "staticString": "select_promotion"
179
- }
180
- ],
181
101
  "mappings": [
182
102
  {
183
- "inputKey": "properties.promotion_id",
184
- "outputKey": "event.params.promotion_id"
185
- },
186
- {
187
- "inputKey": "properties.name",
188
- "outputKey": "event.params.promotion_name"
189
- },
190
- {
191
- "inputKey": "properties.creative",
192
- "outputKey": "event.params.creative_name"
193
- },
194
- {
195
- "inputKey": "properties.position",
196
- "outputKey": "event.params.creative_slot"
103
+ "inputKey": "input",
104
+ "outputKey": "events",
105
+ "transforms": [
106
+ {
107
+ "expression": {
108
+ "body": "local event_details = {}\nevent_details.name = 'select_promotion'\nlocal params = {}\nparams.promotion_id = input.properties.promotion_id\nparams.creative_name = input.properties.creative\nparams.promotion_name = input.properties.name\nparams.creative_slot = input.properties.position\nparams.items = input.properties.items\nlocal gclid = DECODE_URL_QUERY(input.context.page.url).gclid\nif gclid then params.gclid = gclid end\nlocal dclid = DECODE_URL_QUERY(input.context.page.url).dclid\nif dclid then params.dclid = dclid end\nparams.data_source = 'S2S'\nevent_details.params = params\nreturn { event_details }",
109
+ "lang": "lua"
110
+ }
111
+ }
112
+ ]
197
113
  }
198
114
  ]
199
115
  },
200
116
  "product_clicked": {
201
- "enrichments": [
202
- {
203
- "outputKey": "event.name",
204
- "staticString": "select_item"
205
- }
206
- ],
207
117
  "mappings": [
208
- {
209
- "inputKey": "properties.currency",
210
- "outputKey": "event.params.currency"
211
- },
212
118
  {
213
119
  "inputKey": "input",
214
- "outputKey": "event.params.items",
120
+ "outputKey": "events",
215
121
  "transforms": [
216
122
  {
217
123
  "expression": {
218
- "body": "return {{\n coupon = input.properties.coupon,\n item_brand = input.properties.brand,\n item_category = input.properties.category,\n item_id = input.properties.product_id,\n item_name = input.properties.name,\n item_price = input.properties.price,\n item_quantity = input.properties.quantity\n}}",
124
+ "body": "local event_details = {}\nevent_details.name = 'select_item'\nlocal params = {}\nparams.items = {}\nlocal item = {}\nitem.item_id = input.properties.product_id\nitem.item_name = input.properties.name\nitem.coupon = input.properties.coupon\nitem.currency = input.properties.currency\nitem.item_brand = input.properties.brand\nitem.item_category = input.properties.category\nitem.item_price = input.properties.price\nitem.item_quantity = input.properties.quantity\nparams.items[1] = item\nlocal gclid = DECODE_URL_QUERY(input.context.page.url).gclid\nif gclid then params.gclid = gclid end\nlocal dclid = DECODE_URL_QUERY(input.context.page.url).dclid\nif dclid then params.dclid = dclid end\nparams.data_source = 'S2S'\nevent_details.params = params\nreturn { event_details }",
219
125
  "lang": "lua"
220
126
  }
221
127
  }
@@ -224,28 +130,14 @@
224
130
  ]
225
131
  },
226
132
  "product_viewed": {
227
- "enrichments": [
228
- {
229
- "outputKey": "event.name",
230
- "staticString": "view_item"
231
- }
232
- ],
233
133
  "mappings": [
234
- {
235
- "inputKey": "properties.currency",
236
- "outputKey": "event.params.currency"
237
- },
238
- {
239
- "inputKey": "properties.value",
240
- "outputKey": "event.params.value"
241
- },
242
134
  {
243
135
  "inputKey": "input",
244
- "outputKey": "event.params.items",
136
+ "outputKey": "events",
245
137
  "transforms": [
246
138
  {
247
139
  "expression": {
248
- "body": "return {{\n coupon = input.properties.coupon,\n item_brand = input.properties.brand,\n item_category = input.properties.category,\n item_id = input.properties.product_id,\n item_name = input.properties.name,\n item_price = input.properties.price,\n item_quantity = input.properties.quantity\n}}",
140
+ "body": "local event_details = {}\nevent_details.name = 'view_item'\nlocal params = {}\nparams.items = {}\nlocal item = {}\nitem.item_id = input.properties.product_id\nitem.item_name = input.properties.name\nitem.coupon = input.properties.coupon\nitem.currency = input.properties.currency\nitem.item_brand = input.properties.brand\nitem.item_category = input.properties.category\nitem.item_price = input.properties.price\nitem.item_quantity = input.properties.quantity\nparams.items[1] = item\nparams.currency = input.properties.currency\nparams.value = input.properties.value\nlocal gclid = DECODE_URL_QUERY(input.context.page.url).gclid\nif gclid then params.gclid = gclid end\nlocal dclid = DECODE_URL_QUERY(input.context.page.url).dclid\nif dclid then params.dclid = dclid end\nparams.data_source = 'S2S'\nevent_details.params = params\nreturn { event_details }",
249
141
  "lang": "lua"
250
142
  }
251
143
  }
@@ -254,28 +146,14 @@
254
146
  ]
255
147
  },
256
148
  "product_added": {
257
- "enrichments": [
258
- {
259
- "outputKey": "event.name",
260
- "staticString": "add_to_cart"
261
- }
262
- ],
263
149
  "mappings": [
264
- {
265
- "inputKey": "properties.currency",
266
- "outputKey": "event.params.currency"
267
- },
268
- {
269
- "inputKey": "properties.value",
270
- "outputKey": "event.params.value"
271
- },
272
150
  {
273
151
  "inputKey": "input",
274
- "outputKey": "event.params.items",
152
+ "outputKey": "events",
275
153
  "transforms": [
276
154
  {
277
155
  "expression": {
278
- "body": "return {{\n coupon = input.properties.coupon,\n item_brand = input.properties.brand,\n item_category = input.properties.category,\n item_id = input.properties.product_id,\n item_name = input.properties.name,\n item_price = input.properties.price,\n item_quantity = input.properties.quantity\n}}",
156
+ "body": "local event_details = {}\nevent_details.name = 'add_to_cart'\nlocal params = {}\nparams.items = {}\nlocal item = {}\nitem.item_id = input.properties.product_id\nitem.item_name = input.properties.name\nitem.coupon = input.properties.coupon\nitem.currency = input.properties.currency\nitem.item_brand = input.properties.brand\nitem.item_category = input.properties.category\nitem.item_price = input.properties.price\nitem.item_quantity = input.properties.quantity\nparams.items[1] = item\nparams.currency = input.properties.currency\nparams.value = input.properties.value\nlocal gclid = DECODE_URL_QUERY(input.context.page.url).gclid\nif gclid then params.gclid = gclid end\nlocal dclid = DECODE_URL_QUERY(input.context.page.url).dclid\nif dclid then params.dclid = dclid end\nparams.data_source = 'S2S'\nevent_details.params = params\nreturn { event_details }",
279
157
  "lang": "lua"
280
158
  }
281
159
  }
@@ -284,28 +162,14 @@
284
162
  ]
285
163
  },
286
164
  "product_removed": {
287
- "enrichments": [
288
- {
289
- "outputKey": "event.name",
290
- "staticString": "remove_from_cart"
291
- }
292
- ],
293
165
  "mappings": [
294
- {
295
- "inputKey": "properties.currency",
296
- "outputKey": "event.params.currency"
297
- },
298
- {
299
- "inputKey": "properties.value",
300
- "outputKey": "event.params.value"
301
- },
302
166
  {
303
167
  "inputKey": "input",
304
- "outputKey": "event.params.items",
168
+ "outputKey": "events",
305
169
  "transforms": [
306
170
  {
307
171
  "expression": {
308
- "body": "return {{\n coupon = input.properties.coupon,\n item_brand = input.properties.brand,\n item_category = input.properties.category,\n item_id = input.properties.product_id,\n item_name = input.properties.name,\n item_price = input.properties.price,\n item_quantity = input.properties.quantity\n}}",
172
+ "body": "local event_details = {}\nevent_details.name = 'remove_from_cart'\nlocal params = {}\nparams.items = {}\nlocal item = {}\nitem.item_id = input.properties.product_id\nitem.item_name = input.properties.name\nitem.coupon = input.properties.coupon\nitem.currency = input.properties.currency\nitem.item_brand = input.properties.brand\nitem.item_category = input.properties.category\nitem.item_price = input.properties.price\nitem.item_quantity = input.properties.quantity\nparams.items[1] = item\nparams.currency = input.properties.currency\nparams.value = input.properties.value\nlocal gclid = DECODE_URL_QUERY(input.context.page.url).gclid\nif gclid then params.gclid = gclid end\nlocal dclid = DECODE_URL_QUERY(input.context.page.url).dclid\nif dclid then params.dclid = dclid end\nparams.data_source = 'S2S'\nevent_details.params = params\nreturn { event_details }",
309
173
  "lang": "lua"
310
174
  }
311
175
  }
@@ -314,36 +178,14 @@
314
178
  ]
315
179
  },
316
180
  "cart_viewed": {
317
- "enrichments": [
318
- {
319
- "outputKey": "event.name",
320
- "staticString": "view_cart"
321
- }
322
- ],
323
181
  "mappings": [
324
- {
325
- "inputKey": "properties.currency",
326
- "outputKey": "event.params.currency"
327
- },
328
182
  {
329
183
  "inputKey": "input",
330
- "outputKey": "event.params.value",
184
+ "outputKey": "events",
331
185
  "transforms": [
332
186
  {
333
187
  "expression": {
334
- "body": "return SUM(MAP(input.properties.products, function (product) return product.price * (product.quantity or 1) end))",
335
- "lang": "lua"
336
- }
337
- }
338
- ]
339
- },
340
- {
341
- "inputKey": "input",
342
- "outputKey": "event.params.items",
343
- "transforms": [
344
- {
345
- "expression": {
346
- "body": "local items = {}\nfor index, product in pairs(input.properties.products) do\n local item = {}\n item.coupon = product.coupon\n item.item_brand = product.brand\n item.item_category = product.category\n item.item_id = product.product_id\n item.item_name = product.name\n item.item_price = product.price\n item.item_quantity = product.quantity\n items[index] = item\nend\nreturn items",
188
+ "body": "local event_details = {}\nevent_details.name = 'view_cart'\nlocal params = {}\nparams.currency = input.properties.currency\nparams.value = 0\nparams.items = {}\nfor inputIndex, product in pairs(input.properties.products) do\n local item = {}\n item.item_id = product.product_id\n item.item_name = product.name\n item.coupon = product.coupon\n item.item_brand = product.brand\n item.item_category = product.category\n item.item_price = product.price\n item.item_quantity = product.quantity\n params.items[inputIndex] = item\n params.value = params.value + (product.price * product.quantity)\nend\nlocal gclid = DECODE_URL_QUERY(input.context.page.url).gclid\nif gclid then params.gclid = gclid end\nlocal dclid = DECODE_URL_QUERY(input.context.page.url).dclid\nif dclid then params.dclid = dclid end\nparams.data_source = 'S2S'\nevent_details.params = params\nreturn { event_details }",
347
189
  "lang": "lua"
348
190
  }
349
191
  }
@@ -352,44 +194,14 @@
352
194
  ]
353
195
  },
354
196
  "order_completed": {
355
- "enrichments": [
356
- {
357
- "outputKey": "event.name",
358
- "staticString": "purchase"
359
- }
360
- ],
361
197
  "mappings": [
362
- {
363
- "inputKey": "properties.coupon",
364
- "outputKey": "event.params.coupon"
365
- },
366
- {
367
- "inputKey": "properties.currency",
368
- "outputKey": "event.params.currency"
369
- },
370
- {
371
- "inputKey": "properties.shipping",
372
- "outputKey": "event.params.shipping"
373
- },
374
- {
375
- "inputKey": "properties.tax",
376
- "outputKey": "event.params.tax"
377
- },
378
- {
379
- "inputKey": "properties.checkout_id",
380
- "outputKey": "event.params.transaction_id"
381
- },
382
- {
383
- "inputKey": "properties.total",
384
- "outputKey": "event.params.value"
385
- },
386
198
  {
387
199
  "inputKey": "input",
388
- "outputKey": "event.params.items",
200
+ "outputKey": "events",
389
201
  "transforms": [
390
202
  {
391
203
  "expression": {
392
- "body": "local items = {}\nfor index, product in pairs(input.properties.products) do\n local item = {}\n item.coupon = product.coupon\n item.item_brand = product.brand\n item.item_category = product.category\n item.item_id = product.product_id\n item.item_name = product.name\n item.item_price = product.price\n item.item_quantity = product.quantity\n items[index] = item\nend\nreturn items",
204
+ "body": "local event_details = {}\nevent_details.name = 'purchase'\nlocal params = {}\nparams.currency = input.properties.currency\nparams.transaction_id = input.properties.checkout_id\nparams.value = input.properties.total\nparams.coupon = input.properties.coupon\nparams.shipping = input.properties.shipping\nparams.tax = input.properties.tax\nparams.items = {}\nfor inputIndex, product in pairs(input.properties.products) do\n local item = {}\n item.item_id = product.product_id\n item.item_name = product.name\n item.coupon = product.coupon\n item.item_brand = product.brand\n item.item_category = product.category\n item.item_price = product.price\n item.item_quantity = product.quantity\n params.items[inputIndex] = item\nend\nlocal gclid = DECODE_URL_QUERY(input.context.page.url).gclid\nif gclid then params.gclid = gclid end\nlocal dclid = DECODE_URL_QUERY(input.context.page.url).dclid\nif dclid then params.dclid = dclid end\nparams.data_source = 'S2S'\nevent_details.params = params\nreturn { event_details }",
393
205
  "lang": "lua"
394
206
  }
395
207
  }
@@ -402,11 +214,11 @@
402
214
  "mappings": [
403
215
  {
404
216
  "inputKey": "input",
405
- "outputKey": "event",
217
+ "outputKey": "events",
406
218
  "transforms": [
407
219
  {
408
220
  "expression": {
409
- "body": "local event_details = {}\nevent_details.name = REPLACE(LOWER(input.event), \" \", \"_\")\nlocal params = input.properties\nlocal gclid = DECODE_URL_QUERY(input.context.page.url).gclid\nif gclid then params.gclid = gclid end\nlocal dclid = DECODE_URL_QUERY(input.context.page.url).dclid\nif dclid then params.dclid = dclid end\nparams.data_source = 'S2S'\nevent_details.params = params\nreturn event_details",
221
+ "body": "local event_details = {}\nevent_details.name = input.event\nlocal params = input.properties\nlocal gclid = DECODE_URL_QUERY(input.context.page.url).gclid\nif gclid then params.gclid = gclid end\nlocal dclid = DECODE_URL_QUERY(input.context.page.url).dclid\nif dclid then params.dclid = dclid end\nparams.data_source = 'S2S'\nevent_details.params = params\nreturn { event_details }",
410
222
  "lang": "lua"
411
223
  }
412
224
  }
@@ -1 +1 @@
1
- "e84d7797d5c99cd19ba1d958457701f2"
1
+ "7c6f01f2c5075a293f91d3103f2cf3ec"
@@ -1,6 +1,6 @@
1
1
  {
2
- "isDraft": true,
3
- "isBeta": false,
2
+ "isDraft": false,
3
+ "isBeta": true,
4
4
  "friendlyName": "Kafka",
5
5
  "description": "Apache Kafka is an open-source distributed event streaming platform used by thousands of companies\nfor high-performance data pipelines, streaming analytics, data integration, and mission-critical applications.",
6
6
  "logo": "https://cdn.metarouter.io/logo.svg",
@@ -27,6 +27,10 @@
27
27
  {
28
28
  "date": "2022-11-16T00:00:00.000Z",
29
29
  "note": "Add isBeta field"
30
+ },
31
+ {
32
+ "date": "2023-07-10T00:00:00.000Z",
33
+ "note": "Moving from Draft to Beta mode"
30
34
  }
31
35
  ]
32
36
  }
@@ -1 +1 @@
1
- "b04e2a153bb7942fdc8cbdc05a5bf150"
1
+ "107d7b4508c3a2f3853cb4ef602182f0"
@@ -1 +1 @@
1
- "333104bb41fd658bff6a76f39cd1f121"
1
+ "8690d6ffb1d011636ae0cbf816c291ac"
@@ -1,17 +1,5 @@
1
1
  {
2
2
  "version": "v0.0.1",
3
- "default": {
4
- "filters": [
5
- {
6
- "byEventNames": {
7
- "action": "allow",
8
- "events": [
9
- ""
10
- ]
11
- }
12
- }
13
- ]
14
- },
15
3
  "global": {
16
4
  "enrichments": [
17
5
  {
@@ -165,100 +153,6 @@
165
153
  }
166
154
  ]
167
155
  },
168
- "product_list_viewed": {
169
- "enrichments": [
170
- {
171
- "outputKey": "event_name",
172
- "staticString": "view_category"
173
- }
174
- ],
175
- "mappings": [
176
- {
177
- "inputKey": "input",
178
- "outputKey": "custom_data.content_ids",
179
- "transforms": [
180
- {
181
- "expression": {
182
- "body": "return MAP(input.properties.products, function (p) return p.product_id end )",
183
- "lang": "lua"
184
- }
185
- }
186
- ]
187
- },
188
- {
189
- "inputKey": "input",
190
- "outputKey": "custom_data.contents",
191
- "transforms": [
192
- {
193
- "expression": {
194
- "body": "local contents=MAP(input.properties.products,\n function (p)\n return {\n id=p.product_id,\n item_price=tostring(p.price),\n quantity=p.quantity\n }\n end\n)\nreturn contents",
195
- "lang": "lua"
196
- }
197
- }
198
- ]
199
- }
200
- ]
201
- },
202
- "product_viewed": {
203
- "enrichments": [
204
- {
205
- "outputKey": "event_name",
206
- "staticString": "page_visit"
207
- }
208
- ],
209
- "mappings": [
210
- {
211
- "inputKey": "properties.currency",
212
- "outputKey": "custom_data.currency",
213
- "defaultString": "USD",
214
- "transforms": [
215
- {
216
- "modifyString": "uppercase"
217
- }
218
- ]
219
- },
220
- {
221
- "inputKey": "input",
222
- "outputKey": "custom_data.value",
223
- "transforms": [
224
- {
225
- "expression": {
226
- "lang": "lua",
227
- "body": "return tostring(input.properties.price * (input.properties.quantity or 1))"
228
- }
229
- }
230
- ]
231
- },
232
- {
233
- "inputKey": "input",
234
- "outputKey": "custom_data.content_ids",
235
- "transforms": [
236
- {
237
- "expression": {
238
- "body": "return { input.properties.product_id }",
239
- "lang": "lua"
240
- }
241
- }
242
- ]
243
- },
244
- {
245
- "inputKey": "input",
246
- "outputKey": "custom_data.contents",
247
- "transforms": [
248
- {
249
- "expression": {
250
- "body": "return {{\n id=input.properties.product_id,\n item_price=tostring(input.properties.price),\n quantity=input.properties.quantity\n}}",
251
- "lang": "lua"
252
- }
253
- }
254
- ]
255
- },
256
- {
257
- "inputKey": "properties.quantity",
258
- "outputKey": "custom_data.num_items"
259
- }
260
- ]
261
- },
262
156
  "product_added": {
263
157
  "enrichments": [
264
158
  {
@@ -307,7 +201,7 @@
307
201
  "transforms": [
308
202
  {
309
203
  "expression": {
310
- "body": "return {{\n id=input.properties.product_id,\n item_price=tostring(input.properties.price),\n quantity=input.properties.quantity\n}}",
204
+ "body": "return {{\n item_price=tostring(input.properties.price),\n quantity=input.properties.quantity\n}}",
311
205
  "lang": "lua"
312
206
  }
313
207
  }
@@ -319,77 +213,6 @@
319
213
  }
320
214
  ]
321
215
  },
322
- "cart_viewed": {
323
- "enrichments": [
324
- {
325
- "outputKey": "event_name",
326
- "staticString": "page_visit"
327
- }
328
- ],
329
- "mappings": [
330
- {
331
- "inputKey": "properties.currency",
332
- "outputKey": "custom_data.currency",
333
- "transforms": [
334
- {
335
- "modifyString": "uppercase"
336
- }
337
- ]
338
- },
339
- {
340
- "inputKey": "input",
341
- "outputKey": "custom_data.value",
342
- "transforms": [
343
- {
344
- "expression": {
345
- "lang": "lua",
346
- "body": "return tostring(SUM(MAP(input.properties.products, function (p) return p.price * (p.quantity or 1) end)))"
347
- }
348
- }
349
- ]
350
- },
351
- {
352
- "inputKey": "input",
353
- "outputKey": "custom_data.content_ids",
354
- "transforms": [
355
- {
356
- "expression": {
357
- "body": "return MAP(input.properties.products, function (p) return p.product_id end )",
358
- "lang": "lua"
359
- }
360
- }
361
- ]
362
- },
363
- {
364
- "inputKey": "input",
365
- "outputKey": "custom_data.contents",
366
- "transforms": [
367
- {
368
- "expression": {
369
- "body": "local contents=MAP(input.properties.products,\n function (p)\n return {\n id=p.product_id,\n item_price=tostring(p.price),\n quantity=p.quantity\n }\n end\n)\nreturn contents",
370
- "lang": "lua"
371
- }
372
- }
373
- ]
374
- },
375
- {
376
- "inputKey": "input",
377
- "outputKey": "custom_data.num_items",
378
- "transforms": [
379
- {
380
- "expression": {
381
- "lang": "lua",
382
- "body": "return SUM(MAP(input.properties.products, function (p) return p.quantity or 1 end))"
383
- }
384
- }
385
- ]
386
- },
387
- {
388
- "inputKey": "properties.order_id",
389
- "outputKey": "custom_data.order_id"
390
- }
391
- ]
392
- },
393
216
  "order_completed": {
394
217
  "enrichments": [
395
218
  {
@@ -437,7 +260,7 @@
437
260
  "transforms": [
438
261
  {
439
262
  "expression": {
440
- "body": "local contents=MAP(input.properties.products,\n function (p)\n return {\n id=p.product_id,\n item_price=tostring(p.price),\n quantity=p.quantity\n }\n end\n)\nreturn contents",
263
+ "body": "local contents=MAP(input.properties.products,\n function (p)\n return {\n item_price=tostring(p.price),\n quantity=p.quantity\n }\n end\n)\nreturn contents",
441
264
  "lang": "lua"
442
265
  }
443
266
  }
package/index.js CHANGED
@@ -48,13 +48,6 @@ exports.amobee = {
48
48
  metadata: require('./.dist/amobee/metadata.json')
49
49
  }
50
50
 
51
- exports.amperity = {
52
- connectionTemplate: connectionSchemas.properties.amperity,
53
- endpointSchema: require('./.dist/amperity/connection.json'),
54
- playbook: require('./.dist/amperity/playbook.json'),
55
- metadata: require('./.dist/amperity/metadata.json')
56
- }
57
-
58
51
  exports.amplitude = {
59
52
  connectionTemplate: connectionSchemas.properties.amplitude,
60
53
  endpointSchema: require('./.dist/amplitude/connection.json'),
@@ -144,13 +137,6 @@ exports['google-ad-words'] = {
144
137
  metadata: require('./.dist/google-ad-words/metadata.json')
145
138
  }
146
139
 
147
- exports['google-ads'] = {
148
- connectionTemplate: connectionSchemas.properties.googleAds,
149
- endpointSchema: require('./.dist/google-ads/connection.json'),
150
- playbook: require('./.dist/google-ads/playbook.json'),
151
- metadata: require('./.dist/google-ads/metadata.json')
152
- }
153
-
154
140
  exports['google-analytics'] = {
155
141
  connectionTemplate: connectionSchemas.properties.googleAnalytics,
156
142
  endpointSchema: require('./.dist/google-analytics/connection.json'),
@@ -438,11 +424,6 @@ exports.etags = {
438
424
  playbook: require('./.dist/amobee/playbook.etag.json'),
439
425
  kit: require('./.dist/amobee/kit.etag.json')
440
426
  },
441
- amperity: {
442
- endpointSchema: require('./.dist/amperity/connection.etag.json'),
443
- playbook: require('./.dist/amperity/playbook.etag.json'),
444
- kit: require('./.dist/amperity/kit.etag.json')
445
- },
446
427
  amplitude: {
447
428
  endpointSchema: require('./.dist/amplitude/connection.etag.json'),
448
429
  playbook: require('./.dist/amplitude/playbook.etag.json'),
@@ -507,11 +488,6 @@ exports.etags = {
507
488
  playbook: require('./.dist/google-ad-words/playbook.etag.json'),
508
489
  kit: require('./.dist/google-ad-words/kit.etag.json')
509
490
  },
510
- 'google-ads': {
511
- endpointSchema: require('./.dist/google-ads/connection.etag.json'),
512
- playbook: require('./.dist/google-ads/playbook.etag.json'),
513
- kit: require('./.dist/google-ads/kit.etag.json')
514
- },
515
491
  'google-analytics': {
516
492
  endpointSchema: require('./.dist/google-analytics/connection.etag.json'),
517
493
  playbook: require('./.dist/google-analytics/playbook.etag.json'),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metarouter/ajs-starter-kit",
3
- "version": "1.0.65",
3
+ "version": "1.0.66",
4
4
  "description": "MetaRouter analytics.js starter kit",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -1 +0,0 @@
1
- "6d0279d8db032deebc6bd9c4407dc5f6"
@@ -1,38 +0,0 @@
1
- {
2
- "params": [
3
- {
4
- "name": "TENANT",
5
- "exampleValue": "my-tenant-id"
6
- },
7
- {
8
- "name": "TOKEN",
9
- "exampleValue": "my-token"
10
- },
11
- {
12
- "name": "STREAM_ID",
13
- "exampleValue": "my-stream-id"
14
- }
15
- ],
16
- "default": {
17
- "endpoint": "https://$$TENANT$$.amperity.com/stream/v0/data/$$STREAM_ID$$",
18
- "method": "POST",
19
- "headers": [
20
- {
21
- "key": "X-Amperity-Tenant",
22
- "value": "$$TENANT$$"
23
- },
24
- {
25
- "key": "Content-Type",
26
- "value": "application/json"
27
- },
28
- {
29
- "key": "Accept-Encoding",
30
- "value": "application/json"
31
- },
32
- {
33
- "key": "Authorization",
34
- "value": "Bearer $$TOKEN$$"
35
- }
36
- ]
37
- }
38
- }
@@ -1 +0,0 @@
1
- "9da41f567b9b941480afd455d121428c"
@@ -1,20 +0,0 @@
1
- {
2
- "isDraft": false,
3
- "isBeta": true,
4
- "friendlyName": "Amperity",
5
- "description": "Amperity is a customer data platform that helps companies to unify their customer data from multiple sources",
6
- "logo": "https://cdn.metarouter.io/Amperity.png",
7
- "color": "#10BC8B",
8
- "eventSource": {
9
- "isAndroidApp": false,
10
- "isIosApp": false,
11
- "isWebApp": true
12
- },
13
- "inputSchema": "analytics_js",
14
- "releaseNotes": [
15
- {
16
- "date": "2023-07-06T00:00:00.000Z",
17
- "note": "Amperity initial release."
18
- }
19
- ]
20
- }
@@ -1 +0,0 @@
1
- "71c76dbec22bb55c09a564e607db8635"
@@ -1,51 +0,0 @@
1
- {
2
- "version": "v0.0.1",
3
- "global": {
4
- "mappings": [
5
- {
6
- "inputKey": "messageId",
7
- "outputKey": "messageId"
8
- },
9
- {
10
- "inputKey": "anonymousId",
11
- "outputKey": "anonymousId"
12
- },
13
- {
14
- "inputKey": "userId",
15
- "outputKey": "userId"
16
- },
17
- {
18
- "inputKey": "originalTimestamp",
19
- "outputKey": "originalTimestamp"
20
- },
21
- {
22
- "inputKey": "timestamp",
23
- "outputKey": "timestamp"
24
- },
25
- {
26
- "inputKey": "context.userAgent",
27
- "outputKey": "context.userAgent"
28
- },
29
- {
30
- "inputKey": "context.providers",
31
- "outputKey": "context.providers"
32
- },
33
- {
34
- "inputKey": "traits",
35
- "outputKey": "traits"
36
- },
37
- {
38
- "inputKey": "type",
39
- "outputKey": "event",
40
- "transforms": [
41
- {
42
- "expression": {
43
- "lang": "lua",
44
- "body": "if (input.type == \"track\") then return REPLACE(LOWER(input.event), \" \", \"_\") end\nreturn input.type"
45
- }
46
- }
47
- ]
48
- }
49
- ]
50
- }
51
- }
@@ -1 +0,0 @@
1
- "754d227567ff86705430a30e69bbbdf9"
@@ -1,72 +0,0 @@
1
- {
2
- "params": [
3
- {
4
- "name": "API_VERSION",
5
- "defaultValue": "v14"
6
- },
7
- {
8
- "name": "CUSTOMER_ID",
9
- "exampleValue": "customer-id"
10
- },
11
- {
12
- "name": "SERVICE_ACCOUNT_CLIENT_EMAIL",
13
- "exampleValue": "service-account-client-email"
14
- },
15
- {
16
- "name": "SERVICE_ACCOUNT_PRIVATE_KEY",
17
- "exampleValue": "service-account-private-key"
18
- }
19
- ],
20
- "default": {
21
- "endpoint": "https://googleads.googleapis.com/$$API_VERSION$$/customers/$$CUSTOMER_ID$$:uploadClickConversions",
22
- "batchSize": 100,
23
- "method": "POST",
24
- "headers": [
25
- {
26
- "key": "Content-Type",
27
- "value": "application/x-www-form-urlencoded"
28
- },
29
- {
30
- "key": "Accept-Encoding",
31
- "value": "application/json"
32
- }
33
- ],
34
- "oauth2_auth": {
35
- "request": {
36
- "url": "https://oauth2.googleapis.com/token",
37
- "contentType": "application/x-www-form-urlencoded",
38
- "method": "POST",
39
- "body": [
40
- {
41
- "key": "grant_type",
42
- "value": "urn:ietf:params:oauth:grant-type:jwt-bearer"
43
- }
44
- ]
45
- },
46
- "responseAccessTokenKey": "access_token",
47
- "jwt": {
48
- "claims": [
49
- {
50
- "key": "aud",
51
- "value": "https://oauth2.googleapis.com/token"
52
- },
53
- {
54
- "key": "scope",
55
- "value": "https://www.googleapis.com/auth/adwords"
56
- },
57
- {
58
- "key": "iss",
59
- "value": "$$SERVICE_ACCOUNT_CLIENT_EMAIL$$"
60
- }
61
- ],
62
- "signingMethod": "SIGNING_METHOD_RS256",
63
- "rsaPemKey": "$$SERVICE_ACCOUNT_PRIVATE_KEY$$",
64
- "requestKey": "assertion"
65
- }
66
- },
67
- "transform": {
68
- "lang": "lua",
69
- "body": "request.body = { conversions = batch }\nreturn request"
70
- }
71
- }
72
- }
@@ -1 +0,0 @@
1
- "c0f1ae5b49b9dfcd4543bb181ead9c4f"
@@ -1,20 +0,0 @@
1
- {
2
- "isDraft": false,
3
- "isBeta": true,
4
- "friendlyName": "Google Ads",
5
- "description": "Google Ads is an online advertising platform developed by Google, where advertisers bid to display advertisements to users.",
6
- "logo": "https://cdn.metarouter.io/logo.svg",
7
- "color": "#4185f5",
8
- "eventSource": {
9
- "isAndroidApp": true,
10
- "isIosApp": true,
11
- "isWebApp": true
12
- },
13
- "inputSchema": "analytics_js",
14
- "releaseNotes": [
15
- {
16
- "date": "2023-07-04T00:00:00.000Z",
17
- "note": "Google Ads initial release."
18
- }
19
- ]
20
- }
@@ -1 +0,0 @@
1
- "784aa57838afc393f56535fc586b8dae"
@@ -1,148 +0,0 @@
1
- {
2
- "version": "v0.0.1",
3
- "params": [
4
- {
5
- "name": "CUSTOMER_ID",
6
- "exampleValue": "customer-id"
7
- },
8
- {
9
- "name": "PAGE_CONVERSION_ACTION",
10
- "defaultValue": "page-conversion-action"
11
- },
12
- {
13
- "name": "ORDER_COMPLETED_CONVERSION_ACTION",
14
- "defaultValue": "order-completed-conversion-action"
15
- }
16
- ],
17
- "default": {
18
- "filters": [
19
- {
20
- "byEventNames": {
21
- "action": "allow",
22
- "events": [
23
- ""
24
- ]
25
- }
26
- }
27
- ]
28
- },
29
- "global": {
30
- "expressions": [
31
- {
32
- "lang": "lua",
33
- "body": "local click_ids = {}\nif input.context.providers.googleGtag.data.wbraid then\n click_ids.wbraid = input.context.providers.googleGtag.data.wbraid\nelseif input.context.providers.googleGtag.data.gbraid then\n click_ids.gbraid = input.context.providers.googleGtag.data.gbraid\nend\nreturn click_ids"
34
- }
35
- ],
36
- "filters": [
37
- {
38
- "byConditions": {
39
- "action": "allow",
40
- "when": {
41
- "inputPathExists": {
42
- "inputPath": "context.providers.googleGtag.data.gclid"
43
- }
44
- }
45
- }
46
- }
47
- ],
48
- "mappings": [
49
- {
50
- "inputKey": "context.providers.googleGtag.data.gclid",
51
- "outputKey": "gclid"
52
- },
53
- {
54
- "inputKey": "input",
55
- "outputKey": "userIdentifiers",
56
- "transforms": [
57
- {
58
- "expression": {
59
- "lang": "lua",
60
- "body": "if input.traits.email then\n return {{ hashedEmail = TO_SHA256_HASH(LOWER(TRIM(input.traits.email))) }}\nend"
61
- }
62
- }
63
- ]
64
- },
65
- {
66
- "inputKey": "input",
67
- "outputKey": "conversionDateTime",
68
- "transforms": [
69
- {
70
- "expression": {
71
- "lang": "lua",
72
- "body": "local date = input.originalTimestamp or input.sentAt\nlocal timezoneOffset = input.context.providers.googleGtag.data.timezone_offset or 0\nreturn TO_DATE_TIME(date, { inputFormat = \"2006-01-02T15:04:05Z07:00\", outputLocation = { name = \"!UTC\", offset = TO_TRUNCATED_INT(timezoneOffset) * 60 }, outputFormat = \"2006-01-02 15:04:05-07:00\" })"
73
- }
74
- }
75
- ]
76
- }
77
- ]
78
- },
79
- "eventSpecific": {
80
- "page": {
81
- "enrichments": [
82
- {
83
- "outputKey": "conversionValue",
84
- "staticInt": 1
85
- }
86
- ],
87
- "mappings": [
88
- {
89
- "inputKey": "input",
90
- "outputKey": "conversionAction",
91
- "transforms": [
92
- {
93
- "expression": {
94
- "body": "return \"customers/$$CUSTOMER_ID$$/conversionActions/$$PAGE_CONVERSION_ACTION$$\"",
95
- "lang": "lua"
96
- }
97
- }
98
- ]
99
- }
100
- ]
101
- },
102
- "order_completed": {
103
- "mappings": [
104
- {
105
- "inputKey": "input",
106
- "outputKey": "conversionAction",
107
- "transforms": [
108
- {
109
- "expression": {
110
- "body": "return \"customers/$$CUSTOMER_ID$$/conversionActions/$$ORDER_COMPLETED_CONVERSION_ACTION$$\"",
111
- "lang": "lua"
112
- }
113
- }
114
- ]
115
- },
116
- {
117
- "inputKey": "properties.currency",
118
- "outputKey": "currencyCode",
119
- "transforms": [
120
- {
121
- "modifyString": "uppercase"
122
- }
123
- ]
124
- },
125
- {
126
- "inputKey": "properties.revenue",
127
- "outputKey": "conversionValue"
128
- },
129
- {
130
- "inputKey": "properties.order_id",
131
- "outputKey": "orderId"
132
- },
133
- {
134
- "inputKey": "input",
135
- "outputKey": "cartData.items",
136
- "transforms": [
137
- {
138
- "expression": {
139
- "body": "return MAP(\n input.properties.products,\n function (p)\n return {\n productId = p.product_id,\n quantity = p.quantity or 1,\n unitPrice = p.price\n }\n end\n)",
140
- "lang": "lua"
141
- }
142
- }
143
- ]
144
- }
145
- ]
146
- }
147
- }
148
- }