@metarouter/ajs-starter-kit 1.0.78 → 1.0.80

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
+ "6e570485ab6dd8a0ecb221ee1e09d4d4"
@@ -0,0 +1,23 @@
1
+ {
2
+ "params": [
3
+ {
4
+ "name": "ACCESS_TOKEN",
5
+ "exampleValue": "my-access-token"
6
+ }
7
+ ],
8
+ "default": {
9
+ "endpoint": "https://tracking.api.cj.com/graphql",
10
+ "batchSize": 1,
11
+ "method": "POST",
12
+ "headers": [
13
+ {
14
+ "key": "Authorization",
15
+ "value": "Bearer $$ACCESS_TOKEN$$"
16
+ }
17
+ ],
18
+ "transform": {
19
+ "body": "function tableToString(tbl)\n local result, isJsonArray = {}, true\n\n for k, v in pairs(tbl) do\n isJsonArray = isJsonArray and type(k) == \"number\" and math.floor(k) == k and k > 0\n\n local valueStr = (\n type(v) == \"table\" and tableToString(v) or\n type(v) == \"boolean\" and tostring(v) or\n type(v) == \"number\" and v or\n '\"' .. tostring(v) .. '\"'\n )\n\n if isJsonArray then\n result[#result + 1] = valueStr\n else\n result[#result + 1] = k .. \":\" .. valueStr\n end\n end\n\n return (isJsonArray and \"[\" or \"{\") .. table.concat(result, \",\") .. (isJsonArray and \"]\" or \"}\")\nend\n\n\nlocal graphQLString = string.format([[\n mutation {\n createOrders(\n newOrders: [%s]\n ) {\n orders {\n submissionId\n orderReceivedTime\n advertiser {\n enterpriseId\n }\n actionTracker {\n id\n }\n eventTime\n orderId\n cjEvent\n amount\n discount\n verticalParameters {\n originState\n taxAmount\n confirmationNumber\n originCity\n itemId\n noCancellation\n orderSubtotal\n destinationCity\n destinationState\n }\n items {\n unitPrice\n quantity\n sku\n discount\n }\n coupon\n currency\n }\n errors {\n message\n fields\n }\n }\n }\n]], tableToString(batch[1]))\n\nrequest.body = { query = graphQLString }\nreturn request",
20
+ "lang": "lua"
21
+ }
22
+ }
23
+ }
@@ -0,0 +1 @@
1
+ "05fec366f431cf60b2daa57e8e323840"
@@ -0,0 +1,20 @@
1
+ {
2
+ "isDraft": false,
3
+ "isBeta": true,
4
+ "friendlyName": "Commission Junction",
5
+ "description": "Commission Junction provides a platform that connects advertisers with a network of publishers, making it easier for both parties to find suitable partnerships.",
6
+ "logo": "https://cdn.metarouter.io/commission-junction.png",
7
+ "color": "#025450",
8
+ "eventSource": {
9
+ "isAndroidApp": false,
10
+ "isIosApp": false,
11
+ "isWebApp": true
12
+ },
13
+ "inputSchema": "analytics_js",
14
+ "releaseNotes": [
15
+ {
16
+ "date": "2024-01-17T05:00:00.000Z",
17
+ "note": "commission-junction initial release."
18
+ }
19
+ ]
20
+ }
@@ -0,0 +1 @@
1
+ "4d2541ca3b25339c02063fe4e2cc5e86"
@@ -0,0 +1,163 @@
1
+ {
2
+ "version": "v0.1.0",
3
+ "params": [
4
+ {
5
+ "name": "ACTION_TRACKER_ID",
6
+ "exampleValue": "my-action-tracker-id"
7
+ },
8
+ {
9
+ "name": "ENTERPRISE_ID",
10
+ "exampleValue": "my-enterprise-id"
11
+ }
12
+ ],
13
+ "global": {
14
+ "filters": [
15
+ {
16
+ "byEventNames": {
17
+ "action": "allow",
18
+ "events": [
19
+ "order_completed"
20
+ ]
21
+ }
22
+ }
23
+ ],
24
+ "enrichments": [
25
+ {
26
+ "staticString": "$$ENTERPRISE_ID$$",
27
+ "outputKey": "enterpriseId"
28
+ }
29
+ ],
30
+ "mappings": [
31
+ {
32
+ "inputKey": "input",
33
+ "outputKey": "actionTrackerId",
34
+ "transforms": [
35
+ {
36
+ "expression": {
37
+ "lang": "lua",
38
+ "body": "local actionTrackerId = TO_TRUNCATED_INT($$ACTION_TRACKER_ID$$)\nreturn actionTrackerId"
39
+ }
40
+ }
41
+ ]
42
+ },
43
+ {
44
+ "inputKey": "originalTimestamp",
45
+ "outputKey": "eventTime"
46
+ },
47
+ {
48
+ "inputKey": "context.providers.commissionJunction.cjEvent",
49
+ "outputKey": "cjEvent"
50
+ },
51
+ {
52
+ "inputKey": "properties.sid",
53
+ "outputKey": "sid"
54
+ }
55
+ ]
56
+ },
57
+ "eventSpecific": {
58
+ "order_completed": {
59
+ "mappings": [
60
+ {
61
+ "inputKey": "properties.order_id",
62
+ "outputKey": "orderId"
63
+ },
64
+ {
65
+ "inputKey": "properties.revenue",
66
+ "outputKey": "amount"
67
+ },
68
+ {
69
+ "inputKey": "properties.discount",
70
+ "outputKey": "discount"
71
+ },
72
+ {
73
+ "inputKey": "input",
74
+ "outputKey": "items",
75
+ "transforms": [
76
+ {
77
+ "expression": {
78
+ "lang": "lua",
79
+ "body": "return MAP(\n input.properties.products,\n function (p)\n return {\n unitPrice=p.price,\n quantity=p.quantity,\n sku=p.sku,\n discount=p.discount or 0\n }\n end\n )"
80
+ }
81
+ }
82
+ ]
83
+ },
84
+ {
85
+ "inputKey": "properties.coupon",
86
+ "outputKey": "coupon"
87
+ },
88
+ {
89
+ "inputKey": "properties.currency",
90
+ "outputKey": "currency",
91
+ "transforms": [
92
+ {
93
+ "modifyString": "uppercase"
94
+ }
95
+ ]
96
+ },
97
+ {
98
+ "inputKey": "properties.customerStatus",
99
+ "outputKey": "customerStatus"
100
+ },
101
+ {
102
+ "inputKey": "properties.confirmationNumber",
103
+ "outputKey": "verticalParameters.confirmationNumber"
104
+ },
105
+ {
106
+ "inputKey": "properties.originCity",
107
+ "outputKey": "verticalParameters.originCity"
108
+ },
109
+ {
110
+ "inputKey": "properties.originState",
111
+ "outputKey": "verticalParameters.originState"
112
+ },
113
+ {
114
+ "inputKey": "properties.destinationCity",
115
+ "outputKey": "verticalParameters.destinationCity"
116
+ },
117
+ {
118
+ "inputKey": "properties.destinationState",
119
+ "outputKey": "verticalParameters.destinationState"
120
+ },
121
+ {
122
+ "inputKey": "properties.noCancellation",
123
+ "outputKey": "verticalParameters.noCancellation",
124
+ "transforms": [
125
+ {
126
+ "toScalar": "string"
127
+ }
128
+ ]
129
+ },
130
+ {
131
+ "inputKey": "properties.revenue",
132
+ "outputKey": "verticalParameters.orderSubtotal",
133
+ "transforms": [
134
+ {
135
+ "toScalar": "string"
136
+ }
137
+ ]
138
+ },
139
+ {
140
+ "inputKey": "properties.tax",
141
+ "outputKey": "verticalParameters.taxAmount",
142
+ "transforms": [
143
+ {
144
+ "toScalar": "string"
145
+ }
146
+ ]
147
+ },
148
+ {
149
+ "inputKey": "input",
150
+ "outputKey": "verticalParameters.itemId",
151
+ "transforms": [
152
+ {
153
+ "expression": {
154
+ "lang": "lua",
155
+ "body": "return JOIN(PLUCK(input.properties.products,\"product_id\"), \", \")"
156
+ }
157
+ }
158
+ ]
159
+ }
160
+ ]
161
+ }
162
+ }
163
+ }
@@ -0,0 +1 @@
1
+ "9fc0ae425863d2350a2fd57d7de81451"
@@ -0,0 +1,52 @@
1
+ {
2
+ "params": [
3
+ {
4
+ "name": "API_SECRET",
5
+ "exampleValue": "my-api-secret",
6
+ "description": "Software-level credentials that allow a program to access your account.Select Property settings->Data collection then select Measurement Protocol API secrets to create a new API secret"
7
+ },
8
+ {
9
+ "name": "FIREBASE_APP_ID",
10
+ "exampleValue": "my-firebase-app-id",
11
+ "description": "The identifier for a Firebase app. Found in the Firebase console under Project Settings > General > Your Apps > App ID"
12
+ }
13
+ ],
14
+ "default": {
15
+ "endpoint": "https://www.google-analytics.com/mp/collect?api_secret=$$API_SECRET$$&firebase_app_id=$$FIREBASE_APP_ID$$",
16
+ "method": "POST",
17
+ "headers": [
18
+ {
19
+ "key": "Content-Type",
20
+ "value": "application/json"
21
+ },
22
+ {
23
+ "key": "Accept-Encoding",
24
+ "value": "gzip, compress, br"
25
+ },
26
+ {
27
+ "key": "User-Agent",
28
+ "fromEventKey": "context.userAgent"
29
+ },
30
+ {
31
+ "key": "Authority",
32
+ "value": "www.google-analytics.com"
33
+ },
34
+ {
35
+ "key": "Accept-Language",
36
+ "value": "en-US,en;q=0.9"
37
+ },
38
+ {
39
+ "key": "Sec-Fetch-Dest",
40
+ "value": "empty"
41
+ },
42
+ {
43
+ "key": "Sec-Fetch-Mode",
44
+ "value": "cors"
45
+ },
46
+ {
47
+ "key": "Sec-Fetch-Site",
48
+ "value": "cross-site"
49
+ }
50
+ ]
51
+ }
52
+ }
@@ -0,0 +1 @@
1
+ "2c6360a283a10783e3b5238c96b8d5a3"
@@ -0,0 +1,20 @@
1
+ {
2
+ "isDraft": false,
3
+ "isBeta": true,
4
+ "friendlyName": "Firebase",
5
+ "description": "Firebase is an app measurement solution, available at no charge, that provides insight on app usage and user engagement",
6
+ "logo": "https://cdn.metarouter.io/google-firebase.png",
7
+ "color": "#FFA611",
8
+ "eventSource": {
9
+ "isAndroidApp": true,
10
+ "isIosApp": true,
11
+ "isWebApp": false
12
+ },
13
+ "inputSchema": "analytics_js",
14
+ "releaseNotes": [
15
+ {
16
+ "date": "2024-01-15T05:00:00.000Z",
17
+ "note": "google-firebase initial release."
18
+ }
19
+ ]
20
+ }
@@ -0,0 +1 @@
1
+ "fc138a8e3e150b5571f0781ddf1f7d8d"
@@ -0,0 +1,142 @@
1
+ {
2
+ "version": "0.1.0",
3
+ "global": {
4
+ "filters": [
5
+ {
6
+ "byEventNames": {
7
+ "action": "deny",
8
+ "events": [
9
+ "identify",
10
+ "screen",
11
+ "page"
12
+ ]
13
+ }
14
+ }
15
+ ],
16
+ "mappings": [
17
+ {
18
+ "inputKey": "context.providers.googleFirebase.appInstanceId",
19
+ "outputKey": "app_instance_id"
20
+ },
21
+ {
22
+ "inputKey": "context.providers.googleFirebase.nonPersonalizedAds",
23
+ "outputKey": "non_personalized_ads",
24
+ "defaultBool": false
25
+ }
26
+ ]
27
+ },
28
+ "eventSpecific": {
29
+ "order_completed": {
30
+ "mappings": [
31
+ {
32
+ "inputKey": "input",
33
+ "outputKey": "events",
34
+ "transforms": [
35
+ {
36
+ "expression": {
37
+ "lang": "lua",
38
+ "body": "local events = {}\n\nlocal event = {\n name = \"purchase\",\n params = {\n currency = UPPER(input.properties.currency),\n value = 0, -- Initializing total cart value,\n coupon = input.properties.coupon,\n transaction_id = input.properties.order_id,\n items = {}\n }\n}\n\nfor _, product in ipairs(input.properties.products) do\n local item = {\n item_id = product.product_id,\n item_name = product.name,\n index = #event.params.items,\n item_category = product.category,\n affiliation = input.properties.affiliation,\n price = product.price,\n quantity = product.quantity or 1\n }\n\n -- Updates the total value with the running total\n event.params.value = event.params.value + (item.price * item.quantity)\n\n table.insert(event.params.items, item)\nend\n\ntable.insert(events, event)\nreturn events"
39
+ }
40
+ }
41
+ ]
42
+ }
43
+ ]
44
+ },
45
+ "cart_viewed": {
46
+ "mappings": [
47
+ {
48
+ "inputKey": "input",
49
+ "outputKey": "events",
50
+ "transforms": [
51
+ {
52
+ "expression": {
53
+ "lang": "lua",
54
+ "body": "local events = {}\n\nlocal event = {\n name = \"view_cart\",\n params = {\n currency = UPPER(input.properties.currency),\n value = 0, -- Initializing total cart value,\n coupon = input.properties.coupon,\n items = {}\n }\n}\n\nfor _, product in ipairs(input.properties.products) do\n local item = {\n item_id = product.product_id,\n item_name = product.name,\n index = #event.params.items,\n item_category = product.category,\n affiliation = input.properties.affiliation,\n price = product.price,\n quantity = product.quantity or 1\n }\n\n -- Updates the total value with the running total\n event.params.value = event.params.value + (item.price * item.quantity)\n\n table.insert(event.params.items, item)\nend\n\ntable.insert(events, event)\nreturn events"
55
+ }
56
+ }
57
+ ]
58
+ }
59
+ ]
60
+ },
61
+ "product_list_viewed": {
62
+ "mappings": [
63
+ {
64
+ "inputKey": "input",
65
+ "outputKey": "events",
66
+ "transforms": [
67
+ {
68
+ "expression": {
69
+ "lang": "lua",
70
+ "body": "local events = {}\n\nlocal event = {\n name = \"view_item_list\",\n params = {\n currency = UPPER(input.properties.currency),\n coupon = input.properties.coupon,\n item_list_id = input.properties.list_id,\n items = {}\n }\n}\n\nfor _, product in ipairs(input.properties.products) do\n local item = {\n item_id = product.product_id,\n item_name = product.name,\n index = #event.params.items,\n item_category = product.category,\n affiliation = input.properties.affiliation,\n price = product.price\n }\n\n table.insert(event.params.items, item)\nend\n\ntable.insert(events, event)\nreturn events"
71
+ }
72
+ }
73
+ ]
74
+ }
75
+ ]
76
+ },
77
+ "checkout_started": {
78
+ "mappings": [
79
+ {
80
+ "inputKey": "input",
81
+ "outputKey": "events",
82
+ "transforms": [
83
+ {
84
+ "expression": {
85
+ "lang": "lua",
86
+ "body": "local events = {}\n\nlocal event = {\n name = \"begin_checkout\",\n params = {\n currency = UPPER(input.properties.currency),\n value = 0, -- Initializing total cart value,\n coupon = input.properties.coupon,\n items = {}\n }\n}\n\nfor _, product in ipairs(input.properties.products) do\n local item = {\n item_id = product.product_id,\n item_name = product.name,\n index = #event.params.items,\n item_category = product.category,\n affiliation = input.properties.affiliation,\n price = product.price,\n quantity = product.quantity or 1\n }\n\n -- Updates the total value with the running total\n event.params.value = event.params.value + (item.price * item.quantity)\n\n table.insert(event.params.items, item)\nend\n\ntable.insert(events, event)\nreturn events"
87
+ }
88
+ }
89
+ ]
90
+ }
91
+ ]
92
+ },
93
+ "product_added": {
94
+ "mappings": [
95
+ {
96
+ "inputKey": "input",
97
+ "outputKey": "events",
98
+ "transforms": [
99
+ {
100
+ "expression": {
101
+ "lang": "lua",
102
+ "body": "return {{\n name = \"add_to_cart\",\n currency = UPPER(input.properties.currency),\n value = input.properties.price * (input.properties.quantity or 1),\n params = {\n item_id = input.properties.product_id,\n item_name = input.properties.name,\n }\n }}"
103
+ }
104
+ }
105
+ ]
106
+ }
107
+ ]
108
+ },
109
+ "product_viewed": {
110
+ "mappings": [
111
+ {
112
+ "inputKey": "input",
113
+ "outputKey": "events",
114
+ "transforms": [
115
+ {
116
+ "expression": {
117
+ "lang": "lua",
118
+ "body": "return {{\n name = \"view_item\",\n currency = UPPER(input.properties.currency),\n value = input.properties.price * (input.properties.quantity or 1),\n params = {\n item_id = input.properties.product_id,\n item_name = input.properties.name,\n }\n }}"
119
+ }
120
+ }
121
+ ]
122
+ }
123
+ ]
124
+ },
125
+ "products_searched": {
126
+ "mappings": [
127
+ {
128
+ "inputKey": "input",
129
+ "outputKey": "events",
130
+ "transforms": [
131
+ {
132
+ "expression": {
133
+ "lang": "lua",
134
+ "body": "return {{\n name = \"search\",\n params = {\n search_term = input.properties.query\n }\n }}"
135
+ }
136
+ }
137
+ ]
138
+ }
139
+ ]
140
+ }
141
+ }
142
+ }
@@ -0,0 +1 @@
1
+ "c1dc9ad61c527d0444a8b1be3e6df966"
@@ -0,0 +1,30 @@
1
+ {
2
+ "params": [
3
+ {
4
+ "name": "ENDPOINT",
5
+ "exampleValue": "my-endpoint"
6
+ },
7
+ {
8
+ "name": "PASSWORD",
9
+ "exampleValue": "my-password"
10
+ },
11
+ {
12
+ "name": "USERNAME",
13
+ "exampleValue": "my-username"
14
+ }
15
+ ],
16
+ "default": {
17
+ "basicAuth": {
18
+ "password": "$$PASSWORD$$",
19
+ "username": "$$USERNAME$$"
20
+ },
21
+ "endpoint": "https://collector.movableink-dmz.com/behavioral/$$ENDPOINT$$",
22
+ "headers": [
23
+ {
24
+ "key": "Content-Type",
25
+ "value": "application/json"
26
+ }
27
+ ],
28
+ "method": "POST"
29
+ }
30
+ }
@@ -0,0 +1 @@
1
+ "336af703682abd0abed08e879d1da392"
@@ -0,0 +1,20 @@
1
+ {
2
+ "isDraft": false,
3
+ "isBeta": true,
4
+ "friendlyName": "Movable Ink - Customer Data",
5
+ "description": "Movable Ink is a marketing technology platform that specializes in creating personalized and dynamic content for email and mobile marketing campaigns.",
6
+ "logo": "https://cdn.metarouter.io/logo.svg",
7
+ "color": "#e21c79",
8
+ "eventSource": {
9
+ "isAndroidApp": false,
10
+ "isIosApp": false,
11
+ "isWebApp": true
12
+ },
13
+ "inputSchema": "analytics_js",
14
+ "releaseNotes": [
15
+ {
16
+ "date": "2024-02-07T00:00:00.000Z",
17
+ "note": "Movable Ink - Customer Data initial release."
18
+ }
19
+ ]
20
+ }
@@ -0,0 +1 @@
1
+ "6eec9986ab61724920bac87ac9dc1c6f"
@@ -0,0 +1,418 @@
1
+ {
2
+ "version": "0.1.0",
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": "context.providers.movableInkCustomerData.mi_u",
19
+ "outputKey": "user_id"
20
+ },
21
+ {
22
+ "inputKey": "anonymousId",
23
+ "outputKey": "anonymousId"
24
+ },
25
+ {
26
+ "inputKey": "timestamp",
27
+ "outputKey": "timestamp"
28
+ },
29
+ {
30
+ "inputKey": "type",
31
+ "outputKey": "type"
32
+ },
33
+ {
34
+ "inputKey": "input",
35
+ "outputKey": "event",
36
+ "transforms": [
37
+ {
38
+ "expression": {
39
+ "lang": "lua",
40
+ "body": "if input.type == 'track' then\n if input.event == 'product_list_viewed' then\n return 'category_viewed'\n else\n return REPLACE(LOWER(input.event), ' ', '_')\n end\nelseif input.type == 'page' then\n return 'page_viewed'\nelse\n return 'user_identified'\nend"
41
+ }
42
+ }
43
+ ]
44
+ }
45
+ ]
46
+ },
47
+ "eventSpecific": {
48
+ "identify": {
49
+ "mappings": [
50
+ {
51
+ "inputKey": "userId",
52
+ "outputKey": "userId"
53
+ }
54
+ ]
55
+ },
56
+ "page": {
57
+ "mappings": [
58
+ {
59
+ "inputKey": "properties.title",
60
+ "outputKey": "properties.title",
61
+ "transforms": [
62
+ {
63
+ "substring": {
64
+ "start": 0,
65
+ "end": 256
66
+ }
67
+ }
68
+ ]
69
+ },
70
+ {
71
+ "inputKey": "properties.url",
72
+ "outputKey": "properties.url",
73
+ "transforms": [
74
+ {
75
+ "substring": {
76
+ "start": 0,
77
+ "end": 256
78
+ }
79
+ }
80
+ ]
81
+ }
82
+ ]
83
+ },
84
+ "products_searched": {
85
+ "mappings": [
86
+ {
87
+ "inputKey": "properties.query",
88
+ "outputKey": "properties.query",
89
+ "defaultString": "",
90
+ "transforms": [
91
+ {
92
+ "substring": {
93
+ "start": 0,
94
+ "end": 256
95
+ }
96
+ }
97
+ ]
98
+ },
99
+ {
100
+ "inputKey": "context.page.url",
101
+ "outputKey": "properties.url",
102
+ "transforms": [
103
+ {
104
+ "substring": {
105
+ "start": 0,
106
+ "end": 256
107
+ }
108
+ }
109
+ ]
110
+ }
111
+ ]
112
+ },
113
+ "product_list_viewed": {
114
+ "mappings": [
115
+ {
116
+ "inputKey": "properties.list_id",
117
+ "outputKey": "properties.id",
118
+ "transforms": [
119
+ {
120
+ "substring": {
121
+ "start": 0,
122
+ "end": 256
123
+ }
124
+ }
125
+ ]
126
+ },
127
+ {
128
+ "inputKey": "context.page.url",
129
+ "outputKey": "properties.url",
130
+ "transforms": [
131
+ {
132
+ "substring": {
133
+ "start": 0,
134
+ "end": 256
135
+ }
136
+ }
137
+ ]
138
+ },
139
+ {
140
+ "inputKey": "properties.category",
141
+ "outputKey": "properties.category",
142
+ "transforms": [
143
+ {
144
+ "substring": {
145
+ "start": 0,
146
+ "end": 256
147
+ }
148
+ }
149
+ ]
150
+ },
151
+ {
152
+ "inputKey": "properties.currency",
153
+ "outputKey": "properties.currency"
154
+ },
155
+ {
156
+ "inputKey": "input",
157
+ "outputKey": "properties.products",
158
+ "transforms": [
159
+ {
160
+ "expression": {
161
+ "lang": "lua",
162
+ "body": "function slice(table, first, last, step)\n local sliced = {}\n for i = first or 1, last or #table, step or 1 do\n sliced[#sliced+1] = table[i]\n end\n return sliced\nend\nlocal products = slice(input.properties.products, 1, 100)\nreturn MAP(\n products,\n function (product)\n return {\n product_id = SUBSTRING(product.product_id, 0, 256) or SUBSTRING(product.sku, 0, 256),\n sku = SUBSTRING(product.sku, 0, 256),\n category = SUBSTRING(product.category, 0, 256),\n name = SUBSTRING(product.name, 0, 256),\n price = product.price,\n quantity = product.quantity or 1,\n url = SUBSTRING(product.url, 0, 256)\n }\n end\n)"
163
+ }
164
+ }
165
+ ]
166
+ }
167
+ ]
168
+ },
169
+ "product_viewed": {
170
+ "mappings": [
171
+ {
172
+ "inputKey": "properties",
173
+ "outputKey": "properties.product_id",
174
+ "transforms": [
175
+ {
176
+ "expression": {
177
+ "lang": "lua",
178
+ "body": "return SUBSTRING(input.properties.product_id, 0, 256) or SUBSTRING(input.properties.sku, 0, 256)"
179
+ }
180
+ }
181
+ ]
182
+ },
183
+ {
184
+ "inputKey": "properties.sku",
185
+ "outputKey": "properties.sku",
186
+ "transforms": [
187
+ {
188
+ "substring": {
189
+ "start": 0,
190
+ "end": 256
191
+ }
192
+ }
193
+ ]
194
+ },
195
+ {
196
+ "inputKey": "properties.category",
197
+ "outputKey": "properties.category",
198
+ "transforms": [
199
+ {
200
+ "substring": {
201
+ "start": 0,
202
+ "end": 256
203
+ }
204
+ }
205
+ ]
206
+ },
207
+ {
208
+ "inputKey": "properties.currency",
209
+ "outputKey": "properties.currency"
210
+ },
211
+ {
212
+ "inputKey": "properties.name",
213
+ "outputKey": "properties.name",
214
+ "transforms": [
215
+ {
216
+ "substring": {
217
+ "start": 0,
218
+ "end": 256
219
+ }
220
+ }
221
+ ]
222
+ },
223
+ {
224
+ "inputKey": "properties.price",
225
+ "outputKey": "properties.price"
226
+ },
227
+ {
228
+ "inputKey": "properties.quantity",
229
+ "outputKey": "properties.quantity"
230
+ },
231
+ {
232
+ "inputKey": "properties.url",
233
+ "outputKey": "properties.url",
234
+ "transforms": [
235
+ {
236
+ "substring": {
237
+ "start": 0,
238
+ "end": 256
239
+ }
240
+ }
241
+ ]
242
+ }
243
+ ]
244
+ },
245
+ "product_added": {
246
+ "mappings": [
247
+ {
248
+ "inputKey": "properties.cart_id",
249
+ "outputKey": "properties.cart_id",
250
+ "transforms": [
251
+ {
252
+ "substring": {
253
+ "start": 0,
254
+ "end": 256
255
+ }
256
+ }
257
+ ]
258
+ },
259
+ {
260
+ "inputKey": "properties",
261
+ "outputKey": "properties.product_id",
262
+ "transforms": [
263
+ {
264
+ "expression": {
265
+ "lang": "lua",
266
+ "body": "return SUBSTRING(input.properties.product_id, 0, 256) or SUBSTRING(input.properties.sku, 0, 256)"
267
+ }
268
+ }
269
+ ]
270
+ },
271
+ {
272
+ "inputKey": "properties.sku",
273
+ "outputKey": "properties.sku",
274
+ "transforms": [
275
+ {
276
+ "substring": {
277
+ "start": 0,
278
+ "end": 256
279
+ }
280
+ }
281
+ ]
282
+ },
283
+ {
284
+ "inputKey": "properties.category",
285
+ "outputKey": "properties.category",
286
+ "transforms": [
287
+ {
288
+ "substring": {
289
+ "start": 0,
290
+ "end": 256
291
+ }
292
+ }
293
+ ]
294
+ },
295
+ {
296
+ "inputKey": "properties.currency",
297
+ "outputKey": "properties.currency"
298
+ },
299
+ {
300
+ "inputKey": "properties.name",
301
+ "outputKey": "properties.name",
302
+ "transforms": [
303
+ {
304
+ "substring": {
305
+ "start": 0,
306
+ "end": 256
307
+ }
308
+ }
309
+ ]
310
+ },
311
+ {
312
+ "inputKey": "properties.price",
313
+ "outputKey": "properties.price"
314
+ },
315
+ {
316
+ "inputKey": "properties.quantity",
317
+ "outputKey": "properties.quantity"
318
+ },
319
+ {
320
+ "inputKey": "properties.url",
321
+ "outputKey": "properties.url",
322
+ "transforms": [
323
+ {
324
+ "substring": {
325
+ "start": 0,
326
+ "end": 256
327
+ }
328
+ }
329
+ ]
330
+ }
331
+ ]
332
+ },
333
+ "cart_viewed": {
334
+ "mappings": [
335
+ {
336
+ "inputKey": "properties.cart_id",
337
+ "outputKey": "properties.cart_id",
338
+ "transforms": [
339
+ {
340
+ "substring": {
341
+ "start": 0,
342
+ "end": 256
343
+ }
344
+ }
345
+ ]
346
+ },
347
+ {
348
+ "inputKey": "input",
349
+ "outputKey": "properties.total",
350
+ "transforms": [
351
+ {
352
+ "expression": {
353
+ "lang": "lua",
354
+ "body": "return SUM(MAP(input.properties.products, function (p) return p.price * (p.quantity or 1) end))"
355
+ }
356
+ }
357
+ ]
358
+ },
359
+ {
360
+ "inputKey": "properties.currency",
361
+ "outputKey": "properties.currency"
362
+ },
363
+ {
364
+ "inputKey": "input",
365
+ "outputKey": "properties.products",
366
+ "transforms": [
367
+ {
368
+ "expression": {
369
+ "lang": "lua",
370
+ "body": "function slice(table, first, last, step)\n local sliced = {}\n for i = first or 1, last or #table, step or 1 do\n sliced[#sliced+1] = table[i]\n end\n return sliced\nend\nlocal products = slice(input.properties.products, 1, 100)\nreturn MAP(\n products,\n function (product)\n return {\n product_id = SUBSTRING(product.product_id, 0, 256) or SUBSTRING(product.sku, 0, 256),\n sku = SUBSTRING(product.sku, 0, 256),\n category = SUBSTRING(product.category, 0, 256),\n name = SUBSTRING(product.name, 0, 256),\n price = product.price,\n quantity = product.quantity or 1,\n url = SUBSTRING(product.url, 0, 256)\n }\n end\n)"
371
+ }
372
+ }
373
+ ]
374
+ }
375
+ ]
376
+ },
377
+ "order_completed": {
378
+ "mappings": [
379
+ {
380
+ "inputKey": "properties.order_id",
381
+ "outputKey": "properties.order_id",
382
+ "transforms": [
383
+ {
384
+ "substring": {
385
+ "start": 0,
386
+ "end": 256
387
+ }
388
+ }
389
+ ]
390
+ },
391
+ {
392
+ "inputKey": "properties.total",
393
+ "outputKey": "properties.total"
394
+ },
395
+ {
396
+ "inputKey": "properties.revenue",
397
+ "outputKey": "properties.revenue"
398
+ },
399
+ {
400
+ "inputKey": "properties.currency",
401
+ "outputKey": "properties.currency"
402
+ },
403
+ {
404
+ "inputKey": "input",
405
+ "outputKey": "properties.products",
406
+ "transforms": [
407
+ {
408
+ "expression": {
409
+ "lang": "lua",
410
+ "body": "function slice(table, first, last, step)\n local sliced = {}\n for i = first or 1, last or #table, step or 1 do\n sliced[#sliced+1] = table[i]\n end\n return sliced\nend\nlocal products = slice(input.properties.products, 1, 100)\nreturn MAP(\n products,\n function (product)\n return {\n product_id = SUBSTRING(product.product_id, 0, 256) or SUBSTRING(product.sku, 0, 256),\n sku = SUBSTRING(product.sku, 0, 256),\n category = SUBSTRING(product.category, 0, 256),\n name = SUBSTRING(product.name, 0, 256),\n price = product.price,\n quantity = product.quantity or 1,\n url = SUBSTRING(product.url, 0, 256)\n }\n end\n)"
411
+ }
412
+ }
413
+ ]
414
+ }
415
+ ]
416
+ }
417
+ }
418
+ }
package/index.js CHANGED
@@ -110,13 +110,18 @@ exports.convert = {
110
110
  playbook: require('./.dist/convert/playbook.json'),
111
111
  metadata: require('./.dist/convert/metadata.json')
112
112
  },
