@metarouter/ajs-starter-kit 1.0.100 → 1.0.101

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.
@@ -0,0 +1 @@
1
+ "24c6d99eb12416541e16b99f7c131fef"
@@ -0,0 +1,28 @@
1
+ {
2
+ "default": {
3
+ "endpoint": "https://mgln.ai/",
4
+ "method": "POST",
5
+ "headers": [
6
+ {
7
+ "key": "Content-Type",
8
+ "value": "application/json"
9
+ },
10
+ {
11
+ "key": "Referer",
12
+ "fromEventKey": "context.page.referrer"
13
+ },
14
+ {
15
+ "key": "User-Agent",
16
+ "fromEventKey": "context.userAgent"
17
+ },
18
+ {
19
+ "key": "X-Forwarded-For",
20
+ "fromEventKey": "context.ip"
21
+ }
22
+ ],
23
+ "transform": {
24
+ "lang": "lua",
25
+ "body": "local body = batch[1]\nlocal endpoint_event = body.event or \"view\"\nbody.event = nil\nrequest.body = body\nrequest.url = \"https://mgln.ai/\" .. endpoint_event\nreturn request"
26
+ }
27
+ }
28
+ }
@@ -0,0 +1 @@
1
+ "62d8cad0cf7b35f15f00aa91d0bd03b8"
@@ -0,0 +1,20 @@
1
+ {
2
+ "isDraft": false,
3
+ "isBeta": true,
4
+ "friendlyName": "Magellan AI",
5
+ "description": "Magellan AI is an all-in-one platform that helps businesses optimize their podcast advertising campaigns.",
6
+ "logo": "https://cdn.metarouter.io/magellan-ai.png",
7
+ "color": "#0b0b7c",
8
+ "eventSource": {
9
+ "isAndroidApp": false,
10
+ "isIosApp": false,
11
+ "isWebApp": true
12
+ },
13
+ "inputSchema": "analytics_js",
14
+ "releaseNotes": [
15
+ {
16
+ "date": "2024-07-24T00:00:00.000Z",
17
+ "note": "Version: 0.1.0\nBeta Version\nMagellan AI initial release"
18
+ }
19
+ ]
20
+ }
@@ -0,0 +1 @@
1
+ "7eb1d343b2557653d5246aff32b02fcb"
@@ -0,0 +1,320 @@
1
+ {
2
+ "version": "0.1.0",
3
+ "params": [
4
+ {
5
+ "name": "TOKEN",
6
+ "exampleValue": "my-token",
7
+ "isOptional": false
8
+ }
9
+ ],
10
+ "default": {
11
+ "filters": [
12
+ {
13
+ "byEventNames": {
14
+ "action": "allow",
15
+ "events": [
16
+ ""
17
+ ]
18
+ }
19
+ }
20
+ ]
21
+ },
22
+ "global": {
23
+ "enrichments": [
24
+ {
25
+ "staticString": "$$TOKEN$$",
26
+ "outputKey": "token"
27
+ }
28
+ ],
29
+ "mappings": [
30
+ {
31
+ "inputKey": "context.page.referrer",
32
+ "outputKey": "referrer"
33
+ }
34
+ ]
35
+ },
36
+ "eventSpecific": {
37
+ "identify": {
38
+ "enrichments": [
39
+ {
40
+ "staticString": "identify",
41
+ "outputKey": "event"
42
+ }
43
+ ],
44
+ "mappings": [
45
+ {
46
+ "inputKey": "input",
47
+ "outputKey": "userId",
48
+ "transforms": [
49
+ {
50
+ "expression": {
51
+ "lang": "lua",
52
+ "body": "local email = input.traits.email or input.context.traits.email\nif (email) then return TO_SHA256_HASH(LOWER(TRIM(email))) end\nreturn input.userId"
53
+ }
54
+ }
55
+ ]
56
+ }
57
+ ]
58
+ },
59
+ "page": {
60
+ "enrichments": [
61
+ {
62
+ "staticString": "view",
63
+ "outputKey": "event"
64
+ }
65
+ ],
66
+ "mappings": [
67
+ {
68
+ "inputKey": "context.page.url",
69
+ "outputKey": "url"
70
+ }
71
+ ]
72
+ },
73
+ "product_viewed": {
74
+ "enrichments": [
75
+ {
76
+ "staticString": "product",
77
+ "outputKey": "event"
78
+ }
79
+ ],
80
+ "mappings": [
81
+ {
82
+ "inputKey": "properties.product_id",
83
+ "outputKey": "productId"
84
+ },
85
+ {
86
+ "inputKey": "properties.name",
87
+ "outputKey": "productName"
88
+ },
89
+ {
90
+ "inputKey": "properties.category",
91
+ "outputKey": "productType"
92
+ },
93
+ {
94
+ "inputKey": "properties.brand",
95
+ "outputKey": "productVendor"
96
+ },
97
+ {
98
+ "inputKey": "properties.price",
99
+ "outputKey": "value"
100
+ },
101
+ {
102
+ "inputKey": "properties.currency",
103
+ "outputKey": "currency",
104
+ "transforms": [
105
+ {
106
+ "modifyString": "uppercase"
107
+ }
108
+ ],
109
+ "defaultString": "USD"
110
+ },
111
+ {
112
+ "inputKey": "properties.variant",
113
+ "outputKey": "variantName"
114
+ }
115
+ ]
116
+ },
117
+ "product_added": {
118
+ "enrichments": [
119
+ {
120
+ "staticString": "add_to_cart",
121
+ "outputKey": "event"
122
+ }
123
+ ],
124
+ "mappings": [
125
+ {
126
+ "inputKey": "properties.product_id",
127
+ "outputKey": "productId"
128
+ },
129
+ {
130
+ "inputKey": "properties.name",
131
+ "outputKey": "productName"
132
+ },
133
+ {
134
+ "inputKey": "properties.category",
135
+ "outputKey": "productType"
136
+ },
137
+ {
138
+ "inputKey": "properties.brand",
139
+ "outputKey": "productVendor"
140
+ },
141
+ {
142
+ "inputKey": "input",
143
+ "outputKey": "value",
144
+ "transforms": [
145
+ {
146
+ "expression": {
147
+ "lang": "lua",
148
+ "body": "return input.properties.price * (input.properties.quantity or 1)"
149
+ }
150
+ }
151
+ ]
152
+ },
153
+ {
154
+ "inputKey": "properties.quantity",
155
+ "outputKey": "quantity"
156
+ },
157
+ {
158
+ "inputKey": "properties.currency",
159
+ "outputKey": "currency",
160
+ "transforms": [
161
+ {
162
+ "modifyString": "uppercase"
163
+ }
164
+ ],
165
+ "defaultString": "USD"
166
+ },
167
+ {
168
+ "inputKey": "properties.variant",
169
+ "outputKey": "variantName"
170
+ }
171
+ ]
172
+ },
173
+ "checkout_started": {
174
+ "enrichments": [
175
+ {
176
+ "staticString": "checkout",
177
+ "outputKey": "event"
178
+ }
179
+ ],
180
+ "mappings": [
181
+ {
182
+ "inputKey": "input",
183
+ "outputKey": "value",
184
+ "transforms": [
185
+ {
186
+ "expression": {
187
+ "lang": "lua",
188
+ "body": "return SUM(MAP(input.properties.products, function (p) return p.price * (p.quantity or 1) end))"
189
+ }
190
+ }
191
+ ]
192
+ },
193
+ {
194
+ "inputKey": "input",
195
+ "outputKey": "quantity",
196
+ "transforms": [
197
+ {
198
+ "expression": {
199
+ "lang": "lua",
200
+ "body": "return SUM(MAP(input.properties.products, function (p) return p.quantity or 1 end))"
201
+ }
202
+ }
203
+ ]
204
+ },
205
+ {
206
+ "inputKey": "properties.currency",
207
+ "outputKey": "currency",
208
+ "transforms": [
209
+ {
210
+ "modifyString": "uppercase"
211
+ }
212
+ ],
213
+ "defaultString": "USD"
214
+ },
215
+ {
216
+ "inputKey": "properties.coupon",
217
+ "outputKey": "discountCode"
218
+ },
219
+ {
220
+ "inputKey": "properties.order_id",
221
+ "outputKey": "id"
222
+ },
223
+ {
224
+ "inputKey": "input",
225
+ "outputKey": "lineItems",
226
+ "transforms": [
227
+ {
228
+ "expression": {
229
+ "lang": "lua",
230
+ "body": "return MAP(\n input.properties.products,\n function (p)\n return {\n productId = p.product_id,\n productName = p.name,\n productType = p.category,\n productVendor = p.brand,\n variantName = p.variant,\n quantity=p.quantity or 1\n }\n end\n)"
231
+ }
232
+ }
233
+ ]
234
+ }
235
+ ]
236
+ },
237
+ "coupon_entered": {
238
+ "enrichments": [
239
+ {
240
+ "staticString": "code",
241
+ "outputKey": "event"
242
+ },
243
+ {
244
+ "staticString": "coupon",
245
+ "outputKey": "type"
246
+ }
247
+ ],
248
+ "mappings": [
249
+ {
250
+ "inputKey": "properties.coupon_id",
251
+ "outputKey": "code"
252
+ }
253
+ ]
254
+ },
255
+ "order_completed": {
256
+ "enrichments": [
257
+ {
258
+ "staticString": "purchase",
259
+ "outputKey": "event"
260
+ }
261
+ ],
262
+ "mappings": [
263
+ {
264
+ "inputKey": "input",
265
+ "outputKey": "value",
266
+ "transforms": [
267
+ {
268
+ "expression": {
269
+ "lang": "lua",
270
+ "body": "return SUM(MAP(input.properties.products, function (p) return p.price * (p.quantity or 1) end))"
271
+ }
272
+ }
273
+ ]
274
+ },
275
+ {
276
+ "inputKey": "input",
277
+ "outputKey": "quantity",
278
+ "transforms": [
279
+ {
280
+ "expression": {
281
+ "lang": "lua",
282
+ "body": "return SUM(MAP(input.properties.products, function (p) return p.quantity or 1 end))"
283
+ }
284
+ }
285
+ ]
286
+ },
287
+ {
288
+ "inputKey": "properties.currency",
289
+ "outputKey": "currency",
290
+ "transforms": [
291
+ {
292
+ "modifyString": "uppercase"
293
+ }
294
+ ],
295
+ "defaultString": "USD"
296
+ },
297
+ {
298
+ "inputKey": "properties.coupon",
299
+ "outputKey": "discountCode"
300
+ },
301
+ {
302
+ "inputKey": "properties.order_id",
303
+ "outputKey": "id"
304
+ },
305
+ {
306
+ "inputKey": "input",
307
+ "outputKey": "lineItems",
308
+ "transforms": [
309
+ {
310
+ "expression": {
311
+ "lang": "lua",
312
+ "body": "return MAP(\n input.properties.products,\n function (p)\n return {\n productId = p.product_id,\n productName = p.name,\n productType = p.category,\n productVendor = p.brand,\n variantName = p.variant,\n quantity=p.quantity or 1\n }\n end\n)"
313
+ }
314
+ }
315
+ ]
316
+ }
317
+ ]
318
+ }
319
+ }
320
+ }
package/README.md CHANGED
@@ -6,6 +6,7 @@ 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-07
9
+ - Magellan AI (BETA)
9
10
  - Nextdoor - CAPI
