@armco/analytics 0.3.3 → 0.3.4

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.
package/core/analytics.js CHANGED
@@ -9,7 +9,7 @@ import { UserPlugin } from "../plugins/enrichment/user";
9
9
  import { validateConfig, sanitizeEventData } from "../utils/validation";
10
10
  import { createLogger } from "../utils/logging";
11
11
  import { getEnvironmentType, isDoNotTrackEnabled, getTimestamp, deepMerge, } from "../utils/helpers";
12
- import { ensureRegion } from "../utils/region";
12
+ import { getRegionFallback } from "../utils/region";
13
13
  import { resolveEndpoint, detectEnvironment } from "../utils/config-loader";
14
14
  export class AnalyticsBuilder {
15
15
  constructor() {
@@ -198,7 +198,8 @@ export class Analytics {
198
198
  eventType,
199
199
  timestamp: getTimestamp(),
200
200
  eventId: uuidv4(),
201
- data: ensureRegion(sanitizeEventData(data || {})),
201
+ region: getRegionFallback(),
202
+ data: sanitizeEventData(data || {}),
202
203
  };
203
204
  for (const plugin of this.plugins) {
204
205
  if (plugin.processEvent) {
package/core/types.d.ts CHANGED
@@ -12,6 +12,7 @@ export interface TrackingEvent<T extends EventData = EventData> {
12
12
  eventId: string;
13
13
  sessionId?: string;
14
14
  userId?: string;
15
+ region?: string;
15
16
  data: T;
16
17
  }
17
18
  export interface PageViewEvent extends EventData {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@armco/analytics",
3
- "version": "0.3.3",
3
+ "version": "0.3.4",
4
4
  "description": "Universal Analytics Library for Browser and Node.js",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",