113
-
114
- exports.criteo = {
115
- connectionTemplate: connectionSchemas.properties.criteo,
116
- endpointSchema: require('./.dist/criteo/connection.json'),
117
- playbook: require('./.dist/criteo/playbook.json'),
118
- metadata: require('./.dist/criteo/metadata.json')
119
- }
113
+ exports['commission-junction'] = {
114
+ connectionTemplate: connectionSchemas.properties.commissionJunction,
115
+ endpointSchema: require('./.dist/commission-junction/connection.json'),
116
+ playbook: require('./.dist/commission-junction/playbook.json'),
117
+ metadata: require('./.dist/commission-junction/metadata.json')
118
+ },
119
+ exports.criteo = {
120
+ connectionTemplate: connectionSchemas.properties.criteo,
121
+ endpointSchema: require('./.dist/criteo/connection.json'),
122
+ playbook: require('./.dist/criteo/playbook.json'),
123
+ metadata: require('./.dist/criteo/metadata.json')
124
+ }
120
125
 
121
126
  exports['customer-io'] = {
122
127
  connectionTemplate: connectionSchemas.properties.customerIo,
@@ -178,6 +183,13 @@ exports['google-cm360'] = {
178
183
  metadata: require('./.dist/google-cm360/metadata.json')
179
184
  }
180
185
 
186
+ exports['google-firebase'] = {
187
+ connectionTemplate: connectionSchemas.properties.googlefirebase,
188
+ endpointSchema: require('./.dist/google-firebase/connection.json'),
189
+ playbook: require('./.dist/google-firebase/playbook.json'),
190
+ metadata: require('./.dist/google-firebase/metadata.json')
191
+ }
192
+
181
193
  exports['google-pubsub'] = {
182
194
  connectionTemplate: connectionSchemas.properties.googlePubsub,
183
195
  playbook: require('./.dist/google-pubsub/playbook.json'),
@@ -266,6 +278,13 @@ exports['movable-ink'] = {
266
278
  metadata: require('./.dist/movable-ink/metadata.json')
267
279
  }
268
280
 
281
+ exports['movable-ink-customer-data'] = {
282
+ connectionTemplate: connectionSchemas.properties.movableInkCustomerData,
283
+ endpointSchema: require('./.dist/movable-ink-customer-data/connection.json'),
284
+ playbook: require('./.dist/movable-ink-customer-data/playbook.json'),
285
+ metadata: require('./.dist/movable-ink-customer-data/metadata.json')
286
+ }
287
+
269
288
  exports['nextdoor'] = {
270
289
  connectionTemplate: connectionSchemas.properties.nextdoor,
271
290
  endpointSchema: require('./.dist/nextdoor/connection.json'),
@@ -492,6 +511,11 @@ exports.etags = {
492
511
  playbook: require('./.dist/convert/playbook.etag.json'),
493
512
  kit: require('./.dist/convert/kit.etag.json')
494
513
  },
514
+ 'commission-junction': {
515
+ endpointSchema: require('./.dist/commission-junction/connection.etag.json'),
516
+ playbook: require('./.dist/commission-junction/playbook.etag.json'),
517
+ kit: require('./.dist/commission-junction/kit.etag.json')
518
+ },
495
519
  criteo: {
496
520
  endpointSchema: require('./.dist/criteo/connection.etag.json'),
497
521
  playbook: require('./.dist/criteo/playbook.etag.json'),
@@ -539,6 +563,10 @@ exports.etags = {
539
563
  playbook: require('./.dist/google-cm360/playbook.etag.json'),
540
564
  kit: require('./.dist/google-cm360/kit.etag.json')
541
565
  },
566
+ 'google-firebase': {
567
+ playbook: require('./.dist/google-firebase/playbook.etag.json'),
568
+ kit: require('./.dist/google-firebase/kit.etag.json')
569
+ },
542
570
  'google-pubsub': {
543
571
  playbook: require('./.dist/google-pubsub/playbook.etag.json'),
544
572
  kit: require('./.dist/google-pubsub/kit.etag.json')
@@ -600,6 +628,11 @@ exports.etags = {
600
628
  playbook: require('./.dist/movable-ink/playbook.etag.json'),
601
629
  kit: require('./.dist/movable-ink/kit.etag.json')
602
630
  },
631
+ 'movable-ink-customer-data': {
632
+ endpointSchema: require('./.dist/movable-ink-customer-data/connection.etag.json'),
633
+ playbook: require('./.dist/movable-ink-customer-data/playbook.etag.json'),
634
+ kit: require('./.dist/movable-ink-customer-data/kit.etag.json')
635
+ },
603
636
  nextdoor: {
604
637
  endpointSchema: require('./.dist/nextdoor/connection.etag.json'),
605
638
  playbook: require('./.dist/nextdoor/playbook.etag.json'),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metarouter/ajs-starter-kit",
3
- "version": "1.0.78",
3
+ "version": "1.0.80",
4
4
  "description": "MetaRouter analytics.js starter kit",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -12,4 +12,4 @@
12
12
  "devDependencies": {
13
13
  "yamljs": "^0.3.0"
14
14
  }
15
- }
15
+ }