@metarouter/ajs-starter-kit 1.0.145 → 1.0.147

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
- "9f4eff319559e9105d63791341a104b0 -"
1
+ "97fdbef95e5ad45de609e624d6aabf22 -"
@@ -20,6 +20,14 @@
20
20
  {
21
21
  "date": "2025-10-08T21:00:00.000Z",
22
22
  "note": "Version: 0.1.1\nConnection parameter fixes"
23
+ },
24
+ {
25
+ "date": "2025-10-22T21:00:00.000Z",
26
+ "note": "Version: 0.2.0\nLanguage field added"
27
+ },
28
+ {
29
+ "date": "2025-10-29T21:00:00.000Z",
30
+ "note": "Version: 0.3.0\nuserAgent generation for native app support\nIncreased possible mappings for pageName"
23
31
  }
24
32
  ]
25
33
  }
@@ -1 +1 @@
1
- "73e7f0ad0ceb79513b4b5aa8fcf14987 -"
1
+ "4855dc44721d495a50b37f4c7709f1f5 -"
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.1.1",
2
+ "version": "0.3.0",
3
3
  "default": {
4
4
  "filters": [
5
5
  {
@@ -7,6 +7,7 @@
7
7
  "action": "allow",
8
8
  "events": [
9
9
  "page",
10
+ "screen",
10
11
  ""
11
12
  ]
12
13
  }
@@ -50,12 +51,28 @@
50
51
  "outputKey": "pageURL"
51
52
  },
52
53
  {
53
- "inputKey": "context.page.title",
54
- "outputKey": "pageName"
54
+ "inputKey": "input",
55
+ "outputKey": "pageName",
56
+ "transforms": [
57
+ {
58
+ "expression": {
59
+ "lang": "lua",
60
+ "body": "return input.context.page.title or input.name or input.properties.name or \"N/A\""
61
+ }
62
+ }
63
+ ]
55
64
  },
56
65
  {
57
- "inputKey": "context.userAgent",
58
- "outputKey": "userAgent"
66
+ "inputKey": "input",
67
+ "outputKey": "userAgent",
68
+ "transforms": [
69
+ {
70
+ "expression": {
71
+ "lang": "lua",
72
+ "body": "if input.context.userAgent then\n return input.context.userAgent\nend\n\nlocal os = LOWER(input.context.os.name)\nlocal ua_system = ''\n\nif os == \"android\" then\n ua_system = string.format(\n \"Linux; Android %s; %s %s; Locale/%s\",\n input.context.os.version or \"0\",\n input.context.device.manufacturer or \"Unknown\",\n input.context.device.model or \"UnknownModel\",\n input.context.locale or ''\n )\nelseif os == \"ios\" then\n ua_system = string.format(\n \"%s; CPU %s %s like Mac OS X; Locale/%s\",\n input.context.device.model or \"iPhone\",\n input.context.os.name,\n input.context.os.version or '0',\n input.context.locale or ''\n )\nelse\n ua_system = string.format(\"%s %s; Locale/%s\", input.context.os.name or \"UnknownOS\", input.context.os.version or \"0\", input.context.locale or '')\nend\n\nlocal userAgent = string.format(\n \"%s/%s (%s) %s/%s\",\n input.context.app.name or \"UnknownApp\",\n input.context.app.version or \"0.0\",\n ua_system,\n input.context.library.name or \"UnknownLib\",\n input.context.library.version or \"0.0\"\n)\n\nreturn userAgent"
73
+ }
74
+ }
75
+ ]
59
76
  },
60
77
  {
61
78
  "inputKey": "context.ip",
@@ -64,6 +81,10 @@
64
81
  {
65
82
  "inputKey": "context.page.referrer",
66
83
  "outputKey": "referrer"
84
+ },
85
+ {
86
+ "inputKey": "context.locale",
87
+ "outputKey": "language"
67
88
  }
68
89
  ],
69
90
  "expressions": [
@@ -1 +1 @@
1
- "367871f405d0a7248e21e5d2082adc89 -"
1
+ "0a4ecfa482b6aee622eb8a1bb78a1c5e -"
@@ -14,7 +14,7 @@
14
14
  ],
15
15
  "transform": {
16
16
  "lang": "lua",
17
- "body": "request.body = {\n client_id = batch[1].client_id,\n user_id = batch[1].user_id,\n timestamp_micros = batch[1].timestamp_micros,\n events = { batch[1].event }\n}\nreturn request"
17
+ "body": "request.body = {\n client_id = batch[1].client_id,\n user_id = batch[1].user_id,\n timestamp_micros = batch[1].timestamp_micros,\n user_location = batch[1].user_location,\n ip_override = batch[1].ip_override,\n events = { batch[1].event }\n}\nreturn request"
18
18
  }
19
19
  },
