@metarouter/ajs-starter-kit 1.0.113 → 1.0.115

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
- "6304517b7fe5b179c5f794d2345360e1"
1
+ "d5ce1223322b433f567cfc2b8afe1b7f"
@@ -21,7 +21,7 @@
21
21
  "note": "Version: 0.2.0\nUpdate endpoint for identify event\nInclude IP and userAgent in dataFields"
22
22
  },
23
23
  {
24
- "date": "2024-11-27T21:00:00.000Z",
24
+ "date": "2024-11-21T21:00:00.000Z",
25
25
  "note": "Version: 0.3.0\nUpdate connection.yaml for SDK forwarder format\nMove user agent and ip to global stanza"
26
26
  }
27
27
  ]
@@ -1 +1 @@
1
- "aa11e2732a5f6021a95b6a440ebd8ded"
1
+ "2be528b0fe36e7efbe1b6751589975b9"
@@ -16,6 +16,14 @@
16
16
  {
17
17
  "date": "2024-11-14T22:00:00.000Z",
18
18
  "note": "Version: 0.1.0\nBeta Version"
19
+ },
20
+ {
21
+ "date": "2024-12-04T22:00:00.000Z",
22
+ "note": "Version: 0.2.0\nFixed time in milliseconds fidelity\nAdded `id` field"
23
+ },
24
+ {
25
+ "date": "2024-12-11T22:00:00.000Z",
26
+ "note": "Version: 0.3.0\nUpdated `page` events to Moloco's `HOME` or `PAGE_VIEW` event, based on `context.page.path`"
19
27
  }
20
28
  ]
21
29
  }
