@metarouter/ajs-starter-kit 1.0.68 → 1.0.70

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
- "3453d59506fd2a770493f366eb472f62"
1
+ "2c344987d84ba89015a2841aceec62b3"
@@ -13,7 +13,7 @@
13
13
  "inputSchema": "analytics_js",
14
14
  "releaseNotes": [
15
15
  {
16
- "date": "2023-08-16T00:00:00.000Z",
16
+ "date": "2023-09-07T00:00:00.000Z",
17
17
  "note": "Kochava initial release."
18
18
  }
19
19
  ]
@@ -0,0 +1 @@
1
+ "ad49192399cc19dcccb4e78923ef1a9f"
@@ -0,0 +1,67 @@
1
+ {
2
+ "params": [
3
+ {
4
+ "name": "ACCOUNT_ID",
5
+ "exampleValue": "account-id"
6
+ },
7
+ {
8
+ "name": "REFRESH_TOKEN",
9
+ "exampleValue": "refresh-token"
10
+ },
11
+ {
12
+ "name": "BASIC_AUTH",
13
+ "exampleValue": "basic-auth"
14
+ }
15
+ ],
16
+ "default": {
17
+ "batchSize": 500,
18
+ "endpoint": "https://ads-api.reddit.com/api/v2.0/conversions/events/$$ACCOUNT_ID$$",
19
+ "headers": [
20
+ {
21
+ "key": "User-Agent",
22
+ "value": "web:metarouter:v1.0.0 (by /u/metarouter_io)"
23
+ }
24
+ ],
25
+ "method": "POST",
26
+ "oauth2Auth": {
27
+ "request": {
28
+ "body": [
29
+ {
30
+ "key": "grant_type",
31
+ "value": "refresh_token"
32
+ },
33
+ {
34
+ "key": "refresh_token",
35
+ "value": "$$REFRESH_TOKEN$$"
36
+ }
37
+ ],
38
+ "contentType": "application/x-www-form-urlencoded",
39
+ "headers": [
40
+ {
41
+ "key": "Accept",
42
+ "value": "*/*"
43
+ },
44
+ {
45
+ "key": "Content-Type",
46
+ "value": "application/x-www-form-urlencoded"
47
+ },
48
+ {
49
+ "key": "Authorization",
50
+ "value": "Basic $$BASIC_AUTH$$"
51
+ },
52
+ {
53
+ "key": "User-Agent",
54
+ "value": "web:metarouter:v1.0.0 (by /u/metarouter_io)"
55
+ }
56
+ ],
57
+ "method": "POST",
58
+ "url": "https://www.reddit.com/api/v1/access_token"
59
+ },
60
+ "responseAccessTokenKey": "access_token"
61
+ },
62
+ "transform": {
63
+ "lang": "lua",
64
+ "body": "request.body = { events = batch }\nreturn request"
65
+ }
66
+ }
67
+ }
@@ -0,0 +1 @@
1
+ "d58462f900d3851ed5f8ba33d68a2f71"
@@ -0,0 +1,20 @@
1
+ {
2
+ "isDraft": false,
3
+ "isBeta": false,
4
+ "friendlyName": "Reddit Ads",
5
+ "description": "Reddit ds are a form of advertising platform used by businesses and individuals to reach their target audience on Reddit.",
6
+ "logo": "https://cdn.metarouter.io/logo.svg",
7
+ "color": "#ED001C",
8
+ "eventSource": {
9
+ "isAndroidApp": "no",
10
+ "isIosApp": "no",
11
+ "isWebApp": true
12
+ },
13
+ "inputSchema": "analytics_js",
14
+ "releaseNotes": [
15
+ {
16
+ "date": "2023-09-12T00:00:00.000Z",
17
+ "note": "Reddit Ads initial release."
18
+ }
19
+ ]
20
+ }
@@ -0,0 +1 @@
1
+ "aa7bd95cd55cc7377b22a2906f417f1f"
@@ -0,0 +1,312 @@
1
+ {
2
+ "version": "v0.0.1",
3
+ "default": {
4
+ "filters": [
5
+ {
6
+ "byEventNames": {
7
+ "action": "allow",
8
+ "events": [
9
+ ""
10
+ ]
11
+ }
12
+ }
13
+ ]
14
+ },
15
+ "global": {
16
+ "mappings": [
17
+ {
18
+ "inputKey": "messageId",
19
+ "outputKey": "event_metadata.conversion_id"
20
+ },
21
+ {
22
+ "inputKey": "context.providers.redditAds.rdt_cid",
23
+ "outputKey": "click_id"
24
+ },
25
+ {
26
+ "inputKey": "input",
27
+ "outputKey": "event_at",
28
+ "transforms": [
29
+ {
30
+ "expression": {
31
+ "body": "return input.originalTimestamp or input.sentAt",
32
+ "lang": "lua"
33
+ }
34
+ }
35
+ ]
36
+ },
37
+ {
38
+ "inputKey": "anonymousId",
39
+ "outputKey": "user.external_id"
40
+ },
41
+ {
42
+ "inputKey": "context.ip",
43
+ "outputKey": "user.ip_address"
44
+ },
45
+ {
46
+ "inputKey": "context.userAgent",
47
+ "outputKey": "user.user_agent"
48
+ },
49
+ {
50
+ "inputKey": "context.traits.email",
51
+ "outputKey": "user.email",
52
+ "transforms": [
53
+ {
54
+ "toHash": "sha256"
55
+ }
56
+ ]
57
+ }
58
+ ]
59
+ },
60
+ "eventSpecific": {
61
+ "page": {
62
+ "enrichments": [
63
+ {
64
+ "outputKey": "event_type.tracking_type",
65
+ "staticString": "Custom"
66
+ },
67
+ {
68
+ "outputKey": "event_type.custom_event_name",
69
+ "staticString": "Page"
70
+ }
71
+ ]
72
+ },
73
+ "products_searched": {
74
+ "enrichments": [
75
+ {
76
+ "outputKey": "event_type.tracking_type",
77
+ "staticString": "Custom"
78
+ }
79
+ ],
80
+ "mappings": [
81
+ {
82
+ "inputKey": "event",
83
+ "outputKey": "event_type.custom_event_name"
84
+ }
85
+ ]
86
+ },
87
+ "product_list_viewed": {
88
+ "enrichments": [
89
+ {
90
+ "outputKey": "event_type.tracking_type",
91
+ "staticString": "Custom"
92
+ }
93
+ ],
94
+ "mappings": [
95
+ {
96
+ "inputKey": "event",
97
+ "outputKey": "event_type.custom_event_name"
98
+ },
99
+ {
100
+ "inputKey": "input",
101
+ "outputKey": "event_metadata.item_count",
102
+ "transforms": [
103
+ {
104
+ "expression": {
105
+ "body": "return SUM(MAP(input.properties.products, function (p) return p.quantity or 1 end))",
106
+ "lang": "lua"
107
+ }
108
+ }
109
+ ]
110
+ },
111
+ {
112
+ "inputKey": "input",
113
+ "outputKey": "event_metadata.products",
114
+ "transforms": [
115
+ {
116
+ "expression": {
117
+ "body": "return MAP(\n input.properties.products,\n function (p)\n return {\n id=p.product_id or p.sku,\n name=p.name,\n category=p.category or \"product\"\n }\n end\n)",
118
+ "lang": "lua"
119
+ }
120
+ }
121
+ ]
122
+ }
123
+ ]
124
+ },
125
+ "product_viewed": {
126
+ "enrichments": [
127
+ {
128
+ "outputKey": "event_type.tracking_type",
129
+ "staticString": "Custom"
130
+ },
131
+ {
132
+ "outputKey": "event_metadata.item_count",
133
+ "staticInt": 1
134
+ }
135
+ ],
136
+ "mappings": [
137
+ {
138
+ "inputKey": "event",
139
+ "outputKey": "event_type.custom_event_name"
140
+ },
141
+ {
142
+ "inputKey": "input",
143
+ "outputKey": "event_metadata.products",
144
+ "transforms": [
145
+ {
146
+ "expression": {
147
+ "body": "return {{\n id=input.properties.product_id or input.properties.sku,\n name=input.properties.name,\n category=input.properties.category or \"product\"\n}}",
148
+ "lang": "lua"
149
+ }
150
+ }
151
+ ]
152
+ }
153
+ ]
154
+ },
155
+ "product_added": {
156
+ "enrichments": [
157
+ {
158
+ "outputKey": "event_type.tracking_type",
159
+ "staticString": "AddToCart"
160
+ }
161
+ ],
162
+ "mappings": [
163
+ {
164
+ "inputKey": "properties.currency",
165
+ "outputKey": "event_metadata.currency",
166
+ "transforms": [
167
+ {
168
+ "modifyString": "uppercase"
169
+ }
170
+ ],
171
+ "defaultString": "USD"
172
+ },
173
+ {
174
+ "inputKey": "properties.quantity",
175
+ "outputKey": "event_metadata.item_count"
176
+ },
177
+ {
178
+ "inputKey": "input",
179
+ "outputKey": "event_metadata.products",
180
+ "transforms": [
181
+ {
182
+ "expression": {
183
+ "body": "return {{\n id=input.properties.product_id or input.properties.sku,\n name=input.properties.name,\n category=input.properties.category or \"product\"\n}}",
184
+ "lang": "lua"
185
+ }
186
+ }
187
+ ]
188
+ },
189
+ {
190
+ "inputKey": "input",
191
+ "outputKey": "event_metadata.value_decimal",
192
+ "transforms": [
193
+ {
194
+ "expression": {
195
+ "lang": "lua",
196
+ "body": "return input.properties.price * (input.properties.quantity or 1)"
197
+ }
198
+ }
199
+ ]
200
+ }
201
+ ]
202
+ },
203
+ "cart_viewed": {
204
+ "enrichments": [
205
+ {
206
+ "outputKey": "event_type.tracking_type",
207
+ "staticString": "Custom"
208
+ }
209
+ ],
210
+ "mappings": [
211
+ {
212
+ "inputKey": "event",
213
+ "outputKey": "event_type.custom_event_name"
214
+ },
215
+ {
216
+ "inputKey": "properties.currency",
217
+ "outputKey": "event_metadata.currency",
218
+ "transforms": [
219
+ {
220
+ "modifyString": "uppercase"
221
+ }
222
+ ],
223
+ "defaultString": "USD"
224
+ },
225
+ {
226
+ "inputKey": "input",
227
+ "outputKey": "event_metadata.item_count",
228
+ "transforms": [
229
+ {
230
+ "expression": {
231
+ "body": "return SUM(MAP(input.properties.products, function (p) return p.quantity or 1 end))",
232
+ "lang": "lua"
233
+ }
234
+ }
235
+ ]
236
+ },
237
+ {
238
+ "inputKey": "input",
239
+ "outputKey": "event_metadata.products",
240
+ "transforms": [
241
+ {
242
+ "expression": {
243
+ "body": "return MAP(\n input.properties.products,\n function (p)\n return {\n id=p.product_id or p.sku,\n name=p.name,\n category=p.category or \"product\"\n }\n end\n)",
244
+ "lang": "lua"
245
+ }
246
+ }
247
+ ]
248
+ },
249
+ {
250
+ "inputKey": "input",
251
+ "outputKey": "event_metadata.value_decimal",
252
+ "transforms": [
253
+ {
254
+ "expression": {
255
+ "body": "return SUM(MAP(input.properties.products, function (p) return p.price * (p.quantity or 1) end))",
256
+ "lang": "lua"
257
+ }
258
+ }
259
+ ]
260
+ }
261
+ ]
262
+ },
263
+ "order_completed": {
264
+ "enrichments": [
265
+ {
266
+ "outputKey": "event_type.tracking_type",
267
+ "staticString": "Purchase"
268
+ }
269
+ ],
270
+ "mappings": [
271
+ {
272
+ "inputKey": "properties.currency",
273
+ "outputKey": "event_metadata.currency",
274
+ "transforms": [
275
+ {
276
+ "modifyString": "uppercase"
277
+ }
278
+ ],
279
+ "defaultString": "USD"
280
+ },
281
+ {
282
+ "inputKey": "input",
283
+ "outputKey": "event_metadata.item_count",
284
+ "transforms": [
285
+ {
286
+ "expression": {
287
+ "body": "return SUM(MAP(input.properties.products, function (p) return p.quantity or 1 end))",
288
+ "lang": "lua"
289
+ }
290
+ }
291
+ ]
292
+ },
293
+ {
294
+ "inputKey": "input",
295
+ "outputKey": "event_metadata.products",
296
+ "transforms": [
297
+ {
298
+ "expression": {
299
+ "body": "return MAP(\n input.properties.products,\n function (p)\n return {\n id=p.product_id or p.sku,\n name=p.name,\n category=p.category or \"product\"\n }\n end\n)",
300
+ "lang": "lua"
301
+ }
302
+ }
303
+ ]
304
+ },
305
+ {
306
+ "inputKey": "properties.total",
307
+ "outputKey": "event_metadata.value_decimal"
308
+ }
309
+ ]
310
+ }
311
+ }
312
+ }
package/index.js CHANGED
@@ -223,6 +223,13 @@ exports.kinesis = {
223
223
  metadata: require('./.dist/kinesis/metadata.json')
224
224
  }