20
20
  "params": [
@@ -1 +1 @@
1
- "c127be3c1331cb8fb3d423553e86ad5d -"
1
+ "6fde9a8efeb0cb5557bcf8fbc019a7df -"
@@ -32,6 +32,10 @@
32
32
  {
33
33
  "date": "2024-04-10T00:00:00.000Z",
34
34
  "note": "Version: 1.1.0\nAdded session data: session ID, session Count\nAdded Engagement Time In Milliseconds"
35
+ },
36
+ {
37
+ "date": "2025-10-29T00:00:00.000Z",
38
+ "note": "Version: 1.2.0\nAdded geolocation data with ip_override and user_location fields"
35
39
  }
36
40
  ]
37
41
  }
@@ -1 +1 @@
1
- "3e58272119392f4a1cb5f738fc849927 -"
1
+ "73d531a4c5711cebeda2919801bd0eb5 -"
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.1.0",
2
+ "version": "1.2.0",
3
3
  "global": {
4
4
  "enrichments": [
5
5
  {
@@ -71,6 +71,38 @@
71
71
  {
72
72
  "inputKey": "context.providers.googleGtag.data.sessionCount",
73
73
  "outputKey": "event.params.session_number"
74
+ },
75
+ {
76
+ "inputKey": "context.ip",
77
+ "outputKey": "ip_override"
78
+ },
79
+ {
80
+ "inputKey": "traits.address.city",
81
+ "outputKey": "user_location.city"
82
+ },
83
+ {
84
+ "inputKey": "input",
85
+ "outputKey": "user_location.region_id",
86
+ "transforms": [
87
+ {
88
+ "expression": {
89
+ "lang": "lua",
90
+ "body": "local country_code = input.traits.address.country\nif country_code ~= nil then\n if input.traits.address.state ~= nil then\n return SUBSTRING(country_code, 0, 2) .. \"-\" .. input.traits.address.state\n end\nend"
91
+ }
92
+ }
93
+ ]
94
+ },
95
+ {
96
+ "inputKey": "input",
97
+ "outputKey": "user_location.country_id",
98
+ "transforms": [
99
+ {
100
+ "expression": {
101
+ "lang": "lua",
102
+ "body": "local country_alpha_2_format = SUBSTRING(input.traits.address.country, 0, 2)\nif country_alpha_2_format ~= null then\n return country_alpha_2_format\nend"
103
+ }
104
+ }
105
+ ]
74
106
  }
75
107
  ]
76
108
  },
@@ -1 +1 @@
1
- "32c122fd57f2a4d810dae918b8129665 -"
1
+ "4ae132e7792853f0fb78e7b1a1f6183c -"
@@ -16,6 +16,10 @@
16
16
  {
17
17
  "date": "2025-09-17T21:00:00.000Z",
18
18
  "note": "Version: 0.1.0\nBeta Version\nMicrosoft Ads CAPI initial release"
19
+ },
20
+ {
21
+ "date": "2025-10-22T21:00:00.000Z",
22
+ "note": "Version: 0.2.0\nAdded eventName for all events\nAdded eventLabel for page event for sample mapping"
19
23
  }
20
24
  ]
21
25
  }