@@ -1 +1 @@
1
- "f58c961ddf546a8f4eb095b15ecd4fb5"
1
+ "508bb3db76f9d38bc1ec558c1a609676"
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.1.0",
2
+ "version": "0.3.0",
3
3
  "default": {
4
4
  "filters": [
5
5
  {
@@ -14,6 +14,10 @@
14
14
  },
15
15
  "global": {
16
16
  "mappings": [
17
+ {
18
+ "inputKey": "messageId",
19
+ "outputKey": "id"
20
+ },
17
21
  {
18
22
  "inputKey": "userId",
19
23
  "outputKey": "user_id"
@@ -24,7 +28,7 @@
24
28
  "transforms": [
25
29
  {
26
30
  "expression": {
27
- "body": "return MILLISECONDS_SINCE_EPOCH_FROM_RFC3999(TO_DATE_TIME(input.timestamp or input.originalTimestamp or input.sentAt, { inputFormat = \"2006-01-02T15:04:05Z07:00\" }))",
31
+ "body": "return MILLISECONDS_SINCE_EPOCH_FROM_RFC3999(input.timestamp or input.originalTimestamp or input.sentAt)",
28
32
  "lang": "lua"
29
33
  }
30
34
  }
@@ -94,10 +98,18 @@
94
98
  },
95
99
  "eventSpecific": {
96
100
  "page": {
97
- "enrichments": [
101
+ "mappings": [
98
102
  {
103
+ "inputKey": "input",
99
104
  "outputKey": "event_type",
100
- "staticString": "PAGE_VIEW"
105
+ "transforms": [
106
+ {
107
+ "expression": {
108
+ "body": "if (input.context.page.path == '/') then return \"HOME\" end\nreturn \"PAGE_VIEW\"",
109
+ "lang": "lua"
110
+ }
111
+ }
112
+ ]
101
113
  }
102
114
  ]
103
115
  },
@@ -1 +1 @@
1
- "0cb388f22b4a349e7e01941fc6def3cc"
1
+ "fb8612861d40c9dd11f7e0f43b70c79a"
@@ -8,7 +8,7 @@
8
8
  }
9
9
  ],
10
10
  "default": {
11
- "endpoint": "https://$$DATA_CENTER$$.creativecdn.com/partner/omni/postbacks?",
11
+ "endpoint": "https://$$DATA_CENTER$$.creativecdn.com/partner/omni-metarouter/postbacks?",
12
12
  "method": "POST",
13
13
  "headers": [
14
14
  {
@@ -1 +1 @@
1
- "01f6cc9025f1ba8d09f6e1527bd1bc78"
1
+ "27765902ba7cdd5037bed21d7998ce40"
@@ -16,6 +16,14 @@
16
16
  {
17
17
  "date": "2024-11-20T22:00:00.000Z",
18
18
  "note": "Version: 0.1.0\nBeta Version\nRTB House initial release"
19
+ },
20
+ {
21
+ "date": "2024-12-04T22:00:00.000Z",
22
+ "note": "Version: 0.1.1\nFixed event name from `order-completed` to `order_completed`\nFixed time in milliseconds fidelity\nImproved order ID ensuring data type conversion to String"
23
+ },
24
+ {
25
+ "date": "2024-12-11T22:00:00.000Z",
26
+ "note": "Version: 0.2.1\nUpdated Endpoint URL\nAdded new fields for all events: page URL (`su`) and page referrer (`sr`)\nAdded new events: identify, page, products_searched, product_list_viewed, product_viewed, product_added, product_added_to_wishlist, cart_viewed, checkout_started"
19
27
  }
20
28
  ]
21
29
  }
@@ -1 +1 @@
1
- "425d707091f7b548bfc2d108664fecc8"
1
+ "4cd1e59e9ea075dcba3cbf572344b6f0"
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.1.0",
2
+ "version": "0.2.1",
3
3
  "params": [
4
4
  {
5
5
  "name": "PARTNER_KEY",
@@ -22,38 +22,194 @@
22
22
  }
23
23
  ]
24
24
  },
25
+ "global": {
26
+ "enrichments": [
27
+ {
28
+ "outputKey": "pkey",
29
+ "staticString": "$$PARTNER_KEY$$"
30
+ }
31
+ ],
32
+ "mappings": [
33
+ {
34
+ "inputKey": "anonymousId",
35
+ "outputKey": "aid"
36
+ },
37
+ {
38
+ "inputKey": "input",
39
+ "outputKey": "time",
40
+ "transforms": [
41
+ {
42
+ "expression": {
43
+ "body": "return MILLISECONDS_SINCE_EPOCH_FROM_RFC3999(input.timestamp or input.originalTimestamp or input.sentAt)",
44
+ "lang": "lua"
45
+ }
46
+ }
47
+ ]
48
+ },
49
+ {
50
+ "inputKey": "input",
51
+ "outputKey": "su",
52
+ "transforms": [
53
+ {
54
+ "expression": {
55
+ "lang": "lua",
56
+ "body": "local function encodeURIComponent(url)\n if url == nil then return end\n url = url:gsub(\"[^%w%-_%.!~%*'%(%)]\", function(c) return string.format(\"%%%02X\", string.byte(c)) end)\n return url\nend\nreturn encodeURIComponent(input.context.page.url)"
57
+ }
58
+ }
59
+ ]
60
+ },
61
+ {
62
+ "inputKey": "input",
63
+ "outputKey": "sr",
64
+ "transforms": [
65
+ {
66
+ "expression": {
67
+ "lang": "lua",
68
+ "body": "local function encodeURIComponent(url)\n if url == nil then return end\n url = url:gsub(\"[^%w%-_%.!~%*'%(%)]\", function(c) return string.format(\"%%%02X\", string.byte(c)) end)\n return url\nend\nreturn encodeURIComponent(input.context.page.referrer)"
69
+ }
70
+ }
71
+ ]
72
+ }
73
+ ]
74
+ },
25
75
  "eventSpecific": {
26
- "order-completed": {
76
+ "identify": {
77
+ "mappings": [
78
+ {
79
+ "inputKey": "input",
80
+ "outputKey": "tag",
81
+ "transforms": [
82
+ {
83
+ "expression": {
84
+ "body": "local pii = input.traits.email or input.context.traits.email or input.traits.phone or input.context.traits.phone\nlocal identifyDetails = \"\"\nif (pii) then identifyDetails = TO_SHA256_HASH(LOWER(TRIM(pii))) end\nreturn JOIN({\n 'pr_$$TAGGING_HASH$$',\n 'uid',\n identifyDetails\n}, '_')",
85
+ "lang": "lua"
86
+ }
87
+ }
88
+ ]
89
+ }
90
+ ]
91
+ },
92
+ "page": {
93
+ "mappings": [
94
+ {
95
+ "inputKey": "input",
96
+ "outputKey": "tag",
97
+ "transforms": [
98
+ {
99
+ "expression": {
100
+ "body": "local tag = \"\"\nif (input.context.page.path == '/') then tag = \"home\" end\nreturn JOIN({\n 'pr_$$TAGGING_HASH$$',\n tag\n}, '_')",
101
+ "lang": "lua"
102
+ }
103
+ }
104
+ ]
105
+ }
106
+ ]
107
+ },
108
+ "products_searched": {
27
109
  "enrichments": [
28
110
  {
29
- "outputKey": "pkey",
30
- "staticString": "$$PARTNER_KEY$$"
111
+ "outputKey": "tag",
112
+ "staticString": "pr_$$TAGGING_HASH$$_listing_"
31
113
  }
32
- ],
114
+ ]
115
+ },
116
+ "product_list_viewed": {
33
117
  "mappings": [
34
118
  {
35
- "inputKey": "anonymousId",
36
- "outputKey": "aid"
37
- },
119
+ "inputKey": "input",
120
+ "outputKey": "tag",
121
+ "transforms": [
122
+ {
123
+ "expression": {
124
+ "body": "return JOIN({\n 'pr_$$TAGGING_HASH$$',\n 'category2',\n input.properties.category or input.properties.list_id or ''\n}, '_')",
125
+ "lang": "lua"
126
+ }
127
+ }
128
+ ]
129
+ }
130
+ ]
131
+ },
132
+ "product_viewed": {
133
+ "mappings": [
134
+ {
135
+ "inputKey": "input",
136
+ "outputKey": "tag",
137
+ "transforms": [
138
+ {
139
+ "expression": {
140
+ "body": "return JOIN({\n 'pr_$$TAGGING_HASH$$',\n 'offer',\n input.properties.product_id or input.properties.sku or ''\n}, '_')",
141
+ "lang": "lua"
142
+ }
143
+ }
144
+ ]
145
+ }
146
+ ]
147
+ },
148
+ "product_added": {
149
+ "mappings": [
150
+ {
151
+ "inputKey": "input",
152
+ "outputKey": "tag",
153
+ "transforms": [
154
+ {
155
+ "expression": {
156
+ "body": "return JOIN({\n 'pr_$$TAGGING_HASH$$',\n 'basketadd',\n input.properties.product_id or input.properties.sku or ''\n}, '_')",
157
+ "lang": "lua"
158
+ }
159
+ }
160
+ ]
161
+ }
162
+ ]
163
+ },
164
+ "product_added_to_wishlist": {
165
+ "mappings": [
38
166
  {
39
167
  "inputKey": "input",
40
- "outputKey": "time",
168
+ "outputKey": "tag",
41
169
  "transforms": [
42
170
  {
43
171
  "expression": {
44
- "body": "return MILLISECONDS_SINCE_EPOCH_FROM_RFC3999(TO_DATE_TIME(input.timestamp or input.originalTimestamp or input.sentAt, { inputFormat = \"2006-01-02T15:04:05Z07:00\" }))",
172
+ "body": "return JOIN({\n 'pr_$$TAGGING_HASH$$',\n 'wishlist',\n input.properties.product_id or input.properties.sku or ''\n}, '_')",
45
173
  "lang": "lua"
46
174
  }
47
175
  }
48
176
  ]
49
- },
177
+ }
178
+ ]
179
+ },
180
+ "cart_viewed": {
181
+ "mappings": [
182
+ {
183
+ "inputKey": "input",
184
+ "outputKey": "tag",
185
+ "transforms": [
186
+ {
187
+ "expression": {
188
+ "body": "local value = SUM(MAP(input.properties.products, function (p) return p.price * (p.quantity or 1) end));\nlocal products = MAP(input.properties.products, function (p) return p.product_id or p.sku or '' end );\nlocal orderID = input.properties.order_id or ''\nreturn JOIN({\n 'pr_$$TAGGING_HASH$$',\n 'basketstatus',\n JOIN(products, \",\")\n}, '_')",
189
+ "lang": "lua"
190
+ }
191
+ }
192
+ ]
193
+ }
194
+ ]
195
+ },
196
+ "checkout_started": {
197
+ "enrichments": [
198
+ {
199
+ "outputKey": "tag",
200
+ "staticString": "pr_$$TAGGING_HASH$$_startorder"
201
+ }
202
+ ]
203
+ },
204
+ "order_completed": {
205
+ "mappings": [
50
206
  {
51
207
  "inputKey": "input",
52
208
  "outputKey": "tag",
53
209
  "transforms": [
54
210
  {
55
211
  "expression": {
56
- "body": "local value = SUM(MAP(input.properties.products, function (p) return p.price * (p.quantity or 1) end));\nlocal products = MAP(input.properties.products, function (p) return p.product_id or p.sku end );\nreturn JOIN({\n 'pr_$$TAGGING_HASH$$',\n 'conversion_order_purchase',\n value,\n input.properties.order_id,\n JOIN(products, \",\")\n}, '_')",
212
+ "body": "local value = SUM(MAP(input.properties.products, function (p) return p.price * (p.quantity or 1) end));\nlocal products = MAP(input.properties.products, function (p) return p.product_id or p.sku or '' end );\nlocal orderID = input.properties.order_id or ''\nreturn JOIN({\n 'pr_$$TAGGING_HASH$$',\n 'conversion_order_purchase',\n value,\n TRIM(TO_STRING(orderID)),\n JOIN(products, \",\")\n}, '_')",
57
213
  "lang": "lua"
58
214
  }
59
215
  }
package/README.md CHANGED
@@ -5,14 +5,16 @@ event methods, you will create a rich, actionable data set from your website, mo
5
5
  server, and other sources. It is particularly useful for tracking the pages or screens your
6
6
  users visit, the actions they take on your property, and whether the user has been identified
7
7
  previously.
8
+ ## 2024-12
9
+ - Moloco (BETA)
10
+ - RTB House (BETA)
11
+
8
12
  ## 2024-11
9
13
  - Adobe Analytics - Experience (BETA)
10
14
  - AWIN (BETA)
11
15
  - Convert (BETA)
12
16
  - Iterable (BETA)
13
- - Moloco (BETA)
14
17
  - Innervate
15
- - RTB House (BETA)
16
18
  - Snapchat - CAPI
17
19
  - Zeotap (BETA)
18
20
 
@@ -99,13 +101,13 @@ previously.
99
101
 
100
102
  | Kit Name | Date | Latest Note |
101
103
  |----------|------|-------------|
104
+ | Moloco (BETA) | 2024-12 | Version: 0.3.0 Updated `page` events to Moloco's `HOME` or `PAGE_VIEW` event, based on `context.page.path` |
105
+ | RTB House (BETA) | 2024-12 | Version: 0.2.1 Updated Endpoint URL Added new fields for all events: page URL (`su`) and page referrer (`sr`) Added new events: identify, page, products_searched, product_list_viewed, product_viewed, product_added, product_added_to_wishlist, cart_viewed, checkout_started |
102
106
  | Adobe Analytics - Experience (BETA) | 2024-11 | Version: 0.6.0 Adding checkout event Updating inputKey for siteSection |
103
107
  | AWIN (BETA) | 2024-11 | Version: 0.1.0 Beta Version AWIN initial release |
104
108
  | Convert (BETA) | 2024-11 | Version: 0.3.0 Added new deduplication parameter for all events, `tid` |
105
109
  | Iterable (BETA) | 2024-11 | Version: 0.3.0 Update connection.yaml for SDK forwarder format Move user agent and ip to global stanza |
106
- | Moloco (BETA) | 2024-11 | Version: 0.1.0 Beta Version |
107
110
  | Innervate | 2024-11 | Version: 1.0.0 Updated friendly name Stable release |
108
- | RTB House (BETA) | 2024-11 | Version: 0.1.0 Beta Version RTB House initial release |
109
111
  | Snapchat - CAPI | 2024-11 | Version: 1.3.0 Added the `_scid` cookie value as `user_data.sc_cookie1` |
110
112
  | Zeotap (BETA) | 2024-11 | Version: 0.4.0 Added new mapping for `context_country` |
111
113
  | ActionIQ | 2024-10 | Version: 1.2.0 Added header `Accept-Encoding: application/json` |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metarouter/ajs-starter-kit",
3
- "version": "1.0.113",
3
+ "version": "1.0.115",
4
4
  "description": "MetaRouter analytics.js starter kit",
5
5
  "main": "index.js",
6
6
  "scripts": {