10
11
  - Snapchat - CAPI
11
12
 
@@ -93,6 +94,7 @@ previously.
93
94
 
94
95
  | Kit Name | Date | Latest Note |
95
96
  |----------|------|-------------|
97
+ | Magellan AI (BETA) | 2024-07 | Version: 0.1.0 Beta Version Magellan AI initial release |
96
98
  | Nextdoor - CAPI | 2024-07 | Version: 1.0.0 Stable release |
97
99
  | Snapchat - CAPI | 2024-07 | Version: 1.0.0 Stable release |
98
100
  | Adobe Analytics (BETA) | 2024-06 | Version: 0.2.0 Adding Bearer Authentication Removing oAuth |
package/index.js CHANGED
@@ -261,6 +261,12 @@ exports.lytics = {
261
261
  metadata: require('./.dist/lytics/metadata.json')
262
262
  }
263
263
 
264
+ exports['magellan-ai'] = {
265
+ endpointSchema: require('./.dist/magellan-ai/connection.json'),
266
+ playbook: require('./.dist/magellan-ai/playbook.json'),
267
+ metadata: require('./.dist/magellan-ai/metadata.json')
268
+ }
269
+
264
270
  exports['media-math'] = {
265
271
  endpointSchema: require('./.dist/media-math/connection.json'),
266
272
  playbook: require('./.dist/media-math/playbook.json'),
@@ -643,6 +649,11 @@ exports.etags = {
643
649
  playbook: require('./.dist/lytics/playbook.etag.json'),
644
650
  kit: require('./.dist/lytics/kit.etag.json')
645
651
  },
652
+ 'magellan-ai': {
653
+ endpointSchema: require('./.dist/magellan-ai/connection.etag.json'),
654
+ playbook: require('./.dist/magellan-ai/playbook.etag.json'),
655
+ kit: require('./.dist/magellan-ai/kit.etag.json')
656
+ },
646
657
  'media-math': {
647
658
  endpointSchema: require('./.dist/media-math/connection.etag.json'),
648
659
  playbook: require('./.dist/media-math/playbook.etag.json'),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metarouter/ajs-starter-kit",
3
- "version": "1.0.100",
3
+ "version": "1.0.101",
4
4
  "description": "MetaRouter analytics.js starter kit",
5
5
  "main": "index.js",
6
6
  "scripts": {