@metarouter/ajs-starter-kit 1.0.39 → 1.0.40

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
+ "c2520096843f081b92efc48366b848a4"
@@ -0,0 +1,48 @@
1
+ {
2
+ "params": [
3
+ {
4
+ "name": "ACCOUNT_ID",
5
+ "exampleValue": "account-id"
6
+ },
7
+ {
8
+ "name": "CONSUMER_KEY",
9
+ "exampleValue": "consumer-key"
10
+ },
11
+ {
12
+ "name": "CONSUMER_SECRET",
13
+ "exampleValue": "consumer-secret"
14
+ },
15
+ {
16
+ "name": "ACCESS_TOKEN",
17
+ "exampleValue": "access-token"
18
+ },
19
+ {
20
+ "name": "TOKEN_SECRET",
21
+ "exampleValue": "token-secret"
22
+ }
23
+ ],
24
+ "default": {
25
+ "endpoint": "https://ads-api.twitter.com/10/accounts/$$ACCOUNT_ID$$/measurement/conversions",
26
+ "oauth1Auth": {
27
+ "consumer_key": "$$CONSUMER_KEY$$",
28
+ "consumer_secret": "$$CONSUMER_SECRET$$",
29
+ "access_token": "$$ACCESS_TOKEN$$",
30
+ "token_secret": "$$TOKEN_SECRET$$"
31
+ },
32
+ "method": "POST",
33
+ "headers": [
34
+ {
35
+ "key": "Content-Type",
36
+ "value": "application/json"
37
+ },
38
+ {
39
+ "key": "Accept",
40
+ "value": "*/*"
41
+ },
42
+ {
43
+ "key": "Accept-Encoding",
44
+ "value": "application/json"
45
+ }
46
+ ]
47
+ }
48
+ }
@@ -0,0 +1 @@
1
+ "c0158460674afec9376b96adcf53b2a1"
@@ -0,0 +1,19 @@
1
+ {
2
+ "isDraft": false,
3
+ "friendlyName": "Twitter Ads",
4
+ "description": "Twitter Ads and MetaRouter's connection allows marketers to track ad campaign conversions that come from Twitter and occur on a client's website.",
5
+ "logo": "https://cdn.metarouter.io/vendor-assets/twitter-conversions.svg",
6
+ "color": "#1DA1F2",
7
+ "eventSource": {
8
+ "isAndroidApp": false,
9
+ "isIosApp": false,
10
+ "isWebApp": true
11
+ },
12
+ "inputSchema": "analytics_js",
13
+ "releaseNotes": [
14
+ {
15
+ "date": "2022-06-16T00:00:00.000Z",
16
+ "note": "Twitter Ads initial release."
17
+ }
18
+ ]
19
+ }
@@ -0,0 +1 @@
1
+ "81f956214c1610cd42a2417fa0121ecb"
@@ -0,0 +1,261 @@
1
+ {
2
+ "version": "v0.0.1",
3
+ "params": [
4
+ {
5
+ "name": "ACCOUNT_ID",
6
+ "exampleValue": "account-id"
7
+ },
8
+ {
9
+ "name": "PAGE_EVENT_ID",
10
+ "exampleValue": "event-id-for-page-events"
11
+ },
12
+ {
13
+ "name": "PRODUCTS_SEARCHED_EVENT_ID",
14
+ "exampleValue": "event-id-for-products-searched-events"
15
+ },
16
+ {
17
+ "name": "PRODUCT_LIST_VIEWED_EVENT_ID",
18
+ "exampleValue": "event-id-for-product-list-viewed-events"
19
+ },
20
+ {
21
+ "name": "PRODUCT_VIEWED_EVENT_ID",
22
+ "exampleValue": "event-id-for-product-viewed-events"
23
+ },
24
+ {
25
+ "name": "PRODUCT_ADDED_EVENT_ID",
26
+ "exampleValue": "event-id-for-product-added-events"
27
+ },
28
+ {
29
+ "name": "CART_VIEWED_EVENT_ID",
30
+ "exampleValue": "event-id-for-cart-viewed-events"
31
+ },
32
+ {
33
+ "name": "ORDER_COMPLETED_EVENT_ID",
34
+ "exampleValue": "event-id-for-order-completed-events"
35
+ },
36
+ {
37
+ "name": "CATCH_ALL_EVENT_ID",
38
+ "exampleValue": "catch-all-event-id"
39
+ }
40
+ ],
41
+ "global": {
42
+ "filters": [
43
+ {
44
+ "byConditions": {
45
+ "action": "allow",
46
+ "when": {
47
+ "matchesAny": {
48
+ "conditions": [
49
+ {
50
+ "inputPathExists": {
51
+ "inputPath": "context.providers.twitterConversion.twclid"
52
+ }
53
+ },
54
+ {
55
+ "inputPathExists": {
56
+ "inputPath": "context.traits.email"
57
+ }
58
+ }
59
+ ]
60
+ }
61
+ }
62
+ }
63
+ }
64
+ ],
65
+ "enrichments": [
66
+ {
67
+ "staticString": "$$ACCOUNT_ID$$",
68
+ "outputKey": "account_id"
69
+ }
70
+ ],
71
+ "mappings": [
72
+ {
73
+ "inputKey": "timestamp",
74
+ "outputKey": "conversion_time"
75
+ },
76
+ {
77
+ "inputKey": "context.page.url",
78
+ "outputKey": "event_source_url"
79
+ },
80
+ {
81
+ "inputKey": "context.providers.twitterConversion.twclid",
82
+ "outputKey": "twclid"
83
+ },
84
+ {
85
+ "inputKey": "context.traits.email",
86
+ "outputKey": "hashed_email",
87
+ "transforms": [
88
+ {
89
+ "toHash": "sha256"
90
+ }
91
+ ]
92
+ }
93
+ ]
94
+ },
95
+ "eventSpecific": {
96
+ "page": {
97
+ "enrichments": [
98
+ {
99
+ "staticString": "$$PAGE_EVENT_ID$$",
100
+ "outputKey": "event_id"
101
+ }
102
+ ]
103
+ },
104
+ "products_searched": {
105
+ "enrichments": [
106
+ {
107
+ "staticString": "$$PRODUCTS_SEARCHED_EVENT_ID$$",
108
+ "outputKey": "event_id"
109
+ }
110
+ ]
111
+ },
112
+ "product_list_viewed": {
113
+ "enrichments": [
114
+ {
115
+ "staticString": "$$PRODUCT_LIST_VIEWED_EVENT_ID$$",
116
+ "outputKey": "event_id"
117
+ }
118
+ ]
119
+ },
120
+ "product_viewed": {
121
+ "enrichments": [
122
+ {
123
+ "staticString": "$$PRODUCT_VIEWED_EVENT_ID$$",
124
+ "outputKey": "event_id"
125
+ }
126
+ ]
127
+ },
128
+ "product_added": {
129
+ "enrichments": [
130
+ {
131
+ "staticString": "$$PRODUCT_ADDED_EVENT_ID$$",
132
+ "outputKey": "event_id"
133
+ }
134
+ ],
135
+ "mappings": [
136
+ {
137
+ "inputKey": "properties.quantity",
138
+ "outputKey": "number_items"
139
+ },
140
+ {
141
+ "inputKey": "input",
142
+ "outputKey": "value",
143
+ "transforms": [
144
+ {
145
+ "expression": {
146
+ "lang": "lua",
147
+ "body": "return string.format(\"%.2f\", input.properties.price * (input.properties.quantity or 1))"
148
+ }
149
+ }
150
+ ]
151
+ },
152
+ {
153
+ "inputKey": "properties.currency",
154
+ "outputKey": "price_currency",
155
+ "transforms": [
156
+ {
157
+ "modifyString": "uppercase"
158
+ }
159
+ ],
160
+ "defaultString": "USD"
161
+ }
162
+ ]
163
+ },
164
+ "cart_viewed": {
165
+ "enrichments": [
166
+ {
167
+ "staticString": "$$CART_VIEWED_EVENT_ID$$",
168
+ "outputKey": "event_id"
169
+ }
170
+ ],
171
+ "mappings": [
172
+ {
173
+ "inputKey": "input",
174
+ "outputKey": "number_items",
175
+ "transforms": [
176
+ {
177
+ "expression": {
178
+ "lang": "lua",
179
+ "body": "return SUM(MAP(input.properties.products, function (p) return p.quantity or 1 end))"
180
+ }
181
+ }
182
+ ]
183
+ },
184
+ {
185
+ "inputKey": "input",
186
+ "outputKey": "value",
187
+ "transforms": [
188
+ {
189
+ "expression": {
190
+ "lang": "lua",
191
+ "body": "return string.format(\"%.2f\", SUM(MAP(input.properties.products, function (p) return p.price * (p.quantity or 1) end)))"
192
+ }
193
+ }
194
+ ]
195
+ },
196
+ {
197
+ "inputKey": "properties.currency",
198
+ "outputKey": "price_currency",
199
+ "transforms": [
200
+ {
201
+ "modifyString": "uppercase"
202
+ }
203
+ ],
204
+ "defaultString": "USD"
205
+ }
206
+ ]
207
+ },
208
+ "order_completed": {
209
+ "enrichments": [
210
+ {
211
+ "staticString": "$$ORDER_COMPLETED_EVENT_ID$$",
212
+ "outputKey": "event_id"
213
+ }
214
+ ],
215
+ "mappings": [
216
+ {
217
+ "inputKey": "input",
218
+ "outputKey": "number_items",
219
+ "transforms": [
220
+ {
221
+ "expression": {
222
+ "lang": "lua",
223
+ "body": "return SUM(MAP(input.properties.products, function (p) return p.quantity or 1 end))"
224
+ }
225
+ }
226
+ ]
227
+ },
228
+ {
229
+ "inputKey": "input",
230
+ "outputKey": "value",
231
+ "transforms": [
232
+ {
233
+ "expression": {
234
+ "lang": "lua",
235
+ "body": "return string.format(\"%.2f\", input.properties.total)"
236
+ }
237
+ }
238
+ ]
239
+ },
240
+ {
241
+ "inputKey": "properties.currency",
242
+ "outputKey": "price_currency",
243
+ "transforms": [
244
+ {
245
+ "modifyString": "uppercase"
246
+ }
247
+ ],
248
+ "defaultString": "USD"
249
+ }
250
+ ]
251
+ }
252
+ },
253
+ "default": {
254
+ "enrichments": [
255
+ {
256
+ "staticString": "$$CATCH_ALL_EVENT_ID$$",
257
+ "outputKey": "event_id"
258
+ }
259
+ ]
260
+ }
261
+ }
package/index.js CHANGED
@@ -256,6 +256,12 @@ exports.snowflake = {
256
256
  metadata: require('./.dist/snowflake/metadata.json')
257
257
  }
