@metarouter/ajs-starter-kit 1.0.69 → 1.0.71

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
- "c0f1ae5b49b9dfcd4543bb181ead9c4f"
1
+ "e9d4a0b957a700a9e5e7527a9ab3856a"
@@ -15,6 +15,10 @@
15
15
  {
16
16
  "date": "2023-07-04T00:00:00.000Z",
17
17
  "note": "Google Ads initial release."
18
+ },
19
+ {
20
+ "date": "2023-09-12T00:00:00.000Z",
21
+ "note": "Bug fixing the `gclid` value\nReplace params usage for conversion action IDs"
18
22
  }
19
23
  ]
20
24
  }
@@ -1 +1 @@
1
- "784aa57838afc393f56535fc586b8dae"
1
+ "11ff4e34a02203e6cbe54646441ea36d"
@@ -4,14 +4,6 @@
4
4
  {
5
5
  "name": "CUSTOMER_ID",
6
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
7
  }
16
8
  ],
17
9
  "default": {
@@ -48,7 +40,15 @@
48
40
  "mappings": [
49
41
  {
50
42
  "inputKey": "context.providers.googleGtag.data.gclid",
51
- "outputKey": "gclid"
43
+ "outputKey": "gclid",
44
+ "transforms": [
45
+ {
46
+ "expression": {
47
+ "lang": "lua",
48
+ "body": "if input.context.providers.googleGtag.data.gclid then\n return SPLIT(input.context.providers.googleGtag.data.gclid, \".\",3)[3]\nend"
49
+ }
50
+ }
51
+ ]
52
52
  },
53
53
  {
54
54
  "inputKey": "input",
@@ -91,7 +91,7 @@
91
91
  "transforms": [
92
92
  {
93
93
  "expression": {
94
- "body": "return \"customers/$$CUSTOMER_ID$$/conversionActions/$$PAGE_CONVERSION_ACTION$$\"",
94
+ "body": "return \"customers/$$CUSTOMER_ID$$/conversionActions/ADD_CONVERSION_ACTION_ID_HERE\"",
95
95
  "lang": "lua"
96
96
  }
97
97
  }
@@ -107,7 +107,7 @@
107
107
  "transforms": [
108
108
  {
109
109
  "expression": {
110
- "body": "return \"customers/$$CUSTOMER_ID$$/conversionActions/$$ORDER_COMPLETED_CONVERSION_ACTION$$\"",
110
+ "body": "return \"customers/$$CUSTOMER_ID$$/conversionActions/ADD_CONVERSION_ACTION_ID_HERE\"",
111
111
  "lang": "lua"
112
112
  }
113
113
  }
@@ -1 +1 @@
1
- "9bfd4da26c3cf35f3a0d1b8aaab801ff"
1
+ "05fbbb7990c0e0d235d4a1b116a6bdf0"
@@ -1,5 +1,5 @@
1
1
  {
2
- "isDraft": false,
2
+ "isDraft": true,
3
3
  "isBeta": false,
4
4
  "friendlyName": "Media Math",
5
5
  "description": "Media Math give marketers the tools to execute smart marketing at scale and to drive truly incremental business value.",
@@ -18,11 +18,15 @@
18
18
  },
19
19
  {
20
20
  "date": "2021-06-28T00:00:00.000Z",
21
- "note": "Setting isDraft to false"
21
+ "note": "Setting `isDraft` to `false`."
22
22
  },
23
23
  {
24
24
  "date": "2022-11-16T00:00:00.000Z",
25
- "note": "Add isBeta field"
25
+ "note": "Add `isBeta` field."
26
+ },
27
+ {
28
+ "date": "2023-09-12T00:00:00.000Z",
29
+ "note": "Hide kit from the UI by setting `isDraft` to `true`."
26
30
  }
27
31
  ]
28
32
  }
@@ -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
@@ -300,6 +300,13 @@ exports.podsights = {
300
300
  metadata: require('./.dist/podsights/metadata.json')
301
301
  }
302
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
+
303
310
  exports['rev-jet'] = {
304
311
  connectionTemplate: connectionSchemas.properties.revJet,
305
312
  endpointSchema: require('./.dist/rev-jet/connection.json'),
@@ -623,6 +630,11 @@ exports.etags = {
623
630
  playbook: require('./.dist/podsights/playbook.etag.json'),
624
631
  kit: require('./.dist/podsights/kit.etag.json')
625
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
+ },
626
638
  'rev-jet': {
627
639
  endpointSchema: require('./.dist/rev-jet/connection.etag.json'),
628
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.69",
3
+ "version": "1.0.71",
4
4
  "description": "MetaRouter analytics.js starter kit",
5
5
  "main": "index.js",
6
6
  "scripts": {