@@ -1 +1 @@
1
- "5c9f7c440e58598ae0793c7db222fa7b -"
1
+ "1a71b62816d83684b25fb896ddb28ff1 -"
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.1.0",
2
+ "version": "0.2.0",
3
3
  "global": {
4
4
  "mappings": [
5
5
  {
@@ -92,7 +92,7 @@
92
92
  },
93
93
  {
94
94
  "inputKey": "input",
95
- "outputKey": "customData.eventLabel",
95
+ "outputKey": "eventName",
96
96
  "transforms": [
97
97
  {
98
98
  "expression": {
@@ -106,6 +106,12 @@
106
106
  },
107
107
  "eventSpecific": {
108
108
  "page": {
109
+ "enrichments": [
110
+ {
111
+ "staticString": "Lorem ipsum dolor sit amet",
112
+ "outputKey": "customData.eventLabel"
113
+ }
114
+ ],
109
115
  "mappings": [
110
116
  {
111
117
  "inputKey": "input",
package/README.md CHANGED
@@ -16,11 +16,13 @@
16
16
  - Google AJSID Segments
17
17
  - Google Ads - Conversions
18
18
  - Google Analytics
19
+ - Google Analytics 4
19
20
  - Google Analytics 4 (Collect)
20
21
  - Google Cloud Storage
21
22
  - Google Pub/Sub
22
23
  - Impact Radius
23
24
  - Kafka
25
+ - Microsoft Ads CAPI
24
26
  - Nextdoor - CAPI
25
27
  - Perion
26
28
  - Pinterest Ads
@@ -38,7 +40,7 @@
38
40
  | ActionIQ | 2021-06-24 | N/A | 2025-10-15 | Version: 1.3.1 | Added friendly names to expressions |
39
41
  | Acuity Ads | 2021-06-24 | 2023-12-13 | 2024-10-23 | Version: 1.1.0 | Added header `Accept-Encoding: application/json` |
40
42
  | Adjust | 2025-09-10 | N/A | 2025-10-15 | Version: 0.1.1 | Added friendly names to expressions |
41
- | Adobe Analytics (New) | 2025-10-08 | N/A | 2025-10-08 | Version: 0.1.1 | Connection parameter fixes |
43
+ | Adobe Analytics (New) | 2025-10-08 | N/A | 2025-10-29 | Version: 0.3.0 | userAgent generation for native app support Increased possible mappings for pageName |
42
44
  | Adobe Experience Platform - Interact | 2023-03-21 | 2025-08-20 | 2025-08-20 | Version: 1.0.0 | Stable Release |
43
45
  | Adobe ID | 2023-03-07 | N/A | 2024-10-23 | Version: 0.2.0 | Added header `Accept-Encoding: application/json` |
44
46
  | Amazon DSP CAPI | 2025-05-21 | 2025-08-13 | 2025-08-13 | Version: 1.0.0 | Stable Release |
@@ -66,7 +68,7 @@
66
68
  | Google AJSID Segments | 2024-05-29 | N/A | 2025-10-15 | Version: 0.1.1 | Added friendly names to expressions |
67
69
  | Google Ads - Conversions | 2023-07-04 | 2024-04-17 | 2025-10-15 | Version: 1.3.1 | Added friendly names to expressions |
68
70
  | Google Analytics | 2021-06-24 | N/A | 2025-10-15 | Version: 1.0.1 | Added friendly names to expressions |
69
- | Google Analytics 4 | 2022-08-11 | N/A | 2024-04-10 | Version: 1.1.0 | Added session data: session ID, session Count Added Engagement Time In Milliseconds |
71
+ | Google Analytics 4 | 2022-08-11 | N/A | 2025-10-29 | Version: 1.2.0 | Added geolocation data with ip_override and user_location fields |
70
72
  | Google Analytics 4 (Collect) | 2024-04-24 | 2025-08-20 | 2025-10-15 | Version: 1.0.1 | Added friendly names to expressions |
71
73
  | Google BigQuery | 2021-06-24 | 2023-12-13 | 2025-01-16 | Version: 1.1.0 | Adding support for table overrides |
72
74
  | Google Cloud Storage | 2021-06-24 | N/A | 2025-10-15 | Version: 0.2.1 | Added friendly names to expressions |
@@ -87,7 +89,7 @@
87
89
  | Merkle | 2021-06-24 | N/A | 2025-07-30 | Version: 1.3.0 | Replaced context.traits with traits. |
88
90
  | Meta CAPI | 2021-06-24 | N/A | 2025-08-06 | Version: 1.7.0 | Updated event_time key mapping |
89
91
  | Microsoft Ads | 2025-01-22 | 2025-04-02 | 2025-07-30 | Version: 1.1.0 | Replaced context.traits with traits. |
90
- | Microsoft Ads CAPI | 2025-09-17 | N/A | 2025-09-17 | Version: 0.1.0 | Beta Version Microsoft Ads CAPI initial release |
92
+ | Microsoft Ads CAPI | 2025-09-17 | N/A | 2025-10-22 | Version: 0.2.0 | Added eventName for all events Added eventLabel for page event for sample mapping |
91
93
  | Microsoft Advertising | 2021-06-24 | N/A | 2025-07-16 | Version: 0.3.0 | TABLE_SLICE custom function usage. |
92
94
  | Mixpanel | 2022-03-23 | N/A | 2024-10-23 | Version: 1.2.0 | Added header `Accept-Encoding: application/json` |
93
95
  | Moloco Commerce Media | 2024-11-14 | 2025-02-12 | 2025-02-12 | Version: 1.0.0 | New Event: session_started -> Mapped to Moloco's LAND event (web) New Event: application_open -> Mapped to Moloco's LAND event (mobile) Updated Event: screen -> Mapped to Moloco's PAGE_VIEW or HOME event based on input.name and/or input.properties.name (mobile) Updated Event: order_completed -> Added mapping for Moloco's shipping_charge field using MetaRouter's properties.shipping (web & mobile) Stable release |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metarouter/ajs-starter-kit",
3
- "version": "1.0.145",
3
+ "version": "1.0.147",
4
4
  "description": "MetaRouter analytics.js starter kit",
5
5
  "main": "index.js",
6
6
  "scripts": {