@10x-media/analytics 1.0.0-beta.11 → 1.0.0-beta.12

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.
Files changed (1241) hide show
  1. package/CHANGELOG.md +463 -0
  2. package/README.md +30 -37
  3. package/dist/access/adminUser.d.ts +15 -0
  4. package/dist/access/adminUser.js +13 -0
  5. package/dist/access/adminUser.js.map +1 -0
  6. package/dist/access/decideOnce.js +16 -0
  7. package/dist/access/decideOnce.js.map +1 -0
  8. package/dist/access/membership.d.ts +23 -0
  9. package/dist/access/membership.js +63 -0
  10. package/dist/access/membership.js.map +1 -0
  11. package/dist/access/principal.d.ts +37 -0
  12. package/dist/access/principal.js +29 -0
  13. package/dist/access/principal.js.map +1 -0
  14. package/dist/access/readGate.js +16 -0
  15. package/dist/access/readGate.js.map +1 -0
  16. package/dist/adapters/ga4/disableKey.js +7 -9
  17. package/dist/adapters/ga4/disableKey.js.map +1 -1
  18. package/dist/adapters/ga4/eventName.d.ts +2 -8
  19. package/dist/adapters/ga4/eventName.js +2 -8
  20. package/dist/adapters/ga4/eventName.js.map +1 -1
  21. package/dist/adapters/ga4/ga4.d.ts +11 -0
  22. package/dist/adapters/ga4/ga4.js +206 -123
  23. package/dist/adapters/ga4/ga4.js.map +1 -1
  24. package/dist/adapters/ga4/measurementId.js +2 -3
  25. package/dist/adapters/ga4/measurementId.js.map +1 -1
  26. package/dist/adapters/goalRead.js +15 -29
  27. package/dist/adapters/goalRead.js.map +1 -1
  28. package/dist/adapters/http/baseUrl.js +15 -0
  29. package/dist/adapters/http/baseUrl.js.map +1 -0
  30. package/dist/adapters/http/fetchJson.d.ts +19 -0
  31. package/dist/adapters/http/fetchJson.js +27 -8
  32. package/dist/adapters/http/fetchJson.js.map +1 -1
  33. package/dist/adapters/mapping.js +52 -0
  34. package/dist/adapters/mapping.js.map +1 -0
  35. package/dist/adapters/plausible/plausible.d.ts +13 -13
  36. package/dist/adapters/plausible/plausible.js +137 -122
  37. package/dist/adapters/plausible/plausible.js.map +1 -1
  38. package/dist/adapters/plausible/scriptId.js +19 -0
  39. package/dist/adapters/plausible/scriptId.js.map +1 -0
  40. package/dist/adapters/posthog/posthog.d.ts +20 -9
  41. package/dist/adapters/posthog/posthog.js +179 -113
  42. package/dist/adapters/posthog/posthog.js.map +1 -1
  43. package/dist/adapters/readTime.js +7 -0
  44. package/dist/adapters/readTime.js.map +1 -0
  45. package/dist/adapters/series.js +14 -8
  46. package/dist/adapters/series.js.map +1 -1
  47. package/dist/adapters/umami/umami.d.ts +7 -9
  48. package/dist/adapters/umami/umami.js +184 -172
  49. package/dist/adapters/umami/umami.js.map +1 -1
  50. package/dist/adapters/upstream.js +16 -0
  51. package/dist/adapters/upstream.js.map +1 -0
  52. package/dist/binding/report.d.ts +8 -0
  53. package/dist/binding/report.js +24 -0
  54. package/dist/binding/report.js.map +1 -0
  55. package/dist/binding/resolvePath.js +16 -29
  56. package/dist/binding/resolvePath.js.map +1 -1
  57. package/dist/binding/types.d.ts +14 -29
  58. package/dist/capture/captureRequest.js +28 -0
  59. package/dist/capture/captureRequest.js.map +1 -0
  60. package/dist/capture/exclusionEndpoint.js +98 -0
  61. package/dist/capture/exclusionEndpoint.js.map +1 -0
  62. package/dist/capture/exclusionPrelude.js +14 -0
  63. package/dist/capture/exclusionPrelude.js.map +1 -0
  64. package/dist/capture/exclusionToken.js +23 -0
  65. package/dist/capture/exclusionToken.js.map +1 -0
  66. package/dist/capture/jsLiteral.js +19 -0
  67. package/dist/capture/jsLiteral.js.map +1 -0
  68. package/dist/capture/mountPath.js +2 -3
  69. package/dist/capture/mountPath.js.map +1 -1
  70. package/dist/capture/proxyEndpoint.js +48 -95
  71. package/dist/capture/proxyEndpoint.js.map +1 -1
  72. package/dist/capture/proxyRoutes.js +58 -21
  73. package/dist/capture/proxyRoutes.js.map +1 -1
  74. package/dist/capture/relay.js +91 -0
  75. package/dist/capture/relay.js.map +1 -0
  76. package/dist/capture/requestBody.js +2 -6
  77. package/dist/capture/requestBody.js.map +1 -1
  78. package/dist/capture/requestTrust.js +45 -0
  79. package/dist/capture/requestTrust.js.map +1 -0
  80. package/dist/capture/sameSite.js +40 -0
  81. package/dist/capture/sameSite.js.map +1 -0
  82. package/dist/capture/slots.js +50 -25
  83. package/dist/capture/slots.js.map +1 -1
  84. package/dist/capture/trackerConfig.js +100 -36
  85. package/dist/capture/trackerConfig.js.map +1 -1
  86. package/dist/capture/trackerEndpoint.js +22 -21
  87. package/dist/capture/trackerEndpoint.js.map +1 -1
  88. package/dist/charts/BarList.d.ts +27 -14
  89. package/dist/charts/BarList.js +38 -83
  90. package/dist/charts/BarList.js.map +1 -1
  91. package/dist/charts/TrendChart.d.ts +40 -7
  92. package/dist/charts/TrendChart.js +243 -215
  93. package/dist/charts/TrendChart.js.map +1 -1
  94. package/dist/charts/bars.d.ts +15 -1
  95. package/dist/charts/bars.js +12 -12
  96. package/dist/charts/bars.js.map +1 -1
  97. package/dist/charts/bucket.js +106 -73
  98. package/dist/charts/bucket.js.map +1 -1
  99. package/dist/charts/inProgress.js +22 -0
  100. package/dist/charts/inProgress.js.map +1 -0
  101. package/dist/charts/series.d.ts +15 -0
  102. package/dist/charts/series.js +123 -0
  103. package/dist/charts/series.js.map +1 -0
  104. package/dist/charts/spline.js +91 -25
  105. package/dist/charts/spline.js.map +1 -1
  106. package/dist/charts/trendGeometry.js +91 -0
  107. package/dist/charts/trendGeometry.js.map +1 -0
  108. package/dist/core/adminOptions.d.ts +1 -0
  109. package/dist/core/adminOptions.js +193 -0
  110. package/dist/core/adminOptions.js.map +1 -0
  111. package/dist/core/budget.js +24 -0
  112. package/dist/core/budget.js.map +1 -0
  113. package/dist/core/cacheKey.d.ts +1 -0
  114. package/dist/core/cacheKey.js +48 -37
  115. package/dist/core/cacheKey.js.map +1 -1
  116. package/dist/core/cacheOptions.js +165 -0
  117. package/dist/core/cacheOptions.js.map +1 -0
  118. package/dist/core/capabilities.d.ts +24 -11
  119. package/dist/core/capabilities.js +96 -17
  120. package/dist/core/capabilities.js.map +1 -1
  121. package/dist/core/capture.d.ts +26 -25
  122. package/dist/core/captureOptions.d.ts +1 -0
  123. package/dist/core/captureOptions.js +258 -0
  124. package/dist/core/captureOptions.js.map +1 -0
  125. package/dist/core/clock.js +13 -0
  126. package/dist/core/clock.js.map +1 -0
  127. package/dist/core/collectionOption.d.ts +17 -0
  128. package/dist/core/collectionOption.js +104 -0
  129. package/dist/core/collectionOption.js.map +1 -0
  130. package/dist/core/collectionSlug.js +7 -0
  131. package/dist/core/collectionSlug.js.map +1 -0
  132. package/dist/core/contract.d.ts +285 -59
  133. package/dist/core/contract.js +6 -4
  134. package/dist/core/contract.js.map +1 -1
  135. package/dist/core/cron.js +57 -0
  136. package/dist/core/cron.js.map +1 -0
  137. package/dist/core/fetch.d.ts +17 -0
  138. package/dist/core/goalOptions.d.ts +1 -0
  139. package/dist/core/goalOptions.js +166 -0
  140. package/dist/core/goalOptions.js.map +1 -0
  141. package/dist/core/granularity.js +3 -2
  142. package/dist/core/granularity.js.map +1 -1
  143. package/dist/core/guards.js +17 -0
  144. package/dist/core/guards.js.map +1 -0
  145. package/dist/core/jobs.d.ts +40 -0
  146. package/dist/core/jobs.js +132 -0
  147. package/dist/core/jobs.js.map +1 -0
  148. package/dist/core/legacyOptions.js +145 -0
  149. package/dist/core/legacyOptions.js.map +1 -0
  150. package/dist/core/metricAliases.js +81 -0
  151. package/dist/core/metricAliases.js.map +1 -0
  152. package/dist/core/metricValues.js +57 -0
  153. package/dist/core/metricValues.js.map +1 -0
  154. package/dist/core/monotonic.js +10 -0
  155. package/dist/core/monotonic.js.map +1 -0
  156. package/dist/core/optionChecks.js +51 -0
  157. package/dist/core/optionChecks.js.map +1 -0
  158. package/dist/core/options.d.ts +473 -157
  159. package/dist/core/options.js +154 -219
  160. package/dist/core/options.js.map +1 -1
  161. package/dist/core/registry.js +45 -5
  162. package/dist/core/registry.js.map +1 -1
  163. package/dist/core/scopeList.js +7 -9
  164. package/dist/core/scopeList.js.map +1 -1
  165. package/dist/core/scopeOptions.d.ts +1 -0
  166. package/dist/core/scopeOptions.js +112 -0
  167. package/dist/core/scopeOptions.js.map +1 -0
  168. package/dist/core/scopedRead.js +182 -72
  169. package/dist/core/scopedRead.js.map +1 -1
  170. package/dist/core/sdks.d.ts +81 -0
  171. package/dist/core/sdks.js +23 -0
  172. package/dist/core/sdks.js.map +1 -0
  173. package/dist/core/serverEvent.d.ts +38 -20
  174. package/dist/core/serverEvent.js.map +1 -1
  175. package/dist/core/siteAddress.js +20 -0
  176. package/dist/core/siteAddress.js.map +1 -0
  177. package/dist/core/sourceErrors.js +109 -0
  178. package/dist/core/sourceErrors.js.map +1 -0
  179. package/dist/core/sourceOptions.js +94 -0
  180. package/dist/core/sourceOptions.js.map +1 -0
  181. package/dist/core/throttle.js +18 -0
  182. package/dist/core/throttle.js.map +1 -0
  183. package/dist/core/values.js +61 -0
  184. package/dist/core/values.js.map +1 -0
  185. package/dist/core/widgetSlugs.d.ts +17 -0
  186. package/dist/core/widgetSlugs.js +29 -0
  187. package/dist/core/widgetSlugs.js.map +1 -0
  188. package/dist/db/detachedWrite.js +36 -0
  189. package/dist/db/detachedWrite.js.map +1 -0
  190. package/dist/db/errors.js +182 -0
  191. package/dist/db/errors.js.map +1 -0
  192. package/dist/db/kind.js +32 -0
  193. package/dist/db/kind.js.map +1 -0
  194. package/dist/db/openTransaction.js +51 -0
  195. package/dist/db/openTransaction.js.map +1 -0
  196. package/dist/exports/adapters/contract.d.ts +14 -0
  197. package/dist/exports/adapters/ga4.d.ts +15 -1
  198. package/dist/exports/adapters/native.d.ts +26 -2
  199. package/dist/exports/adapters/native.js +4 -1
  200. package/dist/exports/adapters/plausible.d.ts +15 -1
  201. package/dist/exports/adapters/posthog.d.ts +15 -1
  202. package/dist/exports/adapters/umami.d.ts +15 -1
  203. package/dist/exports/attributes.d.ts +42 -0
  204. package/dist/exports/attributes.js +83 -0
  205. package/dist/exports/attributes.js.map +1 -0
  206. package/dist/exports/client.d.ts +41 -13
  207. package/dist/exports/client.js +21 -9
  208. package/dist/exports/geo.d.ts +3 -1
  209. package/dist/exports/geo.js +1 -1
  210. package/dist/exports/i18n.d.ts +2 -2
  211. package/dist/exports/i18n.js +2 -2
  212. package/dist/exports/migrations.d.ts +2 -0
  213. package/dist/exports/migrations.js +2 -0
  214. package/dist/exports/next.d.ts +18 -1
  215. package/dist/exports/next.js +3 -1
  216. package/dist/exports/react.d.ts +3 -2
  217. package/dist/exports/react.js +1 -2
  218. package/dist/exports/rsc.d.ts +31 -14
  219. package/dist/exports/rsc.js +11 -6
  220. package/dist/exports/site.d.ts +5 -0
  221. package/dist/exports/site.js +3 -0
  222. package/dist/exports/testing.d.ts +17 -0
  223. package/dist/exports/testing.js +3 -0
  224. package/dist/exports/tracker.d.ts +5 -20
  225. package/dist/exports/tracker.js +3 -14
  226. package/dist/exports/types.d.ts +40 -14
  227. package/dist/exports/types.js +5 -1
  228. package/dist/fields/AnalyticsPanelClient.js +265 -154
  229. package/dist/fields/AnalyticsPanelClient.js.map +1 -1
  230. package/dist/fields/AnalyticsPanelField.d.ts +20 -8
  231. package/dist/fields/AnalyticsPanelField.js +121 -30
  232. package/dist/fields/AnalyticsPanelField.js.map +1 -1
  233. package/dist/fields/AnalyticsStatField.d.ts +18 -7
  234. package/dist/fields/AnalyticsStatField.js +98 -63
  235. package/dist/fields/AnalyticsStatField.js.map +1 -1
  236. package/dist/fields/FieldShimmer.js +15 -0
  237. package/dist/fields/FieldShimmer.js.map +1 -0
  238. package/dist/fields/PanelContent.js +217 -0
  239. package/dist/fields/PanelContent.js.map +1 -0
  240. package/dist/fields/PanelList.js +82 -0
  241. package/dist/fields/PanelList.js.map +1 -0
  242. package/dist/fields/PanelLiveCounter.js +63 -0
  243. package/dist/fields/PanelLiveCounter.js.map +1 -0
  244. package/dist/fields/PanelSkeleton.js +63 -0
  245. package/dist/fields/PanelSkeleton.js.map +1 -0
  246. package/dist/fields/componentPaths.js +8 -0
  247. package/dist/fields/componentPaths.js.map +1 -0
  248. package/dist/fields/config/FilterDimensionSelectField.d.ts +2 -2
  249. package/dist/fields/config/FilterDimensionSelectField.js +26 -54
  250. package/dist/fields/config/FilterDimensionSelectField.js.map +1 -1
  251. package/dist/fields/config/FilterKeySelect.js +66 -0
  252. package/dist/fields/config/FilterKeySelect.js.map +1 -0
  253. package/dist/fields/config/FilterOperatorSelectField.d.ts +7 -2
  254. package/dist/fields/config/FilterOperatorSelectField.js +37 -53
  255. package/dist/fields/config/FilterOperatorSelectField.js.map +1 -1
  256. package/dist/fields/config/FilterValueField.d.ts +17 -0
  257. package/dist/fields/config/FilterValueField.js +130 -0
  258. package/dist/fields/config/FilterValueField.js.map +1 -0
  259. package/dist/fields/config/MetricSelectField.d.ts +5 -12
  260. package/dist/fields/config/MetricSelectField.js +18 -30
  261. package/dist/fields/config/MetricSelectField.js.map +1 -1
  262. package/dist/fields/config/OptionSelect.js +52 -0
  263. package/dist/fields/config/OptionSelect.js.map +1 -0
  264. package/dist/fields/config/SourceSelectField.js +16 -31
  265. package/dist/fields/config/SourceSelectField.js.map +1 -1
  266. package/dist/fields/config/fetchSources.js +14 -26
  267. package/dist/fields/config/fetchSources.js.map +1 -1
  268. package/dist/fields/config/filterValues.js +106 -0
  269. package/dist/fields/config/filterValues.js.map +1 -0
  270. package/dist/fields/config/narrow.js +8 -10
  271. package/dist/fields/config/narrow.js.map +1 -1
  272. package/dist/fields/config/retiredPickers.d.ts +45 -0
  273. package/dist/fields/config/retiredPickers.js +46 -0
  274. package/dist/fields/config/retiredPickers.js.map +1 -0
  275. package/dist/fields/config/scopedFields.d.ts +40 -0
  276. package/dist/fields/config/scopedFields.js +68 -0
  277. package/dist/fields/config/scopedFields.js.map +1 -0
  278. package/dist/fields/config/toSelectOption.js +13 -7
  279. package/dist/fields/config/toSelectOption.js.map +1 -1
  280. package/dist/fields/config/useAnalyticsSources.d.ts +5 -7
  281. package/dist/fields/config/useAnalyticsSources.js +17 -21
  282. package/dist/fields/config/useAnalyticsSources.js.map +1 -1
  283. package/dist/fields/config/useFilterCapabilities.d.ts +9 -6
  284. package/dist/fields/config/useFilterCapabilities.js +23 -15
  285. package/dist/fields/config/useFilterCapabilities.js.map +1 -1
  286. package/dist/fields/config/useFormString.js +12 -0
  287. package/dist/fields/config/useFormString.js.map +1 -0
  288. package/dist/fields/dateRange/field.js +7 -19
  289. package/dist/fields/dateRange/field.js.map +1 -1
  290. package/dist/fields/dateRange/types.d.ts +5 -1
  291. package/dist/fields/dateRange/ui.d.ts +3 -2
  292. package/dist/fields/dateRange/ui.js +57 -319
  293. package/dist/fields/dateRange/ui.js.map +1 -1
  294. package/dist/fields/documentScope.js +21 -0
  295. package/dist/fields/documentScope.js.map +1 -0
  296. package/dist/fields/emptyState.js +31 -26
  297. package/dist/fields/emptyState.js.map +1 -1
  298. package/dist/fields/factories.d.ts +35 -16
  299. package/dist/fields/factories.js +66 -37
  300. package/dist/fields/factories.js.map +1 -1
  301. package/dist/fields/format.d.ts +12 -3
  302. package/dist/fields/format.js +77 -13
  303. package/dist/fields/format.js.map +1 -1
  304. package/dist/fields/itemReport.js +45 -0
  305. package/dist/fields/itemReport.js.map +1 -0
  306. package/dist/fields/readForDocument.d.ts +78 -26
  307. package/dist/fields/readForDocument.js +446 -116
  308. package/dist/fields/readForDocument.js.map +1 -1
  309. package/dist/fields/stateKeys.js +20 -0
  310. package/dist/fields/stateKeys.js.map +1 -0
  311. package/dist/goals/GoalAmountField.d.ts +10 -0
  312. package/dist/goals/GoalAmountField.js +162 -0
  313. package/dist/goals/GoalAmountField.js.map +1 -0
  314. package/dist/goals/GoalSelectField.js +89 -40
  315. package/dist/goals/GoalSelectField.js.map +1 -1
  316. package/dist/goals/GoalSelectFieldServer.d.ts +13 -0
  317. package/dist/goals/GoalSelectFieldServer.js +21 -0
  318. package/dist/goals/GoalSelectFieldServer.js.map +1 -0
  319. package/dist/goals/amountField.d.ts +20 -0
  320. package/dist/goals/amountField.js +37 -0
  321. package/dist/goals/amountField.js.map +1 -0
  322. package/dist/goals/builtin.js +17 -0
  323. package/dist/goals/builtin.js.map +1 -0
  324. package/dist/goals/collection.d.ts +22 -0
  325. package/dist/goals/collection.js +141 -100
  326. package/dist/goals/collection.js.map +1 -1
  327. package/dist/goals/constants.d.ts +38 -0
  328. package/dist/goals/constants.js +49 -0
  329. package/dist/goals/constants.js.map +1 -0
  330. package/dist/goals/currency.d.ts +16 -0
  331. package/dist/goals/currency.js +46 -4
  332. package/dist/goals/currency.js.map +1 -1
  333. package/dist/goals/currencyOptions.js +70 -0
  334. package/dist/goals/currencyOptions.js.map +1 -0
  335. package/dist/goals/fetchGoals.d.ts +10 -0
  336. package/dist/goals/fetchGoals.js +12 -26
  337. package/dist/goals/fetchGoals.js.map +1 -1
  338. package/dist/goals/goalField.d.ts +4 -6
  339. package/dist/goals/goalField.js +9 -19
  340. package/dist/goals/goalField.js.map +1 -1
  341. package/dist/goals/goalsEndpoint.js +39 -40
  342. package/dist/goals/goalsEndpoint.js.map +1 -1
  343. package/dist/goals/items.js +35 -0
  344. package/dist/goals/items.js.map +1 -0
  345. package/dist/goals/latent.js +9 -0
  346. package/dist/goals/latent.js.map +1 -0
  347. package/dist/goals/linkFields.d.ts +35 -0
  348. package/dist/goals/linkFields.js +31 -0
  349. package/dist/goals/linkFields.js.map +1 -0
  350. package/dist/goals/match.d.ts +14 -0
  351. package/dist/goals/match.js +67 -46
  352. package/dist/goals/match.js.map +1 -1
  353. package/dist/goals/moneyFields.js +56 -0
  354. package/dist/goals/moneyFields.js.map +1 -0
  355. package/dist/goals/pathMatch.js +122 -0
  356. package/dist/goals/pathMatch.js.map +1 -0
  357. package/dist/goals/placeholder.js +12 -0
  358. package/dist/goals/placeholder.js.map +1 -0
  359. package/dist/goals/resolver.d.ts +3 -3
  360. package/dist/goals/resolver.js +154 -46
  361. package/dist/goals/resolver.js.map +1 -1
  362. package/dist/goals/serverRevenue.d.ts +60 -0
  363. package/dist/goals/serverRevenue.js +41 -0
  364. package/dist/goals/serverRevenue.js.map +1 -0
  365. package/dist/goals/trackGoalAction.d.ts +26 -27
  366. package/dist/goals/trackGoalAction.js +38 -52
  367. package/dist/goals/trackGoalAction.js.map +1 -1
  368. package/dist/goals/types.d.ts +13 -28
  369. package/dist/goals/types.js +1 -1
  370. package/dist/goals/types.js.map +1 -1
  371. package/dist/goals/useAnalyticsGoals.d.ts +6 -5
  372. package/dist/goals/useAnalyticsGoals.js +17 -18
  373. package/dist/goals/useAnalyticsGoals.js.map +1 -1
  374. package/dist/index.d.ts +63 -11
  375. package/dist/index.js +257 -247
  376. package/dist/index.js.map +1 -1
  377. package/dist/items/collectionIdType.js +20 -0
  378. package/dist/items/collectionIdType.js.map +1 -0
  379. package/dist/items/idType.js +31 -0
  380. package/dist/items/idType.js.map +1 -0
  381. package/dist/items/ref.js +73 -0
  382. package/dist/items/ref.js.map +1 -0
  383. package/dist/maintenance/apiTaskState.js +141 -0
  384. package/dist/maintenance/apiTaskState.js.map +1 -0
  385. package/dist/maintenance/heartbeat.js +51 -0
  386. package/dist/maintenance/heartbeat.js.map +1 -0
  387. package/dist/maintenance/lease.d.ts +1 -0
  388. package/dist/maintenance/lease.js +81 -0
  389. package/dist/maintenance/lease.js.map +1 -0
  390. package/dist/maintenance/taskSchedule.d.ts +1 -0
  391. package/dist/maintenance/taskSchedule.js +62 -0
  392. package/dist/maintenance/taskSchedule.js.map +1 -0
  393. package/dist/maintenance/underLease.js +35 -0
  394. package/dist/maintenance/underLease.js.map +1 -0
  395. package/dist/migrations/legacy.d.ts +54 -0
  396. package/dist/migrations/legacy.js +117 -0
  397. package/dist/migrations/legacy.js.map +1 -0
  398. package/dist/migrations/predefined/dropLegacyMongo.d.ts +11 -0
  399. package/dist/migrations/predefined/dropLegacyMongo.js +12 -0
  400. package/dist/migrations/predefined/dropLegacyMongo.js.map +1 -0
  401. package/dist/native/collections/aggregates.js +54 -0
  402. package/dist/native/collections/aggregates.js.map +1 -0
  403. package/dist/native/collections/hits.js +102 -0
  404. package/dist/native/collections/hits.js.map +1 -0
  405. package/dist/native/collections/slugs.d.ts +10 -0
  406. package/dist/native/collections/slugs.js +16 -0
  407. package/dist/native/collections/slugs.js.map +1 -0
  408. package/dist/native/collections/state.js +84 -0
  409. package/dist/native/collections/state.js.map +1 -0
  410. package/dist/native/collections/storeCollection.js +29 -0
  411. package/dist/native/collections/storeCollection.js.map +1 -0
  412. package/dist/native/engine/buckets.d.ts +1 -0
  413. package/dist/native/engine/buckets.js +53 -0
  414. package/dist/native/engine/buckets.js.map +1 -0
  415. package/dist/native/engine/capabilities.js +87 -0
  416. package/dist/native/engine/capabilities.js.map +1 -0
  417. package/dist/native/engine/cost.js +72 -0
  418. package/dist/native/engine/cost.js.map +1 -0
  419. package/dist/native/engine/days.d.ts +1 -0
  420. package/dist/native/engine/days.js +182 -0
  421. package/dist/native/engine/days.js.map +1 -0
  422. package/dist/native/engine/engine.d.ts +1 -0
  423. package/dist/native/engine/engine.js +1623 -0
  424. package/dist/native/engine/engine.js.map +1 -0
  425. package/dist/native/engine/instance.js +58 -0
  426. package/dist/native/engine/instance.js.map +1 -0
  427. package/dist/native/engine/maintenance.d.ts +1 -0
  428. package/dist/native/engine/maintenance.js +677 -0
  429. package/dist/native/engine/maintenance.js.map +1 -0
  430. package/dist/native/engine/merge.js +41 -0
  431. package/dist/native/engine/merge.js.map +1 -0
  432. package/dist/native/engine/nudge.js +26 -0
  433. package/dist/native/engine/nudge.js.map +1 -0
  434. package/dist/native/engine/planner.js +198 -0
  435. package/dist/native/engine/planner.js.map +1 -0
  436. package/dist/native/engine/rebuild.d.ts +22 -0
  437. package/dist/native/engine/rebuild.js +76 -0
  438. package/dist/native/engine/rebuild.js.map +1 -0
  439. package/dist/native/engine/recent.js +17 -0
  440. package/dist/native/engine/recent.js.map +1 -0
  441. package/dist/native/engine/salt.d.ts +1 -0
  442. package/dist/native/engine/salt.js +98 -0
  443. package/dist/native/engine/salt.js.map +1 -0
  444. package/dist/native/engine/siteHosts.d.ts +1 -0
  445. package/dist/native/engine/siteHosts.js +58 -0
  446. package/dist/native/engine/siteHosts.js.map +1 -0
  447. package/dist/native/engine/toHit.js +108 -0
  448. package/dist/native/engine/toHit.js.map +1 -0
  449. package/dist/native/engine/writeBuffer.d.ts +14 -0
  450. package/dist/native/engine/writeBuffer.js +317 -0
  451. package/dist/native/engine/writeBuffer.js.map +1 -0
  452. package/dist/native/geo/composeGeoResolvers.d.ts +1 -0
  453. package/dist/native/geo/composeGeoResolvers.js +4 -1
  454. package/dist/native/geo/composeGeoResolvers.js.map +1 -1
  455. package/dist/native/geo/geoResolver.d.ts +20 -2
  456. package/dist/native/geo/geoResolver.js +42 -6
  457. package/dist/native/geo/geoResolver.js.map +1 -1
  458. package/dist/native/geo/maxmindResolver.d.ts +8 -4
  459. package/dist/native/geo/maxmindResolver.js +20 -16
  460. package/dist/native/geo/maxmindResolver.js.map +1 -1
  461. package/dist/native/geo/resolveGeo.js +31 -0
  462. package/dist/native/geo/resolveGeo.js.map +1 -0
  463. package/dist/native/ingest/bots.d.ts +2 -3
  464. package/dist/native/ingest/bots.js +8 -13
  465. package/dist/native/ingest/bots.js.map +1 -1
  466. package/dist/native/ingest/browser.js +4 -6
  467. package/dist/native/ingest/browser.js.map +1 -1
  468. package/dist/native/ingest/clientIp.js +30 -9
  469. package/dist/native/ingest/clientIp.js.map +1 -1
  470. package/dist/native/ingest/device.js +4 -6
  471. package/dist/native/ingest/device.js.map +1 -1
  472. package/dist/native/ingest/endpoint.d.ts +1 -1
  473. package/dist/native/ingest/endpoint.js +119 -34
  474. package/dist/native/ingest/endpoint.js.map +1 -1
  475. package/dist/native/ingest/itemSignature.d.ts +26 -0
  476. package/dist/native/ingest/itemSignature.js +45 -0
  477. package/dist/native/ingest/itemSignature.js.map +1 -0
  478. package/dist/native/ingest/language.js +2 -3
  479. package/dist/native/ingest/language.js.map +1 -1
  480. package/dist/native/ingest/normalizeEvent.d.ts +60 -7
  481. package/dist/native/ingest/normalizeEvent.js +226 -61
  482. package/dist/native/ingest/normalizeEvent.js.map +1 -1
  483. package/dist/native/ingest/orderSignature.d.ts +13 -0
  484. package/dist/native/ingest/orderSignature.js +50 -0
  485. package/dist/native/ingest/orderSignature.js.map +1 -0
  486. package/dist/native/ingest/referrer.js +30 -32
  487. package/dist/native/ingest/referrer.js.map +1 -1
  488. package/dist/native/ingest/requestHost.js +10 -23
  489. package/dist/native/ingest/requestHost.js.map +1 -1
  490. package/dist/native/ingest/resolveHostname.d.ts +4 -13
  491. package/dist/native/ingest/resolveHostname.js +5 -6
  492. package/dist/native/ingest/resolveHostname.js.map +1 -1
  493. package/dist/native/ingest/revenue.d.ts +1 -0
  494. package/dist/native/ingest/revenue.js +121 -0
  495. package/dist/native/ingest/revenue.js.map +1 -0
  496. package/dist/native/ingest/route.d.ts +10 -0
  497. package/dist/native/ingest/route.js +82 -0
  498. package/dist/native/ingest/route.js.map +1 -0
  499. package/dist/native/ingest/serverTrack.d.ts +2 -10
  500. package/dist/native/ingest/serverTrack.js +181 -72
  501. package/dist/native/ingest/serverTrack.js.map +1 -1
  502. package/dist/native/ingest/signature.js +28 -0
  503. package/dist/native/ingest/signature.js.map +1 -0
  504. package/dist/native/ingest/source.d.ts +2 -3
  505. package/dist/native/ingest/source.js +35 -54
  506. package/dist/native/ingest/source.js.map +1 -1
  507. package/dist/native/ingest/utm.js +9 -9
  508. package/dist/native/ingest/utm.js.map +1 -1
  509. package/dist/native/ingest/validate.js +20 -10
  510. package/dist/native/ingest/validate.js.map +1 -1
  511. package/dist/native/ingest/visitorHash.js +6 -8
  512. package/dist/native/ingest/visitorHash.js.map +1 -1
  513. package/dist/native/nativeAdapter.d.ts +101 -33
  514. package/dist/native/nativeAdapter.js +375 -317
  515. package/dist/native/nativeAdapter.js.map +1 -1
  516. package/dist/native/rebuildDays.d.ts +12 -0
  517. package/dist/native/rebuildDays.js +16 -0
  518. package/dist/native/rebuildDays.js.map +1 -0
  519. package/dist/native/store/aggregate.js +450 -0
  520. package/dist/native/store/aggregate.js.map +1 -0
  521. package/dist/native/store/caps.d.ts +18 -0
  522. package/dist/native/store/caps.js +76 -0
  523. package/dist/native/store/caps.js.map +1 -0
  524. package/dist/native/store/chunks.js +34 -0
  525. package/dist/native/store/chunks.js.map +1 -0
  526. package/dist/native/store/columnValues.js +31 -0
  527. package/dist/native/store/columnValues.js.map +1 -0
  528. package/dist/native/store/dialect.js +106 -0
  529. package/dist/native/store/dialect.js.map +1 -0
  530. package/dist/native/store/eventStore.js +44 -0
  531. package/dist/native/store/eventStore.js.map +1 -0
  532. package/dist/native/store/hitRow.js +116 -0
  533. package/dist/native/store/hitRow.js.map +1 -0
  534. package/dist/native/store/hits.js +63 -0
  535. package/dist/native/store/hits.js.map +1 -0
  536. package/dist/native/store/ids.js +105 -0
  537. package/dist/native/store/ids.js.map +1 -0
  538. package/dist/native/store/mongo/aggregatePipelines.js +430 -0
  539. package/dist/native/store/mongo/aggregatePipelines.js.map +1 -0
  540. package/dist/native/store/mongo/mongoState.js +375 -0
  541. package/dist/native/store/mongo/mongoState.js.map +1 -0
  542. package/dist/native/store/mongo/mongoStore.js +618 -0
  543. package/dist/native/store/mongo/mongoStore.js.map +1 -0
  544. package/dist/native/store/mongo/pipelines.js +695 -0
  545. package/dist/native/store/mongo/pipelines.js.map +1 -0
  546. package/dist/native/store/mongo/results.js +20 -0
  547. package/dist/native/store/mongo/results.js.map +1 -0
  548. package/dist/native/store/parts.d.ts +1 -0
  549. package/dist/native/store/parts.js +95 -0
  550. package/dist/native/store/parts.js.map +1 -0
  551. package/dist/native/store/pattern.js +213 -0
  552. package/dist/native/store/pattern.js.map +1 -0
  553. package/dist/native/store/rawRead.d.ts +23 -0
  554. package/dist/native/store/rawRead.js +384 -0
  555. package/dist/native/store/rawRead.js.map +1 -0
  556. package/dist/native/store/reclassify.js +53 -0
  557. package/dist/native/store/reclassify.js.map +1 -0
  558. package/dist/native/store/sql/aggregateSql.js +345 -0
  559. package/dist/native/store/sql/aggregateSql.js.map +1 -0
  560. package/dist/native/store/sql/columns.js +48 -0
  561. package/dist/native/store/sql/columns.js.map +1 -0
  562. package/dist/native/store/sql/compile.js +656 -0
  563. package/dist/native/store/sql/compile.js.map +1 -0
  564. package/dist/native/store/sql/drivers.js +218 -0
  565. package/dist/native/store/sql/drivers.js.map +1 -0
  566. package/dist/native/store/sql/executor.js +132 -0
  567. package/dist/native/store/sql/executor.js.map +1 -0
  568. package/dist/native/store/sql/fragment.js +104 -0
  569. package/dist/native/store/sql/fragment.js.map +1 -0
  570. package/dist/native/store/sql/maintenanceSql.js +59 -0
  571. package/dist/native/store/sql/maintenanceSql.js.map +1 -0
  572. package/dist/native/store/sql/ownConnection.js +107 -0
  573. package/dist/native/store/sql/ownConnection.js.map +1 -0
  574. package/dist/native/store/sql/poolShare.js +101 -0
  575. package/dist/native/store/sql/poolShare.js.map +1 -0
  576. package/dist/native/store/sql/sqlState.js +325 -0
  577. package/dist/native/store/sql/sqlState.js.map +1 -0
  578. package/dist/native/store/sql/sqlStore.js +355 -0
  579. package/dist/native/store/sql/sqlStore.js.map +1 -0
  580. package/dist/native/store/sql/sqliteThread.d.ts +9 -0
  581. package/dist/native/store/sql/sqliteThread.js +314 -0
  582. package/dist/native/store/sql/sqliteThread.js.map +1 -0
  583. package/dist/native/store/sql/sqliteWorker.js +327 -0
  584. package/dist/native/store/sql/sqliteWorker.js.map +1 -0
  585. package/dist/native/store/sql/sqliteWorkerSource.js +347 -0
  586. package/dist/native/store/sql/sqliteWorkerSource.js.map +1 -0
  587. package/dist/native/store/state.js +151 -0
  588. package/dist/native/store/state.js.map +1 -0
  589. package/dist/native/store/stateStore.js +29 -0
  590. package/dist/native/store/stateStore.js.map +1 -0
  591. package/dist/native/store/types.d.ts +9 -0
  592. package/dist/native/tasks/maintainTask.d.ts +19 -0
  593. package/dist/native/tasks/maintainTask.js +68 -0
  594. package/dist/native/tasks/maintainTask.js.map +1 -0
  595. package/dist/net/guardedFetch.d.ts +32 -0
  596. package/dist/net/guardedFetch.js +220 -0
  597. package/dist/net/guardedFetch.js.map +1 -0
  598. package/dist/net/origin.js +40 -0
  599. package/dist/net/origin.js.map +1 -0
  600. package/dist/net/platform.d.ts +9 -0
  601. package/dist/net/platform.js +35 -0
  602. package/dist/net/platform.js.map +1 -0
  603. package/dist/next/captureRewrites.d.ts +4 -24
  604. package/dist/next/captureRewrites.js +6 -50
  605. package/dist/next/captureRewrites.js.map +1 -1
  606. package/dist/next/captureRoute.d.ts +28 -0
  607. package/dist/next/captureRoute.js +67 -0
  608. package/dist/next/captureRoute.js.map +1 -0
  609. package/dist/next/ingestRoute.d.ts +17 -0
  610. package/dist/next/ingestRoute.js +17 -0
  611. package/dist/next/ingestRoute.js.map +1 -0
  612. package/dist/next/posthogProxyRewrites.d.ts +3 -25
  613. package/dist/next/posthogProxyRewrites.js +5 -37
  614. package/dist/next/posthogProxyRewrites.js.map +1 -1
  615. package/dist/plugin/adminDependencies.js +34 -0
  616. package/dist/plugin/adminDependencies.js.map +1 -0
  617. package/dist/plugin/apiPath.js +23 -0
  618. package/dist/plugin/apiPath.js.map +1 -0
  619. package/dist/plugin/boundDocument.js +58 -0
  620. package/dist/plugin/boundDocument.js.map +1 -0
  621. package/dist/plugin/buildPhase.js +10 -0
  622. package/dist/plugin/buildPhase.js.map +1 -0
  623. package/dist/plugin/collectionChecks.js +232 -0
  624. package/dist/plugin/collectionChecks.js.map +1 -0
  625. package/dist/plugin/collectionFields.d.ts +13 -0
  626. package/dist/plugin/collectionFields.js +22 -0
  627. package/dist/plugin/collectionFields.js.map +1 -0
  628. package/dist/plugin/createRuntime.js +336 -0
  629. package/dist/plugin/createRuntime.js.map +1 -0
  630. package/dist/plugin/destroy.js +58 -0
  631. package/dist/plugin/destroy.js.map +1 -0
  632. package/dist/plugin/documentEndpoint.js +76 -53
  633. package/dist/plugin/documentEndpoint.js.map +1 -1
  634. package/dist/plugin/documentScopes.js +37 -0
  635. package/dist/plugin/documentScopes.js.map +1 -0
  636. package/dist/plugin/encrypted.js +25 -0
  637. package/dist/plugin/encrypted.js.map +1 -0
  638. package/dist/plugin/errors.d.ts +5 -12
  639. package/dist/plugin/errors.js +23 -16
  640. package/dist/plugin/errors.js.map +1 -1
  641. package/dist/plugin/flagsEndpoint.js +41 -0
  642. package/dist/plugin/flagsEndpoint.js.map +1 -0
  643. package/dist/plugin/goalHint.js +22 -11
  644. package/dist/plugin/goalHint.js.map +1 -1
  645. package/dist/plugin/itemLabels.js +114 -0
  646. package/dist/plugin/itemLabels.js.map +1 -0
  647. package/dist/plugin/jobsAccess.js +91 -0
  648. package/dist/plugin/jobsAccess.js.map +1 -0
  649. package/dist/plugin/keepAlive.js +48 -0
  650. package/dist/plugin/keepAlive.js.map +1 -0
  651. package/dist/plugin/peerImportError.js +3 -6
  652. package/dist/plugin/peerImportError.js.map +1 -1
  653. package/dist/plugin/peers.js +64 -0
  654. package/dist/plugin/peers.js.map +1 -0
  655. package/dist/plugin/pluginCollections.js +155 -0
  656. package/dist/plugin/pluginCollections.js.map +1 -0
  657. package/dist/plugin/queryEndpoint.js +69 -44
  658. package/dist/plugin/queryEndpoint.js.map +1 -1
  659. package/dist/plugin/queryParams.js +7 -0
  660. package/dist/plugin/queryParams.js.map +1 -0
  661. package/dist/plugin/readContextForRequest.js +52 -17
  662. package/dist/plugin/readContextForRequest.js.map +1 -1
  663. package/dist/plugin/readFailure.js +22 -0
  664. package/dist/plugin/readFailure.js.map +1 -0
  665. package/dist/plugin/readableProviders.js +64 -0
  666. package/dist/plugin/readableProviders.js.map +1 -0
  667. package/dist/plugin/realtimeEndpoint.js +77 -25
  668. package/dist/plugin/realtimeEndpoint.js.map +1 -1
  669. package/dist/plugin/refreshEndpoint.js +69 -44
  670. package/dist/plugin/refreshEndpoint.js.map +1 -1
  671. package/dist/plugin/relabelFields.js +36 -0
  672. package/dist/plugin/relabelFields.js.map +1 -0
  673. package/dist/plugin/requestMemo.js +35 -0
  674. package/dist/plugin/requestMemo.js.map +1 -0
  675. package/dist/plugin/routeChecks.js +39 -0
  676. package/dist/plugin/routeChecks.js.map +1 -0
  677. package/dist/plugin/routes.d.ts +53 -0
  678. package/dist/plugin/routes.js +92 -0
  679. package/dist/plugin/routes.js.map +1 -0
  680. package/dist/plugin/runtime.d.ts +1 -1
  681. package/dist/plugin/runtime.js +226 -30
  682. package/dist/plugin/runtime.js.map +1 -1
  683. package/dist/plugin/schemaOnly.js +63 -0
  684. package/dist/plugin/schemaOnly.js.map +1 -0
  685. package/dist/plugin/scopeChange.js +6 -5
  686. package/dist/plugin/scopeChange.js.map +1 -1
  687. package/dist/plugin/scopeFieldBoot.js +4 -4
  688. package/dist/plugin/scopeFieldBoot.js.map +1 -1
  689. package/dist/plugin/scopeToken.js +33 -0
  690. package/dist/plugin/scopeToken.js.map +1 -0
  691. package/dist/plugin/sourcesEndpoint.js +46 -12
  692. package/dist/plugin/sourcesEndpoint.js.map +1 -1
  693. package/dist/plugin/unbundledLanguages.js +25 -0
  694. package/dist/plugin/unbundledLanguages.js.map +1 -0
  695. package/dist/plugin/walkFields.js +22 -0
  696. package/dist/plugin/walkFields.js.map +1 -0
  697. package/dist/plugin/warmTask.js +0 -0
  698. package/dist/plugin/warmTask.js.map +1 -1
  699. package/dist/providers/access.d.ts +1 -0
  700. package/dist/providers/access.js +35 -26
  701. package/dist/providers/access.js.map +1 -1
  702. package/dist/providers/adapterPool.js +121 -0
  703. package/dist/providers/adapterPool.js.map +1 -0
  704. package/dist/providers/collection.d.ts +53 -0
  705. package/dist/providers/collection.js +274 -150
  706. package/dist/providers/collection.js.map +1 -1
  707. package/dist/providers/factory.d.ts +76 -0
  708. package/dist/providers/factory.js +76 -23
  709. package/dist/providers/factory.js.map +1 -1
  710. package/dist/providers/hosts.d.ts +25 -0
  711. package/dist/providers/hosts.js +128 -0
  712. package/dist/providers/hosts.js.map +1 -0
  713. package/dist/providers/probe.d.ts +1 -0
  714. package/dist/providers/probe.js +101 -0
  715. package/dist/providers/probe.js.map +1 -0
  716. package/dist/providers/refresh.d.ts +18 -0
  717. package/dist/providers/refresh.js +49 -0
  718. package/dist/providers/refresh.js.map +1 -0
  719. package/dist/providers/registry.js +318 -0
  720. package/dist/providers/registry.js.map +1 -0
  721. package/dist/providers/resolver.js +23 -88
  722. package/dist/providers/resolver.js.map +1 -1
  723. package/dist/providers/retarget.js +45 -0
  724. package/dist/providers/retarget.js.map +1 -0
  725. package/dist/providers/secrets.d.ts +26 -0
  726. package/dist/providers/secrets.js +61 -4
  727. package/dist/providers/secrets.js.map +1 -1
  728. package/dist/providers/stampScope.js +9 -6
  729. package/dist/providers/stampScope.js.map +1 -1
  730. package/dist/query/dates.js +10 -12
  731. package/dist/query/dates.js.map +1 -1
  732. package/dist/query/errors.d.ts +1 -5
  733. package/dist/query/fetchQuery.d.ts +25 -32
  734. package/dist/query/fetchQuery.js +91 -91
  735. package/dist/query/fetchQuery.js.map +1 -1
  736. package/dist/query/limits.js +8 -0
  737. package/dist/query/limits.js.map +1 -0
  738. package/dist/query/parse.d.ts +6 -0
  739. package/dist/query/parse.js +153 -106
  740. package/dist/query/parse.js.map +1 -1
  741. package/dist/query/response.d.ts +23 -3
  742. package/dist/query/response.js +12 -5
  743. package/dist/query/response.js.map +1 -1
  744. package/dist/react/AnalyticsProvider.d.ts +26 -17
  745. package/dist/react/AnalyticsProvider.js +23 -22
  746. package/dist/react/AnalyticsProvider.js.map +1 -1
  747. package/dist/react/TrackerBoot.js +15 -9
  748. package/dist/react/TrackerBoot.js.map +1 -1
  749. package/dist/react/useAnalytics.d.ts +2 -11
  750. package/dist/react/useAnalytics.js +22 -24
  751. package/dist/react/useAnalytics.js.map +1 -1
  752. package/dist/site/AnalyticsScripts.d.ts +34 -0
  753. package/dist/site/AnalyticsScripts.js +30 -0
  754. package/dist/site/AnalyticsScripts.js.map +1 -0
  755. package/dist/site/getTrackerConfig.d.ts +15 -0
  756. package/dist/site/getTrackerConfig.js +40 -0
  757. package/dist/site/getTrackerConfig.js.map +1 -0
  758. package/dist/surfacing/afterRead.d.ts +37 -0
  759. package/dist/surfacing/bounded.js +38 -0
  760. package/dist/surfacing/bounded.js.map +1 -0
  761. package/dist/surfacing/breaker.js +107 -0
  762. package/dist/surfacing/breaker.js.map +1 -0
  763. package/dist/surfacing/cacheCollection.d.ts +8 -0
  764. package/dist/surfacing/cacheCollection.js +69 -0
  765. package/dist/surfacing/cacheCollection.js.map +1 -0
  766. package/dist/surfacing/cacheStore.d.ts +71 -1
  767. package/dist/surfacing/cacheStore.js +16 -37
  768. package/dist/surfacing/cacheStore.js.map +1 -1
  769. package/dist/surfacing/cacheSweep.d.ts +1 -0
  770. package/dist/surfacing/cacheSweep.js +59 -0
  771. package/dist/surfacing/cacheSweep.js.map +1 -0
  772. package/dist/surfacing/classifyError.js +282 -0
  773. package/dist/surfacing/classifyError.js.map +1 -0
  774. package/dist/surfacing/coalesce.js +2 -1
  775. package/dist/surfacing/coalesce.js.map +1 -1
  776. package/dist/surfacing/coldBudget.js +60 -0
  777. package/dist/surfacing/coldBudget.js.map +1 -0
  778. package/dist/surfacing/collectionCacheStore.js +183 -0
  779. package/dist/surfacing/collectionCacheStore.js.map +1 -0
  780. package/dist/surfacing/engine.d.ts +1 -1
  781. package/dist/surfacing/engine.js +514 -72
  782. package/dist/surfacing/engine.js.map +1 -1
  783. package/dist/surfacing/epoch.js +70 -26
  784. package/dist/surfacing/epoch.js.map +1 -1
  785. package/dist/surfacing/lanes.d.ts +1 -0
  786. package/dist/surfacing/lanes.js +297 -0
  787. package/dist/surfacing/lanes.js.map +1 -0
  788. package/dist/surfacing/memo.js +40 -0
  789. package/dist/surfacing/memo.js.map +1 -0
  790. package/dist/surfacing/rateLimiter.d.ts +1 -0
  791. package/dist/surfacing/rateLimiter.js +69 -94
  792. package/dist/surfacing/rateLimiter.js.map +1 -1
  793. package/dist/surfacing/rebucket.js +178 -0
  794. package/dist/surfacing/rebucket.js.map +1 -0
  795. package/dist/surfacing/recipe.js +28 -0
  796. package/dist/surfacing/recipe.js.map +1 -0
  797. package/dist/surfacing/shape.js +22 -0
  798. package/dist/surfacing/shape.js.map +1 -0
  799. package/dist/surfacing/todaySplit.js +113 -0
  800. package/dist/surfacing/todaySplit.js.map +1 -0
  801. package/dist/sync/collection.d.ts +8 -0
  802. package/dist/sync/collection.js +28 -18
  803. package/dist/sync/collection.js.map +1 -1
  804. package/dist/sync/rekeyDurations.js +70 -0
  805. package/dist/sync/rekeyDurations.js.map +1 -0
  806. package/dist/sync/syncTask.js +226 -109
  807. package/dist/sync/syncTask.js.map +1 -1
  808. package/dist/testing/memoryAdapter.d.ts +6 -3
  809. package/dist/testing/memoryAdapter.js +12 -10
  810. package/dist/testing/memoryAdapter.js.map +1 -1
  811. package/dist/testing/settle.d.ts +11 -0
  812. package/dist/testing/settle.js +19 -0
  813. package/dist/testing/settle.js.map +1 -0
  814. package/dist/timeframe/calendar.js +65 -0
  815. package/dist/timeframe/calendar.js.map +1 -0
  816. package/dist/timeframe/comparison.js +46 -0
  817. package/dist/timeframe/comparison.js.map +1 -0
  818. package/dist/timeframe/presets.d.ts +1 -1
  819. package/dist/timeframe/presets.js +5 -5
  820. package/dist/timeframe/presets.js.map +1 -1
  821. package/dist/timeframe/reportingTimezone.d.ts +1 -0
  822. package/dist/timeframe/reportingTimezone.js +64 -0
  823. package/dist/timeframe/reportingTimezone.js.map +1 -0
  824. package/dist/timeframe/tz.js +55 -39
  825. package/dist/timeframe/tz.js.map +1 -1
  826. package/dist/tracker/autoCapture.js +125 -38
  827. package/dist/tracker/autoCapture.js.map +1 -1
  828. package/dist/tracker/campaign.js +52 -0
  829. package/dist/tracker/campaign.js.map +1 -0
  830. package/dist/tracker/config.d.ts +144 -0
  831. package/dist/tracker/config.js +25 -0
  832. package/dist/tracker/config.js.map +1 -0
  833. package/dist/tracker/createTracker.d.ts +4 -10
  834. package/dist/tracker/createTracker.js +386 -115
  835. package/dist/tracker/createTracker.js.map +1 -1
  836. package/dist/tracker/digest.js +28 -0
  837. package/dist/tracker/digest.js.map +1 -0
  838. package/dist/tracker/engagement.js +100 -0
  839. package/dist/tracker/engagement.js.map +1 -0
  840. package/dist/tracker/events.js +37 -0
  841. package/dist/tracker/events.js.map +1 -0
  842. package/dist/tracker/exclusion.d.ts +2 -22
  843. package/dist/tracker/exclusion.js +53 -21
  844. package/dist/tracker/exclusion.js.map +1 -1
  845. package/dist/tracker/gate.js +194 -0
  846. package/dist/tracker/gate.js.map +1 -0
  847. package/dist/tracker/initTracker.d.ts +5 -8
  848. package/dist/tracker/initTracker.js +42 -14
  849. package/dist/tracker/initTracker.js.map +1 -1
  850. package/dist/tracker/itemCapture.js +224 -0
  851. package/dist/tracker/itemCapture.js.map +1 -0
  852. package/dist/tracker/loadScript.js +21 -14
  853. package/dist/tracker/loadScript.js.map +1 -1
  854. package/dist/tracker/pageTracking.js +6 -6
  855. package/dist/tracker/pageTracking.js.map +1 -1
  856. package/dist/tracker/registry.js +118 -30
  857. package/dist/tracker/registry.js.map +1 -1
  858. package/dist/tracker/sinks/createSink.js +38 -0
  859. package/dist/tracker/sinks/createSink.js.map +1 -0
  860. package/dist/tracker/sinks/ga4.js +64 -20
  861. package/dist/tracker/sinks/ga4.js.map +1 -1
  862. package/dist/tracker/sinks/native.js +7 -42
  863. package/dist/tracker/sinks/native.js.map +1 -1
  864. package/dist/tracker/sinks/plausible.js +27 -22
  865. package/dist/tracker/sinks/plausible.js.map +1 -1
  866. package/dist/tracker/sinks/posthog.js +26 -22
  867. package/dist/tracker/sinks/posthog.js.map +1 -1
  868. package/dist/tracker/sinks/umami.js +14 -12
  869. package/dist/tracker/sinks/umami.js.map +1 -1
  870. package/dist/tracker/sinks/vendor.js +30 -27
  871. package/dist/tracker/sinks/vendor.js.map +1 -1
  872. package/dist/tracker/skip.js +81 -0
  873. package/dist/tracker/skip.js.map +1 -0
  874. package/dist/tracker/storage.js +23 -0
  875. package/dist/tracker/storage.js.map +1 -0
  876. package/dist/tracker/transport.js +2 -5
  877. package/dist/tracker/transport.js.map +1 -1
  878. package/dist/tracker/types.d.ts +86 -63
  879. package/dist/tracker/window.js +7 -0
  880. package/dist/tracker/window.js.map +1 -0
  881. package/dist/translations/ar.js +226 -71
  882. package/dist/translations/ar.js.map +1 -1
  883. package/dist/translations/de.js +215 -69
  884. package/dist/translations/de.js.map +1 -1
  885. package/dist/translations/en.js +209 -67
  886. package/dist/translations/en.js.map +1 -1
  887. package/dist/translations/es.js +217 -68
  888. package/dist/translations/es.js.map +1 -1
  889. package/dist/translations/fr.js +221 -72
  890. package/dist/translations/fr.js.map +1 -1
  891. package/dist/translations/id.js +212 -67
  892. package/dist/translations/id.js.map +1 -1
  893. package/dist/translations/index.d.ts +1 -1
  894. package/dist/translations/index.js +5 -7
  895. package/dist/translations/index.js.map +1 -1
  896. package/dist/translations/intl.js +71 -0
  897. package/dist/translations/intl.js.map +1 -0
  898. package/dist/translations/keys.d.ts +185 -14
  899. package/dist/translations/keys.js +190 -14
  900. package/dist/translations/keys.js.map +1 -1
  901. package/dist/translations/ko.js +214 -69
  902. package/dist/translations/ko.js.map +1 -1
  903. package/dist/translations/labelMap.d.ts +10 -0
  904. package/dist/translations/labelMap.js +22 -0
  905. package/dist/translations/labelMap.js.map +1 -0
  906. package/dist/translations/metricKeys.js +10 -2
  907. package/dist/translations/metricKeys.js.map +1 -1
  908. package/dist/translations/parts.js +20 -0
  909. package/dist/translations/parts.js.map +1 -0
  910. package/dist/translations/plural.js +61 -0
  911. package/dist/translations/plural.js.map +1 -0
  912. package/dist/translations/pt.js +226 -77
  913. package/dist/translations/pt.js.map +1 -1
  914. package/dist/translations/ru.js +217 -66
  915. package/dist/translations/ru.js.map +1 -1
  916. package/dist/translations/server.d.ts +1 -0
  917. package/dist/translations/server.js +2 -3
  918. package/dist/translations/server.js.map +1 -1
  919. package/dist/translations/staticLabel.js +69 -0
  920. package/dist/translations/staticLabel.js.map +1 -0
  921. package/dist/translations/uk.js +217 -66
  922. package/dist/translations/uk.js.map +1 -1
  923. package/dist/translations/zh.js +212 -67
  924. package/dist/translations/zh.js.map +1 -1
  925. package/dist/ui/RangePicker.js +112 -0
  926. package/dist/ui/RangePicker.js.map +1 -0
  927. package/dist/ui/analytics.css +1528 -0
  928. package/dist/ui/calendarDays.js +27 -0
  929. package/dist/ui/calendarDays.js.map +1 -0
  930. package/dist/ui/classNames.js +7 -0
  931. package/dist/ui/classNames.js.map +1 -0
  932. package/dist/ui/components/Card.d.ts +28 -0
  933. package/dist/ui/components/Card.js +21 -0
  934. package/dist/ui/components/Card.js.map +1 -0
  935. package/dist/ui/components/ChartDataTable.d.ts +41 -0
  936. package/dist/ui/components/ChartDataTable.js +48 -0
  937. package/dist/ui/components/ChartDataTable.js.map +1 -0
  938. package/dist/ui/components/DataTable.d.ts +82 -0
  939. package/dist/ui/components/DataTable.js +214 -0
  940. package/dist/ui/components/DataTable.js.map +1 -0
  941. package/dist/ui/components/LabeledSelect.js +62 -0
  942. package/dist/ui/components/LabeledSelect.js.map +1 -0
  943. package/dist/ui/components/LiveAnnouncement.js +21 -0
  944. package/dist/ui/components/LiveAnnouncement.js.map +1 -0
  945. package/dist/ui/components/MetricCard.d.ts +38 -0
  946. package/dist/ui/components/MetricCard.js +39 -0
  947. package/dist/ui/components/MetricCard.js.map +1 -0
  948. package/dist/ui/components/NoValue.js +22 -0
  949. package/dist/ui/components/NoValue.js.map +1 -0
  950. package/dist/ui/components/ReadState.js +27 -0
  951. package/dist/ui/components/ReadState.js.map +1 -0
  952. package/dist/ui/components/RefreshButton.js +26 -0
  953. package/dist/ui/components/RefreshButton.js.map +1 -0
  954. package/dist/ui/cssVars.js +7 -0
  955. package/dist/ui/cssVars.js.map +1 -0
  956. package/dist/ui/data/WithScopeToken.d.ts +20 -0
  957. package/dist/ui/data/WithScopeToken.js +20 -0
  958. package/dist/ui/data/WithScopeToken.js.map +1 -0
  959. package/dist/ui/data/clientFieldProps.js +16 -0
  960. package/dist/ui/data/clientFieldProps.js.map +1 -0
  961. package/dist/ui/data/request.d.ts +46 -0
  962. package/dist/ui/data/request.js +119 -0
  963. package/dist/ui/data/request.js.map +1 -0
  964. package/dist/ui/data/scopeTokenContext.js +18 -0
  965. package/dist/ui/data/scopeTokenContext.js.map +1 -0
  966. package/dist/ui/data/sharedCache.js +48 -0
  967. package/dist/ui/data/sharedCache.js.map +1 -0
  968. package/dist/ui/data/useRequest.d.ts +19 -0
  969. package/dist/ui/data/useRequest.js +123 -0
  970. package/dist/ui/data/useRequest.js.map +1 -0
  971. package/dist/ui/data/useRequestScope.js +25 -0
  972. package/dist/ui/data/useRequestScope.js.map +1 -0
  973. package/dist/ui/hooks/useDirection.js +47 -0
  974. package/dist/ui/hooks/useDirection.js.map +1 -0
  975. package/dist/ui/hooks/useDismissOnEscape.js +25 -0
  976. package/dist/ui/hooks/useDismissOnEscape.js.map +1 -0
  977. package/dist/ui/hooks/useLiveAnnouncement.js +57 -0
  978. package/dist/ui/hooks/useLiveAnnouncement.js.map +1 -0
  979. package/dist/ui/hooks/useRealtimePoll.js +112 -0
  980. package/dist/ui/hooks/useRealtimePoll.js.map +1 -0
  981. package/dist/ui/readState.js +19 -0
  982. package/dist/ui/readState.js.map +1 -0
  983. package/dist/ui/rows/toDisplayRows.js +49 -0
  984. package/dist/ui/rows/toDisplayRows.js.map +1 -0
  985. package/dist/ui/viewerClock.js +7 -0
  986. package/dist/ui/viewerClock.js.map +1 -0
  987. package/dist/view/AnalyticsNavLink.d.ts +5 -3
  988. package/dist/view/AnalyticsNavLink.js +11 -6
  989. package/dist/view/AnalyticsNavLink.js.map +1 -1
  990. package/dist/view/AnalyticsView.d.ts +8 -10
  991. package/dist/view/AnalyticsView.js +47 -18
  992. package/dist/view/AnalyticsView.js.map +1 -1
  993. package/dist/view/AnalyticsViewClient.d.ts +4 -7
  994. package/dist/view/AnalyticsViewClient.js +15 -229
  995. package/dist/view/AnalyticsViewClient.js.map +1 -1
  996. package/dist/view/CountryFlag.d.ts +27 -0
  997. package/dist/view/CountryFlag.js +44 -0
  998. package/dist/view/CountryFlag.js.map +1 -0
  999. package/dist/view/DocumentTitle.js +27 -0
  1000. package/dist/view/DocumentTitle.js.map +1 -0
  1001. package/dist/view/ViewRoot.d.ts +21 -0
  1002. package/dist/view/ViewRoot.js +150 -0
  1003. package/dist/view/ViewRoot.js.map +1 -0
  1004. package/dist/view/ViewSections.d.ts +38 -0
  1005. package/dist/view/ViewSections.js +190 -0
  1006. package/dist/view/ViewSections.js.map +1 -0
  1007. package/dist/view/authRedirect.js +2 -4
  1008. package/dist/view/authRedirect.js.map +1 -1
  1009. package/dist/view/conversionRate.js +9 -7
  1010. package/dist/view/conversionRate.js.map +1 -1
  1011. package/dist/view/dayRange.js +6 -10
  1012. package/dist/view/dayRange.js.map +1 -1
  1013. package/dist/view/exclusionLink.d.ts +27 -0
  1014. package/dist/view/exclusionLink.js +46 -0
  1015. package/dist/view/exclusionLink.js.map +1 -0
  1016. package/dist/view/flagSrc.js +14 -0
  1017. package/dist/view/flagSrc.js.map +1 -0
  1018. package/dist/view/gating.d.ts +15 -1
  1019. package/dist/view/gating.js +66 -31
  1020. package/dist/view/gating.js.map +1 -1
  1021. package/dist/view/hostCountryFlag.js +41 -0
  1022. package/dist/view/hostCountryFlag.js.map +1 -0
  1023. package/dist/view/labels.js +95 -10
  1024. package/dist/view/labels.js.map +1 -1
  1025. package/dist/view/metricAliases.js +10 -0
  1026. package/dist/view/metricAliases.js.map +1 -0
  1027. package/dist/view/navLabel.js +15 -0
  1028. package/dist/view/navLabel.js.map +1 -0
  1029. package/dist/view/registerView.js +10 -9
  1030. package/dist/view/registerView.js.map +1 -1
  1031. package/dist/view/scopeLabel.js +21 -0
  1032. package/dist/view/scopeLabel.js.map +1 -0
  1033. package/dist/view/sections/Breakdowns.js +196 -134
  1034. package/dist/view/sections/Breakdowns.js.map +1 -1
  1035. package/dist/view/sections/EmptyStates.js +118 -30
  1036. package/dist/view/sections/EmptyStates.js.map +1 -1
  1037. package/dist/view/sections/ExcludeBrowser.js +188 -0
  1038. package/dist/view/sections/ExcludeBrowser.js.map +1 -0
  1039. package/dist/view/sections/FilterChips.js +124 -27
  1040. package/dist/view/sections/FilterChips.js.map +1 -1
  1041. package/dist/view/sections/GoalsPanel.js +68 -60
  1042. package/dist/view/sections/GoalsPanel.js.map +1 -1
  1043. package/dist/view/sections/OverviewCards.js +29 -33
  1044. package/dist/view/sections/OverviewCards.js.map +1 -1
  1045. package/dist/view/sections/RealtimeStrip.js +70 -59
  1046. package/dist/view/sections/RealtimeStrip.js.map +1 -1
  1047. package/dist/view/sections/SectionBoundary.js +34 -0
  1048. package/dist/view/sections/SectionBoundary.js.map +1 -0
  1049. package/dist/view/sections/Toolbar.d.ts +11 -0
  1050. package/dist/view/sections/Toolbar.js +123 -82
  1051. package/dist/view/sections/Toolbar.js.map +1 -1
  1052. package/dist/view/sections/Trend.js +176 -76
  1053. package/dist/view/sections/Trend.js.map +1 -1
  1054. package/dist/view/state.d.ts +42 -0
  1055. package/dist/view/state.js +93 -54
  1056. package/dist/view/state.js.map +1 -1
  1057. package/dist/view/useViewClock.js +31 -0
  1058. package/dist/view/useViewClock.js.map +1 -0
  1059. package/dist/view/useViewQueries.d.ts +21 -0
  1060. package/dist/view/useViewQueries.js +45 -77
  1061. package/dist/view/useViewQueries.js.map +1 -1
  1062. package/dist/view/useViewState.js +42 -0
  1063. package/dist/view/useViewState.js.map +1 -0
  1064. package/dist/view/useViewUrl.js +47 -0
  1065. package/dist/view/useViewUrl.js.map +1 -0
  1066. package/dist/view/viewBody.js +30 -0
  1067. package/dist/view/viewBody.js.map +1 -0
  1068. package/dist/view/viewContext.d.ts +81 -0
  1069. package/dist/view/viewContext.js +49 -0
  1070. package/dist/view/viewContext.js.map +1 -0
  1071. package/dist/view/viewProps.d.ts +64 -7
  1072. package/dist/view/viewProps.js +121 -35
  1073. package/dist/view/viewProps.js.map +1 -1
  1074. package/dist/widgets/AnalyticsBreakdownWidget.d.ts +7 -3
  1075. package/dist/widgets/AnalyticsBreakdownWidget.js +143 -118
  1076. package/dist/widgets/AnalyticsBreakdownWidget.js.map +1 -1
  1077. package/dist/widgets/AnalyticsGoalsWidget.d.ts +6 -7
  1078. package/dist/widgets/AnalyticsGoalsWidget.js +124 -167
  1079. package/dist/widgets/AnalyticsGoalsWidget.js.map +1 -1
  1080. package/dist/widgets/AnalyticsMetricWidget.d.ts +7 -3
  1081. package/dist/widgets/AnalyticsMetricWidget.js +80 -106
  1082. package/dist/widgets/AnalyticsMetricWidget.js.map +1 -1
  1083. package/dist/widgets/AnalyticsRealtimeWidget.d.ts +7 -3
  1084. package/dist/widgets/AnalyticsRealtimeWidget.js +74 -64
  1085. package/dist/widgets/AnalyticsRealtimeWidget.js.map +1 -1
  1086. package/dist/widgets/AnalyticsTrendWidget.d.ts +7 -3
  1087. package/dist/widgets/AnalyticsTrendWidget.js +129 -123
  1088. package/dist/widgets/AnalyticsTrendWidget.js.map +1 -1
  1089. package/dist/widgets/ComparisonDelta.js +33 -42
  1090. package/dist/widgets/ComparisonDelta.js.map +1 -1
  1091. package/dist/widgets/RealtimeCounter.d.ts +24 -4
  1092. package/dist/widgets/RealtimeCounter.js +91 -77
  1093. package/dist/widgets/RealtimeCounter.js.map +1 -1
  1094. package/dist/widgets/WidgetCard.d.ts +80 -0
  1095. package/dist/widgets/WidgetCard.js +99 -0
  1096. package/dist/widgets/WidgetCard.js.map +1 -0
  1097. package/dist/widgets/WidgetFrame.js +42 -0
  1098. package/dist/widgets/WidgetFrame.js.map +1 -0
  1099. package/dist/widgets/WidgetShimmer.d.ts +55 -0
  1100. package/dist/widgets/WidgetShimmer.js +86 -0
  1101. package/dist/widgets/WidgetShimmer.js.map +1 -0
  1102. package/dist/widgets/breakdownTypes.js +12 -2
  1103. package/dist/widgets/breakdownTypes.js.map +1 -1
  1104. package/dist/widgets/customWidget.d.ts +5 -1
  1105. package/dist/widgets/customWidget.js +6 -7
  1106. package/dist/widgets/customWidget.js.map +1 -1
  1107. package/dist/widgets/defaults.d.ts +4 -7
  1108. package/dist/widgets/defaults.js +4 -7
  1109. package/dist/widgets/defaults.js.map +1 -1
  1110. package/dist/widgets/fieldRows.js +14 -0
  1111. package/dist/widgets/fieldRows.js.map +1 -0
  1112. package/dist/widgets/filterCaption.js +6 -7
  1113. package/dist/widgets/filterCaption.js.map +1 -1
  1114. package/dist/widgets/filterField.d.ts +3 -7
  1115. package/dist/widgets/filterField.js +46 -35
  1116. package/dist/widgets/filterField.js.map +1 -1
  1117. package/dist/widgets/filterValueLabel.d.ts +1 -0
  1118. package/dist/widgets/filterValueLabel.js +45 -0
  1119. package/dist/widgets/filterValueLabel.js.map +1 -0
  1120. package/dist/widgets/notices.js +73 -0
  1121. package/dist/widgets/notices.js.map +1 -0
  1122. package/dist/widgets/prepareWidgetRead.d.ts +5 -1
  1123. package/dist/widgets/prepareWidgetRead.js +59 -27
  1124. package/dist/widgets/prepareWidgetRead.js.map +1 -1
  1125. package/dist/widgets/range.js +26 -21
  1126. package/dist/widgets/range.js.map +1 -1
  1127. package/dist/widgets/readForWidget.d.ts +27 -18
  1128. package/dist/widgets/readForWidget.js +31 -29
  1129. package/dist/widgets/readForWidget.js.map +1 -1
  1130. package/dist/widgets/readForWidgetBreakdown.d.ts +39 -28
  1131. package/dist/widgets/readForWidgetBreakdown.js +46 -22
  1132. package/dist/widgets/readForWidgetBreakdown.js.map +1 -1
  1133. package/dist/widgets/readForWidgetGoals.d.ts +17 -23
  1134. package/dist/widgets/readForWidgetGoals.js +50 -46
  1135. package/dist/widgets/readForWidgetGoals.js.map +1 -1
  1136. package/dist/widgets/readForWidgetRealtime.d.ts +21 -17
  1137. package/dist/widgets/readForWidgetRealtime.js +51 -27
  1138. package/dist/widgets/readForWidgetRealtime.js.map +1 -1
  1139. package/dist/widgets/readForWidgetSeries.d.ts +26 -31
  1140. package/dist/widgets/readForWidgetSeries.js +43 -82
  1141. package/dist/widgets/readForWidgetSeries.js.map +1 -1
  1142. package/dist/widgets/readMeta.d.ts +44 -0
  1143. package/dist/widgets/readMeta.js +47 -4
  1144. package/dist/widgets/readMeta.js.map +1 -1
  1145. package/dist/widgets/realtimePoll.d.ts +1 -0
  1146. package/dist/widgets/realtimePoll.js +53 -25
  1147. package/dist/widgets/realtimePoll.js.map +1 -1
  1148. package/dist/widgets/registerWidgets.js +204 -126
  1149. package/dist/widgets/registerWidgets.js.map +1 -1
  1150. package/dist/widgets/stateKeys.js +30 -0
  1151. package/dist/widgets/stateKeys.js.map +1 -0
  1152. package/dist/widgets/titleForecast.js +89 -0
  1153. package/dist/widgets/titleForecast.js.map +1 -0
  1154. package/dist/widgets/types.d.ts +4 -3
  1155. package/dist/widgets/types.js +2 -0
  1156. package/dist/widgets/types.js.map +1 -1
  1157. package/dist/widgets/viewLink.d.ts +24 -6
  1158. package/dist/widgets/viewLink.js +31 -24
  1159. package/dist/widgets/viewLink.js.map +1 -1
  1160. package/dist/widgets/widgetData.js +34 -0
  1161. package/dist/widgets/widgetData.js.map +1 -0
  1162. package/dist/widgets/widgetWindow.d.ts +1 -0
  1163. package/dist/widgets/widgetWindow.js +51 -0
  1164. package/dist/widgets/widgetWindow.js.map +1 -0
  1165. package/package.json +44 -22
  1166. package/dist/adapters/ga4/disableKey.d.ts +0 -9
  1167. package/dist/capture/getTrackerConfig.d.ts +0 -20
  1168. package/dist/capture/getTrackerConfig.js +0 -31
  1169. package/dist/capture/getTrackerConfig.js.map +0 -1
  1170. package/dist/capture/slots.d.ts +0 -8
  1171. package/dist/capture/trackerConfig.d.ts +0 -33
  1172. package/dist/charts/styles.js +0 -59
  1173. package/dist/charts/styles.js.map +0 -1
  1174. package/dist/fields/config/SourceSelectField.d.ts +0 -14
  1175. package/dist/fields/dateRange/styles.js +0 -23
  1176. package/dist/fields/dateRange/styles.js.map +0 -1
  1177. package/dist/goals/GoalSelectField.d.ts +0 -7
  1178. package/dist/native/collections/events.js +0 -165
  1179. package/dist/native/collections/events.js.map +0 -1
  1180. package/dist/native/collections/rollups.js +0 -151
  1181. package/dist/native/collections/rollups.js.map +0 -1
  1182. package/dist/native/collections/seen.js +0 -47
  1183. package/dist/native/collections/seen.js.map +0 -1
  1184. package/dist/native/eventScan.js +0 -25
  1185. package/dist/native/eventScan.js.map +0 -1
  1186. package/dist/native/ingest/flushBatch.js +0 -60
  1187. package/dist/native/ingest/flushBatch.js.map +0 -1
  1188. package/dist/native/ingest/salt.js +0 -39
  1189. package/dist/native/ingest/salt.js.map +0 -1
  1190. package/dist/native/ingest/writeBuffer.js +0 -55
  1191. package/dist/native/ingest/writeBuffer.js.map +0 -1
  1192. package/dist/native/ingest/writeEvent.js +0 -14
  1193. package/dist/native/ingest/writeEvent.js.map +0 -1
  1194. package/dist/native/query/eventAgg.js +0 -175
  1195. package/dist/native/query/eventAgg.js.map +0 -1
  1196. package/dist/native/realtime/buildRealtime.js +0 -53
  1197. package/dist/native/realtime/buildRealtime.js.map +0 -1
  1198. package/dist/native/retention/pruneTask.js +0 -69
  1199. package/dist/native/retention/pruneTask.js.map +0 -1
  1200. package/dist/native/rollupAcc.js +0 -64
  1201. package/dist/native/rollupAcc.js.map +0 -1
  1202. package/dist/native/rollups/bucketKey.js +0 -15
  1203. package/dist/native/rollups/bucketKey.js.map +0 -1
  1204. package/dist/native/rollups/bumpRollups.js +0 -116
  1205. package/dist/native/rollups/bumpRollups.js.map +0 -1
  1206. package/dist/native/rollups/deltas.js +0 -106
  1207. package/dist/native/rollups/deltas.js.map +0 -1
  1208. package/dist/native/rollups/insertManyIfNew.js +0 -93
  1209. package/dist/native/rollups/insertManyIfNew.js.map +0 -1
  1210. package/dist/plugin/paths.js +0 -29
  1211. package/dist/plugin/paths.js.map +0 -1
  1212. package/dist/react/TrackerBoot.d.ts +0 -22
  1213. package/dist/rsc/AnalyticsScripts.d.ts +0 -30
  1214. package/dist/rsc/AnalyticsScripts.js +0 -41
  1215. package/dist/rsc/AnalyticsScripts.js.map +0 -1
  1216. package/dist/surfacing/queue.js +0 -60
  1217. package/dist/surfacing/queue.js.map +0 -1
  1218. package/dist/surfacing/retryPolicy.js +0 -15
  1219. package/dist/surfacing/retryPolicy.js.map +0 -1
  1220. package/dist/tracker/autoCapture.d.ts +0 -48
  1221. package/dist/tracker/consent.d.ts +0 -24
  1222. package/dist/tracker/consent.js +0 -48
  1223. package/dist/tracker/consent.js.map +0 -1
  1224. package/dist/tracker/loadScript.d.ts +0 -14
  1225. package/dist/tracker/pageTracking.d.ts +0 -17
  1226. package/dist/tracker/registry.d.ts +0 -27
  1227. package/dist/tracker/sinks/ga4.d.ts +0 -29
  1228. package/dist/tracker/sinks/native.d.ts +0 -22
  1229. package/dist/tracker/sinks/plausible.d.ts +0 -20
  1230. package/dist/tracker/sinks/posthog.d.ts +0 -18
  1231. package/dist/tracker/sinks/umami.d.ts +0 -18
  1232. package/dist/tracker/sinks/vendor.d.ts +0 -14
  1233. package/dist/view/sections/styles.js +0 -76
  1234. package/dist/view/sections/styles.js.map +0 -1
  1235. package/dist/widgets/WidgetViewLink.js +0 -17
  1236. package/dist/widgets/WidgetViewLink.js.map +0 -1
  1237. package/dist/widgets/cardChrome.d.ts +0 -8
  1238. package/dist/widgets/cardChrome.js +0 -46
  1239. package/dist/widgets/cardChrome.js.map +0 -1
  1240. package/dist/widgets/comparison.js +0 -57
  1241. package/dist/widgets/comparison.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,468 @@