258
258
 
259
+ exports['twitter-conversions'] = {
260
+ connectionTemplate: connectionSchemas.properties.twitterConversions,
261
+ endpointSchema: require('./.dist/twitter-conversions/endpoint_schema.json'),
262
+ playbook: require('./.dist/twitter-conversions/playbook.json'),
263
+ metadata: require('./.dist/twitter-conversions/metadata.json')
264
+ }
259
265
 
260
266
  exports['verizon-media'] = {
261
267
  connectionTemplate: connectionSchemas.properties.verizonMedia,
@@ -453,6 +459,11 @@ exports.etags = {
453
459
  playbook: require('./.dist/snowflake/playbook.etag.json'),
454
460
  kit: require('./.dist/snowflake/kit.etag.json')
455
461
  },
462
+ 'twitter-conversions': {
463
+ endpointSchema: require('./.dist/twitter-conversions/endpoint_schema.etag.json'),
464
+ playbook: require('./.dist/twitter-conversions/playbook.etag.json'),
465
+ kit: require('./.dist/twitter-conversions/kit.etag.json')
466
+ },
456
467
  'verizon-media': {
457
468
  endpointSchema: require('./.dist/verizon-media/endpoint_schema.etag.json'),
458
469
  playbook: require('./.dist/verizon-media/playbook.etag.json'),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metarouter/ajs-starter-kit",
3
- "version": "1.0.39",
3
+ "version": "1.0.40",
4
4
  "description": "MetaRouter analytics.js starter kit",
5
5
  "main": "index.js",
6
6
  "scripts": {