225
225
 
226
+ exports.kochava = {
227
+ connectionTemplate: connectionSchemas.properties.kochava,
228
+ endpointSchema: require('./.dist/kochava/connection.json'),
229
+ playbook: require('./.dist/kochava/playbook.json'),
230
+ metadata: require('./.dist/kochava/metadata.json')
231
+ }
232
+
226
233
  exports.lytics = {
227
234
  connectionTemplate: connectionSchemas.properties.lytics,
228
235
  endpointSchema: require('./.dist/lytics/connection.json'),
@@ -293,6 +300,13 @@ exports.podsights = {
293
300
  metadata: require('./.dist/podsights/metadata.json')
294
301
  }
295
302
 
303
+ exports['reddit-ads'] = {
304
+ connectionTemplate: connectionSchemas.properties.redditAds,
305
+ endpointSchema: require('./.dist/reddit-ads/connection.json'),
306
+ playbook: require('./.dist/reddit-ads/playbook.json'),
307
+ metadata: require('./.dist/reddit-ads/metadata.json')
308
+ }
309
+
296
310
  exports['rev-jet'] = {
297
311
  connectionTemplate: connectionSchemas.properties.revJet,
298
312
  endpointSchema: require('./.dist/rev-jet/connection.json'),
@@ -562,6 +576,10 @@ exports.etags = {
562
576
  playbook: require('./.dist/kinesis/playbook.etag.json'),
563
577
  kit: require('./.dist/kinesis/kit.etag.json')
564
578
  },
579
+ kochava: {
580
+ playbook: require('./.dist/kochava/playbook.etag.json'),
581
+ kit: require('./.dist/kochava/kit.etag.json')
582
+ },
565
583
  lytics: {
566
584
  endpointSchema: require('./.dist/lytics/connection.etag.json'),
567
585
  playbook: require('./.dist/lytics/playbook.etag.json'),
@@ -612,6 +630,11 @@ exports.etags = {
612
630
  playbook: require('./.dist/podsights/playbook.etag.json'),
613
631
  kit: require('./.dist/podsights/kit.etag.json')
614
632
  },
633
+ 'reddit-ads': {
634
+ endpointSchema: require('./.dist/reddit-ads/connection.etag.json'),
635
+ playbook: require('./.dist/reddit-ads/playbook.etag.json'),
636
+ kit: require('./.dist/reddit-ads/kit.etag.json')
637
+ },
615
638
  'rev-jet': {
616
639
  endpointSchema: require('./.dist/rev-jet/connection.etag.json'),
617
640
  playbook: require('./.dist/rev-jet/playbook.etag.json'),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metarouter/ajs-starter-kit",
3
- "version": "1.0.68",
3
+ "version": "1.0.70",
4
4
  "description": "MetaRouter analytics.js starter kit",
5
5
  "main": "index.js",
6
6
  "scripts": {