1
1
  # @10x-media/analytics
2
2
 
3
+ ## 1.0.0-beta.12
4
+
5
+ ### Minor Changes
6
+
7
+ - **Adapters: one meaning per metric, a leaner contract, and the vendor adapters brought in line.** `avgDuration` is time on page and the new `visitDuration` time per visit on every source; capabilities say which operators each dimension takes and where each metric can be read; and an adapter reaches its vendor through the plugin's lanes and releases what it holds per Payload instance ([Adapter contract](https://docs.10xmedia.de/analytics/reference/adapter-contract), [Providers](https://docs.10xmedia.de/analytics/providers)).
8
+
9
+ **Upgrade actions**
10
+
11
+ 1. A widget saved on **Time on page** against Plausible or Umami reads **Not available for this data source**: pick **Time per visit** in its drawer, and name `visitDuration` where a stat row or an `analyticsStat` named `avgDuration` for them.
12
+ 2. With sync on Postgres or SQLite in migrate mode, the generated migration adds the sync collection's `visit_duration` column.
13
+ 3. A custom adapter: declare `capabilities.filters` as the operators each filterable dimension takes, drop `filterOperators`, `perPageQuery`, `batchPageReport` and `rateLimit.quotaModel`, serve a per-visit time as `visitDuration`, declare `kind` on each `capture.proxy.routes` entry, stamp `meta.fetchedAt` with the time it read the source (`ctx.now()`), take the Payload instance first in an `ingest.track`, release per-instance resources in `close(payload)`, and implement `registerSchema` when `register` adds collections ([Writing your own adapter](https://docs.10xmedia.de/analytics/reference/adapter-contract#writing-your-own-adapter)).
14
+ 4. Code of your own that reads `capabilities` from the sources or query endpoint reads the operators per dimension from `filters`.
15
+ 5. A self-hosted PostHog whose toolbar links should open the app: pass `posthog({ uiHost })`.
16
+
17
+ **Breaking:** `avgDuration` is engaged time per pageview on every source and `visitDuration` engaged time per visit; until now a vendor's `avgDuration` was its time per visit. GA4 answers `avgDuration` as `userEngagementDuration` over `screenPageViews` (under every breakdown but `event` and `goal`) and `visitDuration` as `averageSessionDuration`; Plausible and Umami no longer declare `avgDuration`, and their per-visit time is `visitDuration` ([Time on page and time per visit](https://docs.10xmedia.de/analytics/providers#time-on-page-and-time-per-visit)).
18
+
19
+ **Breaking:** `capabilities.metricReach` says where a metric is read when not under every dimension, and the query endpoint answers `unsupported_metric` outside it. Plausible reads `scrollDepth` only by, filtered by or for one page, and `bounceRate` and `visitDuration` under every breakdown but `goal`; Umami's pageviews, visits, bounce rate and time per visit are whole-site numbers, its visitors are not read by `goal`, and its conversions only by `goal`. The view and the pickers leave out what a source cannot answer.
20
+
21
+ **Breaking:** `capabilities.filters` is a `FilterOperatorMap`, the operators each filterable dimension takes, and `filterOperators`, `perPageQuery`, `batchPageReport` and `rateLimit.quotaModel` are gone. The `capabilities` the sources and query endpoints answer follow: `filters` maps each dimension to its operators, where it was a list of dimensions beside `filterOperators`, and `filterOperators` and `perPageQuery` are gone from them ([Sources endpoint](https://docs.10xmedia.de/analytics/reference/endpoints#sources-endpoint)). `visits` and `sessions` must answer one number. A source answers series by `minute`, `hour` or `day` only: the engine folds weeks and months from days unless the source declares `calendarBuckets: true`.
22
+
23
+ **Breaking:** what an adapter throws decides the error code: a `status`, a gRPC `code` and `retryAfterMs` are read, so throw `ProviderHttpError`. `AdapterRegisterContext` gains the required `resolveTimezoneStrict` and `revenue`, which matters only to code that builds one.
24
+
25
+ **Breaking:** `ServerTrack`, the `track` of an adapter's `ingest`, takes the Payload instance first, `(payload, event, opts?)`, where it took `(event, opts?)`.
26
+
27
+ **Breaking:** `meta.fetchedAt` is when the source was read, never the range's end as the built-in adapters stamped it: stamp it from the new `AdapterContext.now`, the plugin's clock. The engine replaces a `fetchedAt` later than the moment it got the answer, or one it cannot read, with that moment, and a cached answer keeps the stamp it was stored with ([Results](https://docs.10xmedia.de/analytics/reference/adapter-contract#results)).
28
+
29
+ **Behavioral:** GA4's Data API client runs without retries of its own, since the lane retries.
30
+
31
+ **Behavioral:** PostHog captures each single-page app navigation (`capture_pageview: 'history_change'`), so its pageview totals rise. A self-hosted `host` takes capture itself, through its capture paths alone, instead of PostHog Cloud's US region, `region` is ignored for it, and the snippet names no `ui_host` unless `uiHost` is set. With `scopeProperty` set, the snippet registers the request's scope as a super-property, so every event the SDK sends carries its tenant.
32
+
33
+ **Behavioral:** a tenant capture slot filled by the same vendor as the global slot (a tenant's own PostHog beside the platform's) is left out of the tracker config with a warning, where it used to init onto the platform's SDK and send into the platform's project.
34
+
35
+ **Behavioral:** a read naming `visits` from a source that serves only `sessions`, as native does, or the other way round, is answered from the one it serves under the name it asked for: at the query endpoint, where it answered `400 unsupported_metric`, in the widgets and in the document panel.
36
+
37
+ **Behavioral:** a vendor's average with no value reads `null`, not `0`. The sync collection gains `visitDuration`, writes a metric a source did not report as `null`, and its first run after the upgrade moves each GA4, Plausible and Umami row's stored `avgDuration` there once ([Sync](https://docs.10xmedia.de/analytics/sync#time-per-visit-moved-to-visitduration)).
38
+
39
+ **Additive:** `visitDuration`; `AnalyticsRow.samples`, the weights a row's averages carry; `metricReach` (`MetricReach`), `semantics`, `filterLookbackDays`, `calendarBuckets`, `perItemQuery` and `upstreamAware` on the capabilities; `ctx.upstream`, `ctx.remainingMs` and `ctx.payload` for sending each vendor request through its lane ([Requests to the vendor](https://docs.10xmedia.de/analytics/reference/adapter-contract#requests-to-the-vendor)); the optional `attach`, `close(payload)` and `registerSchema`, `close` running once per Payload instance an adapter was attached to and on `payload.destroy()`, and for an adapter built from a provider document once the document changes, goes away or sits unused; `AdapterContext.now`; `recommendedTtl.today`, which caps an answer reaching into the current day whatever `cache.ttl` says, for a source cheap to read again; `ga4({ currency })`, whose invalid code throws when the adapter is built, `posthog({ uiHost })` and `Ga4ClientOptions`; the types `sdks` takes, `Ga4Sdk`, `Ga4Client`, `Ga4ReportResponse` and `Ga4ReportRow` (the last three `@beta`), `MaxmindSdk` and `MaxmindReader`, typed by shape, so the real packages fit them and the package's own declarations import neither `@google-analytics/data` nor `maxmind`: an app without them type-checks with `skipLibCheck` off; provider documents of type **Payload** (`native`), with GA4 currency and PostHog scope property fields; `analyticsProviderFields()`, `adapterFromProviderDoc` and `SECRET_PATHS` (`@beta`) for keeping provider settings in a document of your own; `providers.collection.fields`.
40
+
41
+ - **Admin UI: one stylesheet, Payload's own components, accessible tables, right-to-left layouts and one meaning per label.** The view, the widgets and the Analytics tab share one stylesheet in Payload's CSS layer and Payload's own date picker, pills and loading shimmer; every list is a real table; charts mirror in right-to-left languages; and every editor-facing string reads in plain words in all 11 languages ([Customizing](https://docs.10xmedia.de/analytics/customizing), [Translations](https://docs.10xmedia.de/analytics/reference/translations)).
42
+
43
+ **Upgrade actions**
44
+
45
+ 1. Regenerate the import map (`pnpm payload generate:importmap`).
46
+ 2. Move admin CSS that targeted a removed class to its replacement (below). A rule that had to outrank an inline style no longer needs `!important`, and unlayered admin CSS now wins over the plugin's.
47
+ 3. Move translation overrides of removed keys to their replacements, since an override of a removed key now fails the boot, and keep the placeholders the changed strings take.
48
+ 4. A host collection grouped under the string `'Analytics'` beside the plugin's collections moves to their group, **Analytics settings**: build its `admin.group` from each language's `adminGroup` string in `translations` from `@10x-media/analytics/i18n`.
49
+ 5. Custom widgets, views and fields: read `BreakdownRow.dimensionValue` for the stored value, handle `null` metric values, pass `RealtimeCounter` its `label` and `timezone` and `TrendPoint` its `at`, and handle the new statuses in a `switch` over them.
50
+
51
+ **Breaking:** the admin reads one stylesheet in Payload's `payload` CSS layer instead of inline styles and injected `<style>` tags. Removed classes: `.analytics-view__table` (now `.analytics-table`), `__bars-head` and `__bars-head-dimension` (the table's own header row), `__scroll` (`.analytics-table__scroll`), `__sort`, `__sort--metric` and `__sort--secondary` (`.analytics-table__sort`), `__value` (`.analytics-table__value`) and `__date` (the range picker). A `BarList` is a `<table>` with only each row's label a button, a `TrendChart` carries a hidden data table and draws in a fixed `viewBox`, the breakdown's tab and panel ids are generated, the plugin's selects carry no `#field-analytics-*` ids, a widget card's title is an `h2`, and a missing value is a dash with a hidden "no value" beside it ([Admin styles](https://docs.10xmedia.de/analytics/upgrading/beta-12#admin-styles)).
52
+
53
+ **Breaking:** the custom range is Payload's `DatePicker`, written once both days are picked; `DateRangeField` stores UTC midnight of each picked day, and the view's and the widgets' ranges stop at today.
54
+
55
+ **Breaking:** translation keys removed: `viewFrom`, `viewTo`, `viewSortAscending`, `viewSortDescending`, `widgetRealtimeCaption` (now the counted `pluralKeys.liveVisitors` and `livePageviews`), and `goalFieldValue`, `goalFieldValueFixed`, `goalFieldValueProp` and `goalFieldValuePropHelp` (now `goalFieldAmount`, `goalFieldAmountHelp`, `goalFieldAmountProp`, `goalFieldAmountPropHelp` and `goalErrorCurrencyRequired`). `viewErrorRetryAfter` takes `{{duration}}` and `viewFilterRemove` takes `{{filter}}`. `TranslationKey` is `SingularKey | PluralVariant`. A `translations` override of a removed key fails the boot, naming it, where it used to be ignored ([Translations](https://docs.10xmedia.de/analytics/reference/translations)).
56
+
57
+ **Breaking:** labels renamed in every language: **Last 12 months** (was "Last year"), **Time on page** (was "Avg. time") and **Visits** (was "Sessions"). `visits` and `sessions` are one count: a source serving both keeps `sessions`, and `?metric=visits` is rewritten to it. A visitors total that adds up each day's visitors (`meta.visitorsAre: 'sumOfDaily'`, native over more than one day) reads **Visitors, counted per day**. `viewNavLabel`, `viewTitle` and `tabAnalytics` read in the admin's language. The goals, providers and sync collections sit in a nav group of their own, **Analytics settings** (the `adminGroup` key, a map by language), where 1.0.0-beta.11 grouped them under the string `'Analytics'`, so the nav names the view's **Analytics** link once.
58
+
59
+ **Breaking:** a metric value is `number | null`, where `null` means no data: `AnalyticsRow.metrics`, `AnalyticsResult.totals`, `BreakdownRow.value`, `SeriesPoint.value`, `WidgetSeriesResult.total` and `previousTotal`, and `TrendPoint.value` are `MetricValue`s. An average with nothing to average over reads as a dash with no delta, ranks last and breaks a trend line, where it read `0`.
60
+
61
+ **Breaking:** `BreakdownRow.label` is the display label, `''` for no value (was `'(none)'`), and the stored value is the new `dimensionValue`. `RealtimeCounter` requires `label` and `timezone` and takes an optional `caption`; `TrendPoint.at` is required. `WidgetReadStatus`, `WidgetRealtimeStatus` and `FieldReadStatus` gain `busy`, `invalid`, `no-access`, `no-scope`, `misconfigured` and `host-refused`, `WidgetReadStatus` and `FieldReadStatus` also `range-too-long`, and `readForWidgetRealtime` no longer throws. `AnalyticsViewClientProps` takes `endpoints` in place of `apiRoute` and a required `countryFlags`, and `AnalyticsViewProps` loses `pluginOptions`: the view reads the options the plugin resolved.
62
+
63
+ **Breaking:** `readForWidgetSeries` and the trend surfaces read by week past 31 days and by month past 120. The built-in widgets' default exports, and `AnalyticsStatField` and `AnalyticsPanelField` from `/rsc`, are synchronous components that suspend, where they were async functions, so code awaiting one as a function gets a Suspense element; the two fields are `@internal`, exported for the import map alone. Admin requests send `credentials: 'same-origin'` (were `'include'`).
64
+
65
+ **Behavioral:** a read that fails for a while (a timeout, a rate limit, a source down) reports `busy`, **The analytics tool is busy right now.** with a **Try again** control, as the view words it, where it read **Not available for this data source**; `unavailable` is left for a source that cannot answer the read at all. The Analytics tab keeps the headline numbers that arrived when a comparison, a series or a breakdown fails, and says the panel is incomplete with a retry. A widget whose saved custom range names a day before 1970, or no real day, reports `invalid` where it read the last 30 days.
66
+
67
+ **Behavioral:** no widget or field holds the page on a source. Every built-in widget renders its card at once behind its own Suspense boundary, a stat field past two seconds says **Still loading. Reload the page in a moment to see the numbers.**, and the Analytics tab reads nothing while the document renders: it starts from what the cache holds and reads when the tab opens.
68
+
69
+ **Behavioral:** **New** is shown only for a document with no path, or one created inside the date range; an older document with nothing counted shows zeros and **No visits in this date range.** Every surface says what a read says about its numbers: days still being counted, days that could not be counted, rare values grouped, where the data starts or ends when the range reaches past it, times in UTC because the zone could not be found, goals the source could not load (the trend widget included), and when the numbers were last updated.
70
+
71
+ **Behavioral:** dashboard cards fill their row, with the window on the title's line and the **Open in Analytics** link pinned to the bottom; a bucket still counting is drawn dashed and labelled "so far"; the overview shows at most five card columns; filter chips read as words (**Country is Germany**); value labels carry country flags. The realtime card reads its minutes in the reporting timezone, names the zone on its last time label and in every tooltip, and draws three labels, so they no longer overlap on a narrow card.
72
+
73
+ **Behavioral:** breakdowns, goals and widget lists are tables with sortable headers, charts carry a data table for screen readers, live counts are announced at most once a minute, deltas are Payload pills, and in a right-to-left language the layout, the chart axes and the arrow keys mirror. Each view step is a browser history entry written without a server round trip.
74
+
75
+ **Behavioral:** editor-facing labels, descriptions and hints in all 11 languages are rewritten for a non-technical reader: the native source is called **Payload**, a goal's slug is its **Short code**, goals are listed as **Built-in goals** and **Your goals**, and a goal's amount and currency are one control. No stored value changed. Plausible's **Website address** and **Script ID** fields each have help of their own, and a provider's write-only key field keeps its help text in every language. Languages the plugin ships no strings for read English, label maps fall back to Payload's `fallbackLanguage` first, `pt` is Brazilian Portuguese and counted phrases follow each language's plural rules.
76
+
77
+ **Additive:** `view.Component`, `countryFlags` (`false`, or `{ Component }` for flags of your own, with the flag route `GET /api/_x/flags/:code` mounted for `true`) and `widgets.overrides` ([Customizing](https://docs.10xmedia.de/analytics/customizing)); the `WidgetCard` family, `WidgetSuspense` and `WidgetShimmer` from `/rsc` and the view's building blocks from `/client`, all `@beta`; `FilterValueField`, offering a filter the dimension's top values; `analyticsTab({ breakdowns, liveVisitors, sources, report })`; the document endpoint's `fresh=1`; `TrendPoint.inProgress` and `TrendPoint.upcoming` (the rest of today, drawn as an empty axis); `FieldReadResult.incomplete` and `retryAfterMs`; `TrendChart`'s `maxTicks` (`@beta`), the most time labels it draws; the translation keys `adminGroup`, `stateRangeTooLong`, `stateFailed`, `stateClampedFrom`, `stateClampedTo`, `stateClampedBetween`, `statePartsFailed`, `providerErrorScriptId`, `providerFieldDomainHelp` and `providerFieldScriptIdHelp`; `pluralKeys`; `BuiltInWidgetSlug`; `AnalyticsComponent`; `QueryFetchError.code`; `WidgetView` and `WidgetViewProps`.
78
+
79
+ - **Consent: the site's consent manager drives a gate, and the plugin stores no decision.** Whether an install needs consent, and for which tracking, is the site's call, so the plugin has no default and no stored state: `capture.gate` says which capture slots wait, and the consent manager opens or closes them with `setGate` on every page load ([Consent](https://docs.10xmedia.de/analytics/consent), with a c15t recipe and a generic one).
80
+
81
+ **Upgrade actions**
82
+
83
+ 1. Set `capture.gate`: `'all'` holds every slot until the manager answers, `'off'` captures without waiting, a list names the slots that wait, and a function `({ slot, adapterId, kind }) => boolean` decides per slot. `({ kind }) => kind !== 'native'` reproduces what 1.0.0-beta.11 did by default.
84
+ 2. Replace `tracker.consent('granted')` and `consent('denied')` from `useAnalytics()` with `setGate(true)` and `setGate(false)` (`setGate({ tenant: true })` for one slot), called from your consent manager's bridge on every page load, and again on a `pageshow` event whose `persisted` is true.
85
+ 3. Remove `persistConsent`, and the imports of `CONSENT_STORAGE_KEY`, `CONSENT_QUEUE_LIMIT`, `ConsentState`, `createConsentQueue`, `readConsent` and `writeConsent` from `/tracker`, and of `CaptureConsentOption`, `ConsentMode` and `ConsentResolver` from the package root (`CaptureGate` types the new option).
86
+ 4. Import `AnalyticsScripts` and `getTrackerConfig` from `@10x-media/analytics/site`, and replace `TrackerBoot` with `<AnalyticsScripts />` or `<AnalyticsProvider>`.
87
+ 5. A consent manager that injects the vendor scripts itself: pass `snippets={false}` and let it load each slot's `snippet.scripts`.
88
+ 6. A Content Security Policy that allows the vendor snippets by hash needs the new hashes: the snippets changed with the gate and the exclusion prelude.
89
+ 7. Where `capture.gate` holds native, server code that knows the visitor's answer passes `identity: 'request'` to `trackServerEvent`, `purchase`, `refund` or `trackGoalAction` ([What the gate does not cover](https://docs.10xmedia.de/analytics/consent#what-the-gate-does-not-cover)).
90
+
91
+ **Breaking:** `capture.gate` is required whenever a capture slot can fill, the native one included, and the boot stops without it, naming the choices.
92
+
93
+ **Breaking:** no consent decision is stored. The tracker never reads the `analytics:consent` key 1.0.0-beta.11 wrote, and deletes it once a slot opens, so a returning visitor is pending until the manager answers again.
94
+
95
+ **Breaking:** `Tracker.consent` and `useAnalytics().consent` are replaced by `setGate(state)` and the read-only `gate`: both are required members of `Tracker`, `setGate` of `AnalyticsCommands` and `gate` of `AnalyticsApi`. Code that implements `Tracker` itself, such as a test double, adds them. `TrackerOptions.persistConsent` is removed.
96
+
97
+ **Breaking:** `TrackerSlotConfig.requiresConsent` is `gated`, now required. A tracker config a browser cached from 1.0.0-beta.11 is still read, and a slot carrying neither field is held.
98
+
99
+ **Behavioral:** while a slot is pending its events wait in a queue of 100 (engagement only for a native slot); a decision before the tracker exists is applied when it boots. Closing a slot drops its queue, stops delivery and, where the vendor's script may have run, sets its own opt-out (Plausible's and Umami's keys, PostHog's `opt_out_capturing()`, GA4's disable flag and a consent mode update denying all four storage types). Opening one clears that opt-out unless the browser is excluded, injects the slot's snippet and sends what waited. A slot the config does not fill reads `closed` and ignores answers.
100
+
101
+ **Behavioral:** nothing reads or writes the browser's storage before a slot opens: the exclusion flag is read, and the old consent key deleted, when the first slot opens, so `excluded` reads `false` until then. Before any answer only these touch it: the signed exclusion link a staff member opens and the `=0` link (which removes the flag when set), the GA4 snippet of a slot that does not wait (it reads the exclusion flag), and the vendors' opt-out switches a refusal sets under `snippets: false`.
102
+
103
+ **Behavioral:** a page restored from the back/forward cache puts its held slots back to pending rather than keeping the answer it had, which the visitor may have revoked in another tab since; the manager answers again from its `pageshow` handler.
104
+
105
+ **Behavioral:** server tracking (`trackServerEvent`, the server `purchase` and `refund`, and `trackGoalAction`) records an event as no visitor's by default while `capture.gate` holds a slot native may fill: no visitor id, and no location, device or language read from the request. With `gate: 'off'` it keeps the request's visitor, and `identity: 'request'` or `'none'` decides per call. An `ip` or `userAgent` passed without an `identity` and set aside by that default is logged once.
106
+
107
+ **Behavioral:** on the server, a slot that does not wait renders its vendor snippet with the page and a slot that waits renders nothing until it opens; its snippet travels as data in the tracker config. A server that knows the decision passes `gate`, as in `<AnalyticsScripts config={tracker} gate={{ tenant: true }} />` ([Server render](https://docs.10xmedia.de/analytics/consent#server-render)).
108
+
109
+ **Behavioral:** PostHog's snippet initialises with `opt_out_persistence_by_default`, so its opt-out also deletes its own storage, and lifting the opt-out sends no `$opt_in`.
110
+
111
+ **Additive:** `setGate`, `gate`, `GateState`, `GateStatus`, `CaptureGate` and `CaptureGateArgs`; `gate` and `snippets` on `<AnalyticsScripts />`, `<AnalyticsProvider>` and `createTracker`; the beacon's `ageMs`, the time an event waited in the browser (at most a day), which ingest subtracts so a held event is filed when it happened rather than when its slot opened. `loadScript` stays on `<AnalyticsProvider>` and `createTracker` for a framework's script loader.
112
+
113
+ - **Entry points: a `/site` entry, a smaller `/tracker`, one stylesheet and release tags on every export.** Each entry now exports what its environment uses and nothing it should not load: a site's server components import `/site`, a page's browser code `/tracker`, `/attributes` and `/react`, and the admin `/rsc` and `/client` ([Entry points](https://docs.10xmedia.de/analytics/reference/entry-points)).
114
+
115
+ **Upgrade actions**
116
+
117
+ 1. Move the imports the table below names.
118
+ 2. Regenerate the import map (`pnpm payload generate:importmap`).
119
+ 3. Where your bundler does not follow CSS imports, or a `BarList` or `TrendChart` renders outside the admin, import `@10x-media/analytics/styles.css`.
120
+
121
+ **Breaking:** exports removed since 1.0.0-beta.11, and what replaces them:
122
+
123
+ | Entry | Removed | Use instead |
124
+ | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- |
125
+ | `/rsc` | `AnalyticsScripts`, `AnalyticsScriptsProps`, `getTrackerConfig` | the same from `/site` |
126
+ | `/rsc` | `TrackerConfig`, `TrackerSlotConfig` | the same types from `/site`, `/tracker` or `/types` |
127
+ | `/rsc` | `widgetCardStyle`, `widgetLabelStyle` | `WidgetCard`, or the `analytics-card analytics-widget` classes |
128
+ | `/react` | `TrackerBoot`, `TrackerBootProps` | `<AnalyticsScripts />` or `<AnalyticsProvider>` |
129
+ | `/tracker` | `GOAL_ATTRIBUTE`, `OUTBOUND_EVENT`, `DOWNLOAD_EVENT`, `SCROLL_EVENT` | the same from `/attributes` |
130
+ | `/tracker` | `readExclusion`, `writeExclusion`, `subscribeExclusion`, `readExclusionParam` | `tracker.excluded` and `tracker.exclude()`, or `excluded` and `setExcluded` from `useAnalytics()` |
131
+ | `/tracker` | `CONSENT_QUEUE_LIMIT`, `CONSENT_STORAGE_KEY`, `ConsentState`, `createConsentQueue`, `readConsent`, `writeConsent` | `setGate`, `GateState` and `GateStatus` |
132
+ | `/tracker` | `createNoopTracker`, `createAutoCapture`, `AutoCapture`, `AutoCaptureHandlers`, `createPageTracking`, `PageTracking`, `createScriptLoader`, `acquireTracker`, `TrackerLease`, `PAGEVIEW_BUFFER_MS` | `initTracker`, `createTracker` and the components |
133
+ | `/tracker` | `createNativeSink`, `createGa4Sink`, `Ga4SinkArgs`, `GA4_DISABLE_PREFIX`, `createPlausibleSink`, `PLAUSIBLE_IGNORE_KEY`, `createPosthogSink`, `createUmamiSink`, `UMAMI_DISABLED_KEY`, `VendorSinkArgs`, `Sink`, `TrackerEvent` | nothing: the tracker builds its own sinks |
134
+ | root | `CaptureConsentOption`, `ConsentMode`, `ConsentResolver` | `CaptureGate` |
135
+ | root | `PlatformReadAccess`, `ScopesResolver` | `CrossScopeAccess`, `ScopeListResolver` |
136
+
137
+ **Breaking:** the package declares `"sideEffects": ["*.css"]`, where it declared `false`: every admin module imports the plugin's one stylesheet, which the package also exports as `@10x-media/analytics/styles.css`.
138
+
139
+ **Breaking:** the widget drawer's pickers and the `goalField()` picker are registered at new server component paths (`@10x-media/analytics/rsc#SourceSelectFieldServer` and its siblings), which read the scope on the server. The five paths 1.0.0-beta.11 registered stay exported, marked `@deprecated` with the server path that replaces each, so an import map generated before the upgrade still renders them, keyed by the scope the page's cookies select; the widget filter's value field and the goal amount control are new paths and render nothing until the import map is regenerated ([Component paths](https://docs.10xmedia.de/analytics/reference/stability#component-paths)).
140
+
141
+ **Behavioral:** the package depends on `undici` and `ipaddr.js` for the guarded provider fetch, and on `country-flag-icons` for the flag route.
142
+
143
+ **Behavioral:** every export carries a release tag. An untagged export is stable; `@beta` (the dashboard widgets and the `widgets` option, the `WidgetCard` family, `BarList`, `TrendChart`, `RealtimeCounter`, the widget drawer's pickers, the view's building blocks with `view.Component`, the flag seams, the toolkit for building adapters in `providers.resolve`, `SYSTEM`, `ReadPrincipal` and `GatedScope`, the wire shapes `WireGoal`, `GoalsResponse`, `RawEventInput` and `HitType`, and the GA4 structural types) may change in a minor release; `@internal` is exported for Payload's import map alone; `@deprecated` still works and names its replacement. The component paths the plugin registers are frozen for the 1.x line ([Stability](https://docs.10xmedia.de/analytics/reference/stability)). Of the exports 1.0.0-beta.11 shipped untagged, these are now `@internal`: `AnalyticsView`, `AnalyticsViewProps`, `AnalyticsStatField` and `AnalyticsPanelField` from `/rsc`, and `AnalyticsNavLink`, `AnalyticsNavLinkProps` and `DateRangeField` from `/client`. These are now `@beta`: the built-in widget components, `analyticsDefaultWidgets`, `widgetFilters`, `CustomWidgetDef` and `WidgetFilter`; `BarList`, `TrendChart`, `TrendPoint` and `RealtimeCounter`; `AnalyticsViewClient`, `AnalyticsViewClientProps` and `ViewGoal`; the widget drawer's pickers and their props, `useAnalyticsSources`, `useFilterCapabilities`, `useAnalyticsGoals`, `AnalyticsSources`, `FilterCapabilities`, `WireGoal` and `GoalsResponse`.
144
+
145
+ **Additive:** the `/site`, `/attributes`, `/migrations` and `/migrations/drop-legacy-mongo` entries and `./styles.css`; the adapter contract types from every adapter entry, `/next` and `/testing`; the view's `@beta` building blocks from `/client` ([Customizing](https://docs.10xmedia.de/analytics/customizing)); `settleAnalytics(payload)` from `/testing`, which waits for the plugin's background work (cache writes, the native engine's upkeep, a write buffer it flushes) before a test reads back or destroys Payload ([Testing](https://docs.10xmedia.de/analytics/reference/adapter-contract#waiting-for-background-work)). Each entry's public surface is recorded in an API report that CI compares on every change, so nothing public changes without a reviewed diff.
146
+
147
+ - **Content items, engagement and what the tracker counts.** An offer, a banner or a product card can have analytics of its own; time on page and scroll depth are measured for the whole visit rather than its first seconds; and the tracker leaves out what is not a visit ([Content items](https://docs.10xmedia.de/analytics/items), [Time on page and scroll depth](https://docs.10xmedia.de/analytics/native#time-on-page-and-scroll-depth)).
148
+
149
+ **Upgrade actions**
150
+
151
+ 1. Code with an exhaustive `Record` or `switch` over `MetricKey` or `DimensionKey` adds `impressions`, `interactions` and `visitDuration`, and `currency` and `item`. Both unions may grow again in a minor release.
152
+ 2. Code that implements `Tracker` itself accepts the third argument of `track` (and adds `purchase`, `refund`, `setGate` and `gate`, which the revenue and consent entries describe).
153
+ 3. An end-to-end suite that asserts on captured hits from an automated browser sets `capture.skip: { automation: false }`.
154
+ 4. To use items: bind a collection with `collections: { offers: { item: true } }`, mark the element that renders a document with `itemAttributesFor(payload, { collection, id, name })` or a ref from `signItemRef`, and regenerate the import map.
155
+
156
+ **Breaking:** `MetricKey` gains `impressions`, `interactions` and `visitDuration`, and `DIMENSION_KEYS` gains `currency` and `item`. `ResolvedAutoCapture` gains a required `items`, `AnalyticsBinding` an optional `item`, and `Tracker['track']` an optional third argument, `{ item }`.
157
+
158
+ **Behavioral:** the tracker sends a pageview the moment a page is tracked instead of holding it for up to ten seconds, so time on page and scroll depth are no longer capped at that moment. What the visitor does afterwards follows as an `engagement` message when the tab is hidden, the page is left or a single-page app moves on: the visible time (at most 30 minutes per message) and the extra scroll since the previous one. It is never counted as a pageview, event, visit or visitor, never reaches a vendor slot, and is filed on its pageview's day. Ingest drops a `durationMs` or `scrollDepth` sent on an event or a goal. **Active right now** reacts faster, since a visit counts from its first moment.
159
+
160
+ **Behavioral:** a page the browser only prerenders sends nothing and loads no vendor script until it is shown, then one pageview for wherever it is.
161
+
162
+ **Behavioral:** a form carrying `data-analytics-goal` or `data-analytics-event` counts its submit alone, once per submission: a click inside it no longer completes the goal, and an element tagged around a form no longer counts again on the form's submit ([Tag the element](https://docs.10xmedia.de/analytics/goals#1-tag-the-element)).
163
+
164
+ **Behavioral:** browsers reporting `navigator.webdriver`, Next draft mode pages and Payload's live preview are not counted; `capture.skip: { automation: false, previews: false }` counts them ([Pages that are not counted](https://docs.10xmedia.de/analytics/capture#pages-that-are-not-counted)).
165
+
166
+ **Behavioral:** `initTracker()` resolves the window's one tracker, shared with `AnalyticsScripts`, `AnalyticsProvider` and `useAnalytics`, and its `destroy` gives its hold back. A destroyed tracker stays quiet even when another library wrapped the history API over it.
167
+
168
+ **Additive:** content items. `collections.<slug>.item` binds a collection's documents as items; the tracker counts an item seen once at least half of it stays on screen for a second in a tab in front, sends `item_click` for the first click inside one per pageview, and credits a goal or event fired inside it. Refs a page sends carry the server's signature unless `native({ items: { signature: 'optional' } })`. `track(name, props, { item })`, `trackGoal(slug, { item })`, `purchase({ item })` and `item` on the server calls file an event under an item. `capture.autoCapture.items` turns any part off. The Analytics tab of an item reads **Views**, **Viewers**, **Clicks**, **Click rate**, **Conversions** and the pages it was seen on (`report: 'auto' | 'item' | 'page'` on `analyticsTab` and the stat fields), leaving out a list the source cannot rank, the analytics view gains a **Content** tab, and the query endpoint takes `item=<ref>` on a source declaring `capabilities.perItemQuery`. Vendors receive `item_click` (GA4 as `select_promotion`) and an item's id and name on goals and events.
169
+
170
+ **Additive:** the dependency-free `@10x-media/analytics/attributes` entry: `goalAttributes()`, `eventAttributes()`, `itemAttributes()`, `itemRef()`, the attribute names and the event names, for marking up a link, a Lexical converter or a shared component without loading Payload. Auto-capture reads `data-analytics-event` and `data-analytics-prop-*` beside the goal attributes, and `analyticsLinkFields()` adds a goal picker to any link field ([Integrations](https://docs.10xmedia.de/analytics/integrations)).
171
+
172
+ - **Jobs, the read cache and reaching the sources.** The plugin's background work runs as Payload jobs under leases, reads are cached in a collection of their own, and every vendor source is reached through its own lane with retries and a circuit breaker, so one slow or failing source no longer holds up the others ([Caching](https://docs.10xmedia.de/analytics/cache), [Maintenance](https://docs.10xmedia.de/analytics/native#maintenance)).
173
+
174
+ **Upgrade actions**
175
+
176
+ 1. Run Payload's job runner for the plugin's tasks, and let your scheduler call `/api/payload-jobs/run` through `jobs.access.run` ([Who may run jobs](https://docs.10xmedia.de/analytics/native#who-may-run-jobs)). `jobs: false` registers no task.
177
+ 2. Move `sync.cron` to `jobs.tasks.sync.cron` and `cache.warm.cron` to `jobs.tasks.warm.cron`.
178
+ 3. Where `payload_jobs` exists (1.0.0-beta.11 registered sync, warming or native retention), delete the queued runs of `analytics-prune-events` and `analytics-warm-cache` in the upgrade's migration, on Postgres before the task enum changes, with the statement the [upgrade page](https://docs.10xmedia.de/analytics/upgrading/beta-12#edits-before-you-run-it) gives; on MongoDB the predefined `drop-legacy-mongo` migration does it, so an install that ran warming without `native()` runs that migration too.
179
+ 4. If a second auth collection queues or cancels your own jobs with `overrideAccess: false`, set `jobs.access` to allow it.
180
+ 5. Remove the old cached reads from Payload's key-value store with `deleteLegacyCache({ payload })` from `@10x-media/analytics/migrations`; on MongoDB `dropLegacyNative` already does.
181
+ 6. An install that keeps provider settings in a store of its own (`providers.resolve`) calls `refreshProviders()` when they change.
182
+ 7. Code with an exhaustive `switch` over `AnalyticsErrorCode` or `QueryErrorCode` adds `rate_limited` and `source_misconfigured`.
183
+
184
+ **Breaking:** once the plugin registers a task, every job control your Payload config left unset admits only users of the admin collection: `jobs.access.run` (the `/run` and `/handle-schedules` endpoints), `jobs.access.queue`, `jobs.access.cancel`, the `payload-jobs` collection (composed over your `jobsCollectionOverrides`) and the `payload-jobs-stats` global. A control you set is never changed, and the boot says once which ones it restricted.
185
+
186
+ **Breaking:** the warm task is `analytics-warm`, no longer `analytics-warm-cache`, and it and `analytics-sync` follow `jobs.queue` and their own `jobs.tasks` entries. Warming replays the reads readers made recently, per scope, rather than the dashboard's default layout, and `cache.warm` takes `{ windowHours, maxReads }`. `jobs: false` refuses sync and warming at boot.
187
+
188
+ **Breaking:** reads are cached in the `analytics-cache` collection, or a `cache.store` of your own, instead of Payload's key-value store, and expired entries are deleted; live counts are kept in each instance's memory only. Cache keys changed, so every read reaches its source once after the upgrade.
189
+
190
+ **Breaking:** each vendor source has its own lane: 16 requests in flight across an instance's vendor sources and 4 per source by default (`cache.concurrency`), with retries, `Retry-After` capped at ten minutes and a circuit breaker. `rateLimit.maxConcurrent` is the size of a source's lane. A scope with too many reads waiting on their sources answers `429 rate_limited` with `Retry-After: 2` ([Reaching the sources](https://docs.10xmedia.de/analytics/cache#reaching-the-sources)).
191
+
192
+ **Breaking:** read errors carry what to do about them. A read the vendor refuses as asked (HTTP 400, 413, 414, 422, 431, gRPC invalid argument) answers `400 invalid_param` with `param: 'query'`, where it answered `503`; a refused key or property (HTTP 401, 403, 404), a credential that will not decrypt, or a provider host the install does not allow answers the new `502 source_misconfigured` with `param: 'source'` or `'host'`; the live endpoint answers `400` and `502` in the same cases. A native read the database refuses as written answers `400 invalid_param` too, a missing table, column or privilege `502 source_misconfigured`, and a statement timeout counts as a timeout. `AnalyticsErrorCode` gains `rate_limited` and `source_misconfigured` ([The codes](https://docs.10xmedia.de/analytics/reference/endpoints#the-codes)).
193
+
194
+ **Behavioral:** an expired entry is answered at once while it refreshes in the background (`meta.stale`), `meta.sourceError` says when the refresh failed because of how the source is set up, and `cache.timeoutMs` bounds only reads with nothing cached. `order` and `limit` are applied by the engine before an answer is cached, whatever the source sent, and a breakdown with a `limit` and no `order` is ranked by its first metric, highest first.
195
+
196
+ **Behavioral:** native reads have a lane of their own, outside `cache.concurrency`: 8 reads at once, or on Postgres a third of the host pool's `pool.max`, between 1 and 8. On a source every tenant shares (native, or a config adapter read per tenant), one tenant holds at most half of the lane, and the circuit breaker counts failures per tenant, so one tenant's failing reads do not stop the others'. A read SQLite refuses before it runs answers `503` and does not count toward the breaker.
197
+
198
+ **Behavioral:** each task runs at most four minutes per run and leaves the rest to the next one, under one lease per task in `analytics-state`, so two workers never do the same work. A killed run's lease lets the next run in within two minutes for sync and warming. On Cloudflare D1, where the plugin runs no SQL of its own, sync and warming hold their leases through Payload's database API one two-minute slot at a time, so a killed run frees its lease within four. An install with sync or warming but no `native()` gains the `analytics-state` collection for them, renamed through `jobs.state`.
199
+
200
+ **Behavioral:** sync reads as the system rather than a user, writes a metric the source did not report as `null`, and is not passed through `hooks.afterRead`, since it stores the source's own numbers.
201
+
202
+ **Behavioral:** the sources, goals, tracker config and ingest endpoints answer an unexpected failure with `500 internal` in the error envelope, where Payload answered with its own error, and log it (ingest at most once a minute); an `access.read` that throws is such a failure, and the refresh endpoint answers one with `500 internal` too, where it answered `503`. The capture proxy answers a bare `500` ([Which endpoint answers which](https://docs.10xmedia.de/analytics/reference/endpoints#which-endpoint-answers-which)).
203
+
204
+ **Behavioral:** on a local SQLite file, the read cache's writes and its sweep of expired entries queue behind the native engine's writes and are skipped while the host holds a transaction open in the same process, rather than waiting on the process's own lock until they fail; a skipped write only means the next read asks the source again ([Transactions on SQLite](https://docs.10xmedia.de/analytics/native#transactions-on-sqlite)).
205
+
206
+ **Behavioral:** what time it is comes from Payload's clock (`getCurrentDate`) for every day cut, lease and cache stamp on the server, so a test that sets that clock moves them together, and every duration, timeout, budget and rate limit runs on a monotonic clock that a jump of the wall clock does not stretch or cut. The boot's warnings (the job controls it restricted, spoofable addresses, packages loaded by name, a SQLite adapter's `transactionOptions`) wait for the server that serves requests: none prints while `next build` collects page data.
207
+
208
+ **Additive:** the `jobs` option (`queue`, and `queue` and `cron` per task, `false` to register none); `cache.store` (`CacheStore`), `cache.collection` and `cache.concurrency`; `hooks.afterRead` for observing or reshaping each read ([Observing reads](https://docs.10xmedia.de/analytics/cache#observing-reads)); `refreshProviders`; `ProviderHttpError` and `parseRetryAfter`; `TASK_NAMES`, `AnalyticsTaskName`, `ScheduledTask`, `AdapterJobs`; `CACHE_SLUG`, `STATE_SLUG` and `SYNC_SLUG`; `sync.collection.overrides`.
209
+
210
+ - **Native engine: raw hits counted into daily totals, with real visits, on MongoDB, Postgres and SQLite.** The engine stores one row per hit, counts each closed day into exact daily totals per scope, hostname and value, and answers a read from the totals of closed days and the raw hits of today, of hours and of filtered reads. Visits are counted from the hits, so bounce rate and time per visit are real ([Native engine](https://docs.10xmedia.de/analytics/native)).
211
+
212
+ **Upgrade actions**
213
+
214
+ 1. Export `analytics-events` and `analytics-rollups` first if you want to keep their numbers: the old storage is not converted.
215
+ 2. On a development database Payload pushes its schema to, before the first boot: on Postgres run `DELETE FROM payload_jobs WHERE task_slug::text IN ('analytics-prune-events', 'analytics-warm-cache');` when `payload_jobs` exists, then `DROP TABLE analytics_events, analytics_rollups, analytics_seen CASCADE;` and `DROP TYPE enum_analytics_events_type;`, and the push does the rest; start a pushed SQLite file again from a new one ([Push mode](https://docs.10xmedia.de/analytics/upgrading/beta-12#push-mode)).
216
+ 3. Run the migration for your database ([Storage and the database](https://docs.10xmedia.de/analytics/upgrading/beta-12#storage-and-the-database)):
217
+ - **MongoDB:** `pnpm payload migrate:create analytics_storage --file @10x-media/analytics/migrations/drop-legacy-mongo`, then `pnpm payload migrate`. It drops the old collections and deletes the old salts, the old cached reads and the queued runs of the retired tasks.
218
+ - **Postgres in migrate mode:** generate it with `pnpm payload migrate:create analytics_storage`, answering **create table** and **create enum** at every prompt, then edit it:
219
+ - add `IF EXISTS` to the three `DROP CONSTRAINT` statements on `payload_locked_documents_rels`;
220
+ - when `payload_jobs` exists, which it does once 1.0.0-beta.11 registered any task (sync, warming or native retention), make `DELETE FROM "payload_jobs" WHERE "task_slug"::text IN ('analytics-prune-events', 'analytics-warm-cache');` the first statement of its `db.execute` block: it deletes the queued runs of the two retired task names, and the cast keeps it valid on a task enum that lacks either label;
221
+ - with the providers collection, move its `ALTER TYPE ... ADD VALUE 'native'` out of `db.execute` and run it on the adapter's own connection, outside the migration's transaction.
222
+ - **SQLite in migrate mode:** generate it the same way, then move the three `DROP TABLE` statements below the rebuild of `payload_locked_documents_rels`, with the providers collection remove `"ga4_currency"` and `"posthog_scope_property"` from both column lists of `INSERT INTO __new_analytics_providers`, and when `payload_jobs` existed before the upgrade end `up` with `DELETE FROM payload_jobs WHERE task_slug IN ('analytics-prune-events', 'analytics-warm-cache');`.
223
+ - On Postgres and SQLite, end `up` with `deleteLegacySalts({ payload })`, and optionally `deleteLegacyCache({ payload })`, from `@10x-media/analytics/migrations`; on a scoped install with the providers collection, each tenant's `native` provider document follows them in the same `up`.
224
+ 4. Replace `native({ retentionDays, rollupRetentionDays })` with `native({ retention: { rawDays, aggregateDays } })`, and pass the Payload instance to `NativeAdapter.flush(payload)`.
225
+ 5. Run a jobs runner for `analytics-maintain`, or set `jobs: false` to leave the upkeep to reads and ingest.
226
+ 6. On SQLite, open the database with `sqliteAdapter({ wal: true, busyTimeout: 5000 })` so the engine runs on worker threads, and leave `transactionOptions` unset. Run native on a database file: it refuses an in-memory database and an embedded replica.
227
+ 7. On Postgres, size the host pool (`postgresAdapter({ pool: { max } })`) with the engine's share in mind: its long reads and counts take at most a third of it ([Production note (Postgres)](https://docs.10xmedia.de/analytics/native#production-note-postgres)).
228
+
229
+ **Breaking:** `analytics-events`, `analytics-rollups` and `analytics-seen` are replaced by `analytics-hits` (one row per hit), `analytics-aggregates` (daily totals) and `analytics-state` (salts, day markers, leases and heartbeats). The new collections are hidden, have no REST or GraphQL endpoints, and take text ids the engine makes. The daily salts move from Payload's key-value store to `analytics-state` and each is deleted once the third UTC day after its own begins.
230
+
231
+ **Breaking:** native needs MongoDB 5.0, Postgres 12 or SQLite 3.35 or later, and refuses Cloudflare D1 at boot; keep a D1 install on vendor adapters. On SQLite it opens a connection of its own to the database file, so an in-memory database, an embedded replica or a second copy of libsql stops it (`502 source_misconfigured`, warned once). MongoDB-compatible services (Amazon DocumentDB, Azure Cosmos DB, Firestore) are not supported, and below MongoDB 5.0 reads and counts refuse while hits are still stored.
232
+
233
+ **Breaking:** raw hits are kept 90 days by default and daily totals for every day. Filtered and hourly reads, which read raw hits, reach back as far as `retention.rawDays`; a sale's and a refund's rows outlive it as tombstones without their visitor, until their day's totals go ([Retention](https://docs.10xmedia.de/analytics/native#retention)).
234
+
235
+ **Breaking:** `native()` registers the `analytics-maintain` task (every 15 minutes), which turns Payload's jobs on for an install that had none; `analytics-prune-events` is gone ([Maintenance](https://docs.10xmedia.de/analytics/native#maintenance)).
236
+
237
+ **Breaking:** `NativeAdapter.flush(payload)` takes the Payload instance it writes for, since every engine structure is kept per instance.
238
+
239
+ **Breaking:** server events never join the host's transaction: a rolled-back order keeps its hit, and on SQLite one tracked inside an open transaction is written once it ends. A server event without `req`, `ip` or `userAgent` belongs to no visitor, and `event.timezone` only picks the day of its salt ([Server events and host transactions](https://docs.10xmedia.de/analytics/native#server-events-and-host-transactions)).
240
+
241
+ **Behavioral:** a visit is a visitor's hits on one hostname with no gap over 30 minutes, attributed to the pageview that opened it; hour series are the reporting timezone's local hours; breakdowns list no `(other)` row; a referrer is stored only on the pageview that opened a visit, engagement rows carry no visitor attributes, and a click id is stored by name, never its value.
242
+
243
+ **Behavioral:** native reads say what their numbers are: `meta.partial` (days not counted yet), `meta.capped` (values folded away, whose raw hits are gone), `meta.failed` (days whose counting was given up), `meta.clamped` with `dataFrom` and `dataTo` (an end of the range past the raw hits kept), `meta.asOf` (today's snapshot), `meta.visitorsAre` and `meta.timezoneUnresolved`. Native never sets `meta.sampled`.
244
+
245
+ **Behavioral:** daily totals keep at most 10,000 pages and 100 currencies per hostname a day, with the other caps of `native({ caps })`; what a day sends beyond a cap stays exact while its raw hits are kept and is folded into one row after that ([Daily totals and caps](https://docs.10xmedia.de/analytics/native#daily-totals-and-caps)).
246
+
247
+ **Behavioral:** maintenance counts days that are waiting first, oldest first, then works through the scopes in turn from a saved cursor, skipping a scope with no new hits since its last pass. A day whose count fails three times is marked failed: reads use an earlier count of it when there is one, and `rebuildDays` counts it again ([Maintenance](https://docs.10xmedia.de/analytics/native#maintenance)).
248
+
249
+ **Behavioral:** today is read live from its raw hits up to 5,000 hits on Postgres and 2,000 elsewhere, and above that from a snapshot taken in the background, served for one to five minutes by how busy the day is (`meta.asOf`). A read spends at most three seconds on closed days it finds uncounted and never starts one it cannot finish; a day left out is counted in `meta.partial.missingDays` and the read is cached for the realtime TTL. A read whose window reaches into today is cached 10 seconds at most, whatever `cache.ttl` says, and read again rather than served stale once it expires ([TTLs](https://docs.10xmedia.de/analytics/cache#ttls)).
250
+
251
+ **Behavioral:** on Postgres the engine shares the host's pool: its long reads, counts and analytical transactions hold at most a third of `pool.max` connections, all its work at most one fewer than the pool, so the host always keeps one; a count a read starts carries a `statement_timeout` (on MongoDB a shared `maxTimeMS`). Each call the engine makes to a host resolver gets a fresh local request.
252
+
253
+ **Behavioral:** a live read fails as a whole, `503` with `Retry-After`, when any part of it fails. A write buffer batch that fails as a whole (a lock, a lost connection) is retried once after 500 ms and then dropped; only a batch a row of which was refused is retried row by row.
254
+
255
+ **Behavioral:** on a local SQLite file the engine runs its statements on three worker threads of its own when the database is in WAL mode with a busy timeout of at least 5,000 ms, so counting a busy day no longer freezes the process; otherwise it stays on the main thread under stall budgets and the boot warns once. `native({ sqlite: { thread } })` or `ANALYTICS_SQLITE_THREAD` sets it ([SQLite](https://docs.10xmedia.de/analytics/native#sqlite)).
256
+
257
+ **Behavioral:** the boot warns when a local SQLite file's adapter sets `transactionOptions`. `@libsql/client` 0.14 opens every connection after a transaction without the adapter's busy timeout, so from the second transaction on a write fails at once with `SQLITE_BUSY` while another connection holds the lock (the engine's, a jobs worker's, another instance's), and libsql may then lose later writes on that connection. Leave `transactionOptions` unset, as Payload does by default ([Transactions on SQLite](https://docs.10xmedia.de/analytics/native#transactions-on-sqlite)).
258
+
259
+ **Behavioral:** the public ingest path reads nothing from the database per beacon. Buffered and deferred hits are written on `SIGINT` as on `SIGTERM`, and `process.exit()` logs how many were lost.
260
+
261
+ **Behavioral:** a `geoResolver` that throws, or answers something other than text for a field, has the event stored without a location instead of failing the beacon, and is logged at most once an hour.
262
+
263
+ **Additive:** `native({ retention, caps, collections, items, sqlite, today })` and `buffer.maxPending`; `meta.failed` and `meta.dataTo` on a read's result; native filters with `matches` on Postgres and MongoDB, for patterns that JavaScript, Postgres and MongoDB read alike (no nested quantified groups), any other answering `400 invalid_param` with `param: 'filters'`; `rebuildDays`, `NativeAdapter.rebuild` and the maintain task's `rebuild` input count a stretch of days again ([Rebuilding days](https://docs.10xmedia.de/analytics/native#rebuilding-days)); `dropLegacyNative`, `deleteLegacySalts` and `deleteLegacyCache` from `@10x-media/analytics/migrations`; `HITS_SLUG`, `AGGREGATES_SLUG`, `MAINTAIN_TASK_SLUG` and `SESSION_DIMENSIONS` from `/adapters/native`; `ingestRoute` and `ingestPreflight` from `/next`, for taking beacons in a route of your own.
264
+
265
+ - **Options: renamed options fail the boot, and the boot checks what it used to accept.** Every option is now checked when the plugin builds the Payload config, and a value of the wrong shape, a key no option takes at any level, an id that names no adapter, or a combination the plugin cannot honor stops the boot with a message naming the path ([Options](https://docs.10xmedia.de/analytics/reference/options)).
266
+
267
+ **Upgrade actions**
268
+
269
+ 1. Load the config once (the dev server, or any `payload` command) and rename every option the error names, each listed with its replacement. The `native()` options fail first, in a message of their own, so it can take two runs. On an install without `scope.resolve`, remove `access.platformRead` and `scopes` instead: their replacements only apply to a scoped install, and there every cross-scope gate is `isAdminUser`.
270
+ 2. Set `capture.gate` ([consent](https://docs.10xmedia.de/analytics/consent#which-slots-wait)) and, on a scoped install, `scope.member` ([multi-tenancy](https://docs.10xmedia.de/analytics/multi-tenancy)).
271
+ 3. Set `revenue: true` or `revenue: { currency }` if the install reports revenue.
272
+ 4. In `widgets.register`, replace `requires: { perPageQuery: true }` with `requires: { path: true }`, and `filterOperators` with `filters` naming each operator with its dimension.
273
+ 5. Fix whatever else the boot refuses: the message names the option. With several invalid options, the one named first may differ from earlier releases.
274
+
275
+ **Breaking:** these 1.0.0-beta.11 options are removed, not deprecated, and fail the boot with an error naming the replacement and linking [Removed options](https://docs.10xmedia.de/analytics/upgrading#removed-options):
276
+
277
+ | Removed | Use instead |
278
+ | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
279
+ | `scopeResolver` | `scope.resolve` |
280
+ | `scopes` | `scope.list` for the scopes the cron jobs run over, `scope.label` for the view caption, on a scoped install; remove it from an unscoped one |
281
+ | `access.platformRead` | `access.crossScope` (a function grants all three cross-scope gates) on a scoped install; remove it from an unscoped one |
282
+ | `capture.consent` | `capture.gate`: `'all'`, `'off'`, a list of slots, or `({ slot, adapterId, kind }) => boolean`; `({ kind }) => kind !== 'native'` reproduces the old default |
283
+ | `sync.collectionSlug` | `sync.collection.slug` |
284
+ | `sync.hidden` | `sync.collection.hidden` |
285
+ | `sync.cron` | `jobs.tasks.sync.cron` |
286
+ | `cache.warm.cron` | `jobs.tasks.warm.cron`; `cache.warm` keeps `windowHours` and `maxReads` |
287
+ | `goals.collection.enabled` | `goals.collection: false` |
288
+ | `native({ retentionDays })` | `native({ retention: { rawDays } })` |
289
+ | `native({ rollupRetentionDays })` | `native({ retention: { aggregateDays } })` |
290
+
291
+ **Breaking:** `adapters` is required in the option type. It may be empty only with `disabled: true`.
292
+
293
+ **Breaking:** a string `reportingTimezone` that is not a time zone fails the boot, where it used to read as UTC. A resolver answering one logs a warning once per value.
294
+
295
+ **Breaking:** options that only mean something on a scoped install fail the boot without `scope.resolve`: `scope.list`, `scope.label`, `scope.member`, `access.crossScope`, an adapter id in `capture.slots.tenant`, `capture.paths.tenant`, a `collections.<slug>.scopeField` other than `false`, and an explicit `goals.collection.scopeField` or `providers.collection.scopeField`.
296
+
297
+ **Breaking:** `disabled: true` checks every option and keeps the plugin's database schema, rather than returning the config untouched. A switched-off install therefore gains the plugin's collections: generate its migration as for a running one ([Switching it off](https://docs.10xmedia.de/analytics/reference/options#switching-it-off)).
298
+
299
+ **Breaking:** what 1.0.0-beta.11 let through now fails the boot: a key no option takes, at any level of the options (a misspelled `cache.tll` included); two adapters with the same `id`; a `cache.ttl` value that is not a whole number of seconds, 0 or more (`'300'` included); a `cache.timeoutMs`, `sync.lookbackDays`, `capture.proxy.timeoutMs` or `capture.proxy.maxBodyBytes` value that is not a whole number of at least 1; a `widgets.disabled` slug that names no widget of the install, and a `widgets.register` entry without its `slug`, `component` and `label`; `goals.collection` set to `null`, `0` or `''` (it takes `true`, `false` or an object); a `translations` key that is not one of the plugin's own, a key this release removed among them ([Translations](https://docs.10xmedia.de/analytics/reference/translations)).
300
+
301
+ **Breaking:** a `widgets.register` entry's `requires` takes only `metrics`, `dimensions`, `filters`, `realtime`, `perItemQuery` and `path`. The two 1.0.0-beta.11 keys that are gone fail the boot, naming their replacement, rather than being ignored and offering the widget where it was left out: `perPageQuery` is `path: true`, and `filterOperators` is `filters` naming each operator with its dimension, such as `filters: [{ dimension: 'page', operator: 'contains' }]` ([Custom widgets](https://docs.10xmedia.de/analytics/widgets#custom-widgets)).
302
+
303
+ **Breaking:** a collection override is checked against what the plugin reads and writes. An override may not rename a plugin collection (its `slug` option does), remove, rename or retype a field the plugin writes, drop an index it declares, add a required field without a fixed `defaultValue`, or turn off `timestamps` on the providers and goals collections; `overrides` must be a function, and on Postgres a table or index name over 63 characters fails. The checks run again at init against the config every plugin has assembled ([Renaming the plugin's collections](https://docs.10xmedia.de/analytics/reference/options#renaming-the-plugins-collections)).
304
+
305
+ **Breaking:** a goal path pattern holds at most 32 segments and four `**`; `**` inside a segment no longer crosses slashes (write `/docs/**` for any depth), and a path deeper than 128 segments matches nothing ([Path globs](https://docs.10xmedia.de/analytics/goals#path-globs)).
306
+
307
+ **Behavioral:** GA4's Data API client and `maxmind` are handed over through `sdks`, so a traced or standalone build ships them: `sdks: { ga4: { BetaAnalyticsDataClient }, maxmind: { open } }`. Without it the plugin still loads them by name, and a production boot warns.
308
+
309
+ **Additive:** options new since 1.0.0-beta.11, each covered by the entry for its theme: `routes.base`, `trustedPlatform`, `sdks`, `hooks.afterRead`, `jobs`, `revenue`, `scope`, `access.crossScope`, `capture.gate`, `capture.exclusion`, `capture.allowedOrigins`, `capture.skip`, `capture.autoCapture.items`, `collections.<slug>.scopeField` and `item`, `goals.purchase`, `goals.collection.fields`, `providers.collection.fields`, `connectionAccess` and `sourceAccess`, `providers.hosts`, `view.Component`, `widgets.overrides`, `countryFlags`, `cache.store`, `cache.collection`, `cache.concurrency`, `sync.collection.overrides`, and on `native()`: `retention`, `caps`, `collections`, `items`, `sqlite`, `today` and `buffer.maxPending`.
310
+
311
+ - **Revenue: money is opt-in, sales and refunds have calls of their own, and an order counts once.** `purchase` and `refund` are the revenue calls, in the browser and on the server; a sale the browser and a payment webhook both record counts once, in the visit that made it; and only server code can subtract money ([Revenue](https://docs.10xmedia.de/analytics/revenue)).
312
+
313
+ **Upgrade actions**
314
+
315
+ 1. If the install reports revenue, set `revenue: true`, or `revenue: { currency: 'EUR' }` to report in one currency per install or per scope.
316
+ 2. If an amount the browser sends should win over a goal's fixed value, as before, set `revenue: { browserAmounts: 'trust' }`.
317
+ 3. Give a currency to every goal that has an amount: a goal saved earlier with an amount and no currency asks for one on its next save. Where the form-builder goal action's fields are out of the plugin's reach, pass `trackGoalAction({ defaultCurrency })`.
318
+ 4. Fix an invalid Plausible `revenueCurrency`, which now throws when the adapter is built.
319
+ 5. Code that implements `Tracker` itself, such as a test double, adds `purchase` and `refund`.
320
+ 6. To record sales and refunds, call `purchase()` with each order's real id and the server's `refund()` with a `refundId` of its own.
321
+
322
+ **Breaking:** money is off unless `revenue` is set. Without it the `revenue` metric is gone from every source, the `currency` dimension is not declared and every amount field is hidden (in collections, globals and blocks alike); stored amounts are kept, and turning money on shows them again. The boot warns when a config goal carries a `value` while money is off ([What disappears when money is off](https://docs.10xmedia.de/analytics/revenue#what-disappears-when-money-is-off)).
323
+
324
+ **Breaking:** `revenue.browserAmounts` defaults to `'fixed'`: a goal's fixed value wins over an amount the browser sends, which counts only for a goal without one. `'none'` ignores browser amounts and `value.prop` alike, `'trust'` keeps the old order. Server code is always believed ([Amounts from the browser](https://docs.10xmedia.de/analytics/revenue#amounts-from-the-browser)).
325
+
326
+ **Breaking:** ingest refuses a body carrying `revenue` or a negative `value` with a `400`, where 1.0.0-beta.11 ignored the one and dropped the negative amount, keeping the event: only server code subtracts money.
327
+
328
+ **Breaking:** a goal with an amount needs a currency, in the goals collection and in the form-builder goal action, through the API as much as in the admin; `trackGoalAction({ defaultCurrency })` fills it in where the action's fields are out of the plugin's reach.
329
+
330
+ **Breaking:** an invalid Plausible `revenueCurrency` throws when the adapter is built, and a blank one no longer turns Plausible's revenue on.
331
+
332
+ **Breaking:** `Tracker` and `AnalyticsCommands` gain the required `purchase` and `refund`, so code that implements either itself adds them.
333
+
334
+ **Behavioral:** each goal an event completes carries its own amount, converted from that goal's own currency. Every amount is capped at 10^12.
335
+
336
+ **Behavioral:** a built-in `purchase` goal exists without being declared, so a sale reaches `conversions` and `revenue` before anyone declares a goal. It is latent: left out of the goal picker and the tracker config, shown in the goals table only once it has conversions, returned by the goals endpoint only for `?include=builtin`, and named in the query endpoint's `builtinGoalSlugs`. `goals.purchase: false` removes it ([The built-in purchase goal](https://docs.10xmedia.de/analytics/goals#the-built-in-purchase-goal)).
337
+
338
+ **Behavioral:** without a reporting currency, a native read whose revenue adds several currencies lists them in `meta.mixedCurrencies`, and every surface says so; the `currency` dimension, on by default without `revenue.convert`, shows gross per currency.
339
+
340
+ **Additive:** `purchase({ orderId, value, currency?, items?, props? })` and `refund(...)` as server functions taking `payload`, and `purchase` on the tracker and on `useAnalytics()`; the tracker's `refund` only warns in development, since a refund is recorded server-side, from the payment webhook. `items` are the lines of a sale, forwarded to GA4 as `items` and to PostHog as a property. Server calls filed without a `path` go under `/orders`.
341
+
342
+ **Additive:** order ids. An id holds up to 255 characters and no control character: the server calls throw `AnalyticsTrackError` for one that is not, and ingest drops a beacon carrying one, still answering `202`. Native stores only a digest of it, keyed by the Payload secret, never the id itself. A sale recorded by both the browser and the webhook counts on the browser's record, in its visit, with the webhook's amount, and the webhook's record counts no event, so a visit's source, campaign and country carry the sale and `events` counts it once. The two pair only within 24 hours, unless `revenue.orderSignature: 'required'` is set and the page sends an id from `signOrderId`; a record arriving after its day was counted has that day counted again ([Recorded in the browser and by the webhook](https://docs.10xmedia.de/analytics/revenue#recorded-in-the-browser-and-by-the-webhook)). A refund counts its amount in revenue and no conversion, is keyed by its `refundId` so two partial refunds both count and a retried one counts once, and is filed with its sale's attribution ([Refunds](https://docs.10xmedia.de/analytics/revenue#refunds)).
343
+
344
+ **Additive:** `revenue.currency`, `convert`, `dimension`, `browserAmounts` and `orderSignature`, with a vendor's own revenue currency (GA4's property currency, Plausible's `revenueCurrency`) winning over `revenue.currency` for that vendor, and a `revenue.convert` answer that is unbounded or flips the sign counting as no answer; `signOrderId`; a goal's `browser: false`, which ignores completions sent from a browser; `identity` on server calls, `'none'` recording an event as no visitor's; the goal amount control with a currency picker; `analyticsLinkFields({ value: true })` for a per-link amount.
345
+
346
+ - **Security: one endpoint base, admin-only defaults, and public endpoints that trust nothing a request merely claims.** Reads default to the admin collection's users, capture never sees the admin's identity, provider documents connect only where the install allows, and the links and refs a page can send are signed ([Endpoints](https://docs.10xmedia.de/analytics/reference/endpoints)).
347
+
348
+ **Upgrade actions**
349
+
350
+ 1. Update code, CDN rules or Next routes of your own that call the old `/api/analytics/*` paths (table below), and build the paths with `analyticsRoutes(config)`. A page that boots with `initTracker({ endpoint })` passes the new config path.
351
+ 2. Give a second auth collection that should read analytics an `access.read` of your own, and widen the goals, sync or providers collection's `access` where users outside the admin collection manage them.
352
+ 3. Resolve a visit's scope from its host at the `capture` call site, never from the admin's tenant cookie ([The call site](https://docs.10xmedia.de/analytics/multi-tenancy#the-call-site)).
353
+ 4. On Vercel or behind Cloudflare, set `trustedPlatform: 'vercel'` or `'cloudflare'` in place of `trustedProxyHops`, which it excludes, or visitor countries stop being read ([Which headers to trust](https://docs.10xmedia.de/analytics/geo#which-headers-to-trust)).
354
+ 5. List your other sites whose pages post beacons in `capture.allowedOrigins`.
355
+ 6. List the self-hosted vendor hosts of your provider documents in `providers.hosts.allow`, and set `providers.hosts.allowPrivateNetwork: true` for a host on `http://` ([Where a document may connect](https://docs.10xmedia.de/analytics/providers#where-a-document-may-connect)).
356
+ 7. Turn the exclusion link on with `capture.exclusion: true`, and list your websites' addresses in `capture.exclusion.sites` so the analytics view links staff straight to each ([Excluding your own visits](https://docs.10xmedia.de/analytics/capture#excluding-your-own-visits)).
357
+ 8. Where `next.config` calls `captureRewrites` or `posthogProxyRewrites`, relay the vendor through `captureRoute` in a route handler instead, or leave `capture.paths` unset to use the plugin's own proxy ([First-party proxy](https://docs.10xmedia.de/analytics/proxy)).
358
+
359
+ **Breaking:** every endpoint moved under one base, `routes.base`, default `/_x`, with no alias at the old paths:
360
+
361
+ | 1.0.0-beta.11 | Now |
362
+ | ------------------------------------------------------------- | ------------------------------------------------------ |
363
+ | `GET /api/analytics/query`, `/sources`, `/goals`, `/document` | `GET /api/_x/query`, `/sources`, `/goals`, `/document` |
364
+ | `POST /api/analytics/refresh` | `POST /api/_x/refresh` |
365
+ | `GET /api/analytics/realtime` | `GET /api/_x/live` |
366
+ | `POST /api/analytics/ingest` | `POST /api/_x/e` |
367
+ | `GET /api/analytics/tracker` | `GET /api/_x/config` |
368
+ | `/api/analytics/p/:slot/*` | `/api/_x/p/:slot/:path*` |
369
+
370
+ `native({ ingestPath })` and `capture.paths` default to the new paths, and the tracker and the admin build them themselves. The boot refuses a base whose first segment a collection slug, a plain-object name or an earlier root endpoint would take ([Where the endpoints answer](https://docs.10xmedia.de/analytics/reference/endpoints#where-the-endpoints-answer)).
371
+
372
+ **Breaking:** `access.read` defaults to the users of the admin collection (`admin.user`), where any signed-in user read before, and the read helpers of `/rsc` are gated by it too; so does every cross-scope gate on an install without `scope.resolve`. The goals, sync and providers collections admit only the admin collection's users by default, and reading the sync collection also takes `access.read`.
373
+
374
+ **Breaking:** a `POST` another site's page makes a visitor's browser send (`Sec-Fetch-Site`) is dropped by ingest, still answering `202`, and refused by the capture proxy with `403`, unless its origin is in `capture.allowedOrigins` ([Beacons from other sites](https://docs.10xmedia.de/analytics/capture#beacons-from-other-sites)). On a scoped install the same holds for a page on a sibling subdomain whose host `scope.resolve` maps to another tenant than the request's.
375
+
376
+ **Breaking:** `captureRewrites` and `posthogProxyRewrites` from `@10x-media/analytics/next` throw when called, and are `@deprecated`: a Next rewrite to a vendor forwards every request header, the visitor's cookies and the site's `payload-token` among them, and passes the vendor's `set-cookie` back to the site. Relay the vendor through `captureRoute` instead ([First-party proxy](https://docs.10xmedia.de/analytics/proxy)).
377
+
378
+ **Breaking:** a provider document's `host` must be an `https` address. An adapter built from a document connects only to public addresses and follows no redirect on its own, and a self-hosted host the install does not list fails as `502 source_misconfigured` and captures nothing. `providers.hosts.allowPrivateNetwork: true` admits private addresses, and `http://` hosts in `providers.hosts.allow` and in the document's `host` field, which are refused without it ([Private networks](https://docs.10xmedia.de/analytics/providers#private-networks)).
379
+
380
+ **Breaking:** on a scoped install a provider document's connection (its type, host and the ids its adapter reads) changes only with `access.crossScope.named`, and any change of where a document connects clears its stored key, so enter the key again in the same save ([Changing where a document connects](https://docs.10xmedia.de/analytics/providers#changing-where-a-document-connects)). A stored credential is decrypted on a request of its own, outside the reader's transaction, and taking a beacon never decrypts one; a document whose credential does not decrypt lists as a failing source.
381
+
382
+ **Breaking:** the exclusion link is off by default and signed: `?analytics_exclude=1` no longer excludes a browser, and the tracker's `exclusionParam` option and `readExclusionParam` are gone. With `capture.exclusion: true` the parameter carries an HMAC of the scope keyed by the Payload secret, the tracker config carries only its hash, and `capture.exclusion.param` renames it. A browser already excluded stays excluded.
383
+
384
+ **Behavioral:** `?analytics_exclude=0` still counts a browser again, with no token, as soon as the page loads. It reads the flag and removes it only when the browser was excluded, where 1.0.0-beta.11 wrote `0` to storage.
385
+
386
+ **Breaking:** on Vercel and Cloudflare the visitor's country, region and city come from the platform's headers only with `trustedPlatform` set; without it no platform header is read. `trustedPlatform` and `trustedProxyHops` exclude each other.
387
+
388
+ **Breaking:** the capture proxy decides each answer's content type from its route's `kind`, sends `X-Content-Type-Options: nosniff` and sandboxes data answers; a custom adapter declares `kind` on every proxy route.
389
+
390
+ **Behavioral:** the tracker sends native only the referrer's origin and, of the page's query string, only the campaign keys (the `utm_*` keys and the names of the click ids), and `props.url` on `outbound_link` and `file_download` drops the query string, the fragment and any credentials.
391
+
392
+ **Behavioral:** the capture proxy answers `404` for a path segment holding an encoded `/` or `\`, which an upstream would read as a separator, and `405` with an `Allow` header for a `POST` to a script route. A Plausible `scriptId` that is not up to 64 letters, digits, `_` and `-` renders no snippet, and the providers collection refuses it.
393
+
394
+ **Behavioral:** the document endpoint refuses a range over 366 days with `400 range_too_long`, as the query endpoint does, and both refuse a date before 1970 with `400 invalid_param`. The analytics view names goals and the scope only to a reader `access.read` admits, even where `access.view` is wider.
395
+
396
+ **Behavioral:** nothing a vendor snippet embeds can end its `<script>` element: every value every adapter writes into an inline script goes through one escaper, `</script>` and the JavaScript line separators included.
397
+
398
+ **Additive:** the analytics view's **Your own visits** panel ([Your own visits](https://docs.10xmedia.de/analytics/analytics-view#your-own-visits)). By default it shows `?analytics_exclude=<token>` to copy and add to a site's address. With `capture.exclusion.sites`, a list of website addresses or a function per scope that may be async, it shows one row per site: **Stop counting this browser** and **Count this browser again** open the website in a new tab, and **Copy link for another browser** copies the signed link. On a multi-tenant install the platform's **All sites** view lists every tenant's sites, each with that tenant's token, for a reader `access.crossScope.named` admits. `GET /api/_x/exclusion` serves the panel and answers `sites: Array<{ address, token }>` (`ExclusionResponse`, `ExclusionSite`).
399
+
400
+ **Additive:** `captureRoute` and `CaptureRouteOptions` from `@10x-media/analytics/next`, a route handler that relays one adapter's vendor by the capture proxy's rules: no cookie or credential upstream, and no `set-cookie` back; `routes.base`, `analyticsRoutes`, `routePaths` and `DEFAULT_ROUTE_BASE`; `isAdminUser`; `trustedPlatform`; `capture.allowedOrigins`; `capture.exclusion` with `param` and `sites`; `providers.hosts`; `createGuardedFetch`, `resolveHostPolicy` and `CONNECTION_PATHS`, all `@beta`; `providers.collection.connectionAccess` and `sourceAccess`; item refs and order ids signed by the server (`signItemRef`, `itemAttributesFor`, `signOrderId`).
401
+
402
+ - **Multi-tenancy: one scope authority, membership checked on every read, and three cross-scope gates.** The host decides which tenant a request is for, through `scope.resolve`, and every surface reads that answer: the view, the widgets, the display fields, the endpoints and the read helpers. A reader must belong to the tenant they read, and reading past it takes an explicit gate ([Multi-tenancy](https://docs.10xmedia.de/analytics/multi-tenancy)).
403
+
404
+ **Upgrade actions**
405
+
406
+ 1. Rename `scopeResolver` to `scope.resolve`, `scopes` to `scope.list` (and `scope.label` for the view caption), and `access.platformRead` to `access.crossScope`. An install without `scope.resolve` removes `scopes` and `access.platformRead` instead.
407
+ 2. Add `scope.member`: `tenantMembership()` reads `@payloadcms/plugin-multi-tenant`'s tenants array, and `() => true` suits a resolver that already derives the scope from `req.user`.
408
+ 3. Make `scope.resolve` answer a visit from its host when `callSite` is `'capture'`, never from the admin's tenant cookie, and never answer `'*'`: a beacon it resolves to no tenant is answered `202` and dropped.
409
+ 4. Give every bound collection on a scoped install a `tenant` field, name another one in `collections.<slug>.scopeField`, or set `scopeField: false` to read the request's own scope.
410
+ 5. With the providers collection, create an enabled provider document of type **Payload** (`provider: 'native'`) for every tenant that should keep native analytics, at the end of the upgrade migration's `up`, through its `req` and as a user `access.crossScope.named` admits ([Scoped installs](https://docs.10xmedia.de/analytics/upgrading/beta-12#scoped-installs)); and grant `access.crossScope.unscopedSource` to the readers who should still read a shared config adapter under a tenant.
411
+ 6. Remove options that only mean something on a scoped install from an unscoped one.
412
+
413
+ **Breaking:** `scope.member` is required with `scope.resolve`. Every read refuses a tenant its user does not belong to, the read helpers of `/rsc` included, and a refused endpoint answers `400 untrusted_scope`.
414
+
415
+ **Breaking:** `scope.resolve` receives `{ req, callSite }`. At `capture` (beacons, the tracker config, the capture proxy, server tracking with a request) it is asked without the signed-in user, their cookies or their authorization header, and the timezone and currency resolvers get that same request there ([The call site](https://docs.10xmedia.de/analytics/multi-tenancy#the-call-site)). An answer of `'*'` is refused and logged: the wildcard is a reader's request, never a request's own scope. On a scoped install a request that resolves no tenant reads nothing unless the reader passes `access.crossScope.aggregate`.
416
+
417
+ **Breaking:** an install without `scope.resolve` has no scope to name: a read or a refresh naming one other than `*` answers `400 untrusted_scope`, where any signed-in user could name one. On every install a scope name over 256 characters is refused the same way.
418
+
419
+ **Breaking:** on a scoped install running the providers collection, native is granted per tenant by a `native` provider document. A tenant without an enabled one does not see the native source anywhere, gets no native beacon in its tracker config, and has its beacons dropped at ingest (still answering `202`); what it already stored is kept ([Native is a provider type](https://docs.10xmedia.de/analytics/multi-tenancy#native-is-a-provider-type)).
420
+
421
+ **Breaking:** with the providers collection, a tenant reads the sources its own provider documents grant it, filtered to the documents the reader may read (`providers.collection.sourceAccess`, by default the collection's own read access), and a config adapter only for a reader `access.crossScope.unscopedSource` admits; before, every config adapter that could narrow to a scope was readable by any tenant. On every scoped install, a config adapter that cannot narrow to a tenant is no longer among its sources at all, and naming it under a tenant answers `404 unknown_source` where it answered `403 forbidden` ([Which sources a request sees](https://docs.10xmedia.de/analytics/multi-tenancy#which-sources-a-request-sees)).
422
+
423
+ **Breaking:** a binding on a scoped install reads the document's own scope from `collections.<slug>.scopeField`, by default `'tenant'`, and the boot fails when the collection has no such field. The Analytics tab, the stat fields, the live counter and the document, sources and live endpoints all report the page's tenant rather than the reader's, and reading a document of another tenant takes `access.crossScope.named`; a reader it denies sees **Analytics for this page are not available to you** ([Whose numbers a document shows](https://docs.10xmedia.de/analytics/display-fields#whose-numbers-a-document-shows)).
424
+
425
+ **Behavioral:** `access.crossScope`, which replaces `access.platformRead` ([Removed options](https://docs.10xmedia.de/analytics/upgrading#removed-options)), is three gates: `named` (read a tenant you are not), `aggregate` (read every tenant at once) and `unscopedSource` (read a tenant through a config adapter rather than its own provider documents). A function grants all three, and the object form denies the gates it leaves out. On a scoped install every gate denies by default, as `platformRead` did; on an unscoped one each is `isAdminUser` and the option cannot be set ([Who sees what](https://docs.10xmedia.de/analytics/multi-tenancy#4-who-sees-what)).
426
+
427
+ **Behavioral:** naming your own resolved scope is no longer a cross-scope read, so it needs no gate; another tenant and `*` stay behind theirs.
428
+
429
+ **Behavioral:** a tenant capture slot left to its default takes the tenant's default source when that source captures, and otherwise the first of its sources that does, where it took the default source, and left the slot empty when that source could not capture.
430
+
431
+ **Behavioral:** the analytics view says whose numbers it shows: a reader who may aggregate gets a **Site** select offering their own site and **All sites** (`scope=*:<tenant>`), every other reader a caption naming the scope (`scope.label`), and a reader with no tenant selected is asked to choose one. A view address carrying any other `scope` is rewritten to the scope that answered.
432
+
433
+ **Behavioral:** `scope.resolve` at the `admin` call site, `reportingTimezone`, `revenue.currency` and the three cross-scope gates are each asked at most once per request, however many widgets and fields read on it.
434
+
435
+ **Additive:** `scope.label`, `tenantMembership()`; `ScopeCallSite`, `ScopeListResolver`, `ScopeLabelResolver`, `ScopeMemberAccess` and `CrossScopeAccess`; the panel's data-source switcher (`analyticsTab({ sources })`); the goals collection registered with `@payloadcms/plugin-multi-tenant` through `goals.collection.scopeField` ([Goals per tenant](https://docs.10xmedia.de/analytics/multi-tenancy#goals-per-tenant)).
436
+
437
+ - **Upgrading from 1.0.0-beta.11.** This release rebuilds the native engine's storage, leaves consent to the site's consent manager, moves every endpoint under one base and tightens who may read what, so every install has edits to make, and every Postgres or SQLite install in migrate mode has one reviewed migration to run. The other entries of this release group the changes by theme; [From 1.0.0-beta.11](https://docs.10xmedia.de/analytics/upgrading/beta-12) is the whole procedure on one page, with every change and what to do about it.
438
+
439
+ **Upgrade actions**
440
+
441
+ 1. Before the first boot, prepare a development database Payload pushes its schema to: on Postgres run the SQL under [Push mode](https://docs.10xmedia.de/analytics/upgrading/beta-12#push-mode), and start a pushed SQLite file again from a new one.
442
+ 2. Upgrade `@10x-media/analytics` together with Payload `^3.83.0` (`payload`, `@payloadcms/next`, `@payloadcms/ui`) and `@10x-media/fields`, which is now a required peer ([Supported versions](https://docs.10xmedia.de/analytics/reference/stability#supported-versions)).
443
+ 3. Load the config (the dev server, or any `payload` command) and fix what it refuses. A removed option fails it with an error naming its replacement, the `native()` options first and the plugin's own in a second message: rename each ([Removed options](https://docs.10xmedia.de/analytics/upgrading#removed-options)), but remove `access.platformRead` and `scopes` from an install without `scope.resolve`. The same checks refuse what 1.0.0-beta.11 let through, a translation override of a removed key among them, and a widget's `requires.perPageQuery` or `requires.filterOperators`, each named with its replacement.
444
+ 4. Set `capture.gate`; `({ kind }) => kind !== 'native'` keeps what 1.0.0-beta.11 did by default. Where the gate holds native, server code that knows the visitor's answer passes `identity: 'request'` to keep server events on their visitor.
445
+ 5. On a scoped install, add `scope.member`, and make `scope.resolve` answer the `capture` call site from the request's host.
446
+ 6. If the install reports revenue, set `revenue: true` or `revenue: { currency }`, and give every goal that has an amount a currency.
447
+ 7. Import `AnalyticsScripts` and `getTrackerConfig` from `@10x-media/analytics/site`, replace `consent()` calls with `setGate()`, and relay a vendor through a `captureRoute` route handler where `next.config` called `captureRewrites` or `posthogProxyRewrites`, which now throw.
448
+ 8. Regenerate the import map (`pnpm payload generate:importmap`).
449
+ 9. Migrate the database ([Storage and the database](https://docs.10xmedia.de/analytics/upgrading/beta-12#storage-and-the-database)):
450
+ - **MongoDB:** `pnpm payload migrate:create analytics_storage --file @10x-media/analytics/migrations/drop-legacy-mongo`, then `pnpm payload migrate`, where the install ran `native()` or warming: without `native()` it drops nothing and still deletes the queued `analytics-warm-cache` runs.
451
+ - **Postgres and SQLite in migrate mode:** `pnpm payload migrate:create analytics_storage`, answering **create table** (and **create enum** on Postgres) to every prompt, make the edits the upgrade page lists for your database, review the file, then `pnpm payload migrate`. Every such install needs it: the read cache is a new collection unless `cache.store` names a store of your own.
452
+ - **A scoped install with the providers collection:** end that migration's `up` with an enabled `native` provider document for every tenant that keeps native analytics ([Scoped installs](https://docs.10xmedia.de/analytics/upgrading/beta-12#scoped-installs)).
453
+ 10. Run Payload's job runner for `analytics-maintain`, and let your scheduler call it through `jobs.access.run`.
454
+ 11. On Vercel or behind Cloudflare, set `trustedPlatform` in place of `trustedProxyHops`, which it excludes, to keep visitor countries.
455
+ 12. List the origins of other sites whose pages post beacons in `capture.allowedOrigins`.
456
+ 13. Turn on `capture.exclusion`, list your websites in `capture.exclusion.sites`, and have staff leave their browsers out from the analytics view's **Your own visits** panel.
457
+ 14. List the self-hosted vendor hosts of your provider documents in `providers.hosts.allow`, and set `providers.hosts.allowPrivateNetwork: true` for one on `http://`.
458
+ 15. On SQLite, open the database with `sqliteAdapter({ wal: true, busyTimeout: 5000 })` and leave `transactionOptions` unset; native runs on a database file, not an in-memory database or an embedded replica.
459
+
460
+ **Breaking:** the native engine's old storage is not converted. Its collections are dropped by the migration, and the native reports count from the first hit stored after the upgrade; export `analytics-events` and `analytics-rollups` first to keep their numbers ([Storage and the database](https://docs.10xmedia.de/analytics/upgrading/beta-12#storage-and-the-database)).
461
+
462
+ **Breaking:** `@10x-media/fields` is a required peer, where it was optional, whether the plugin runs or is switched off, and `react-datepicker` is no longer a peer: the custom range uses Payload's own date picker.
463
+
464
+ **Behavioral:** `@payloadcms/db-postgres` is no longer an optional peer: nothing in the package imports it.
465
+
3
466
  ## 1.0.0-beta.11
4
467
 
5
468
  ### Patch Changes