onerway-analytics 1.0.2 → 1.1.0

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.
@@ -5,10 +5,9 @@ import { StorageQueue } from './storage';
5
5
  import { collectContext, collectMarketing } from './context-collector';
6
6
  import { initAutoTrack } from './auto-track';
7
7
  import { initErrorMonitor } from './error-monitor';
8
- import { initGA } from './ga-loader';
8
+ import { initGTM } from './gtm-loader';
9
9
  import { initPerformanceMonitor } from './performance-monitor';
10
- import { trackToGA, setGAUserId, setGAUserProperties } from './ga-adapter';
11
- import { GAManager } from './ga-manager';
10
+ import { GTMManager } from './gtm-manager';
12
11
  import { generateId, generateUUID, getTimestamp, isObject, isBrowser, getPageUrl, safeLocalStorageGet, safeLocalStorageSet, } from '../utils';
13
12
  let globalBatchCounter = 0;
14
13
  export class Analytics {
@@ -19,11 +18,8 @@ export class Analytics {
19
18
  this.userProps = {};
20
19
  this.initialized = false;
21
20
  this.retrying = 0;
22
- this.gaInitialized = false;
23
- this.gaPendingQueue = [];
24
- this.gaPendingIdentify = null;
25
21
  this.unloadHandler = null;
26
- this.ga = new GAManager();
22
+ this.gtm = new GTMManager();
27
23
  this.config = {
28
24
  debug: false,
29
25
  autoTrack: true,
@@ -40,6 +36,7 @@ export class Analytics {
40
36
  this.clientType = DEFAULT_CONFIG.clientType;
41
37
  this.batchPageId = this.generateBatchPageId();
42
38
  this.sessionManager = new SessionManager(this.config.sessionTimeout);
39
+ this.sampled = this.resolveSampling();
43
40
  if (isBrowser()) {
44
41
  this.recoverFailedEvents();
45
42
  }
@@ -53,28 +50,10 @@ export class Analytics {
53
50
  if (isBrowser() && this.config.performance?.enabled !== false) {
54
51
  initPerformanceMonitor(this, this.config.performance);
55
52
  }
56
- if (isBrowser() && this.config.ga?.enabled) {
57
- this.ga._init(this.config.ga.measurementId);
58
- initGA(this.config.ga).then(() => {
59
- this.gaInitialized = true;
60
- this.log('GA4 initialized with measurementId:', this.config.ga?.measurementId);
61
- if (this.gaPendingIdentify) {
62
- setGAUserId(this.gaPendingIdentify.userId);
63
- if (this.gaPendingIdentify.attributes) {
64
- setGAUserProperties(this.gaPendingIdentify.attributes);
65
- }
66
- this.gaPendingIdentify = null;
67
- }
68
- for (const { eventName, properties, options } of this.gaPendingQueue) {
69
- trackToGA(eventName, properties, options);
70
- }
71
- this.gaPendingQueue = [];
72
- }).catch((error) => {
73
- this.ga._destroy();
74
- this.gaPendingIdentify = null;
75
- this.gaPendingQueue = [];
76
- this.log('Failed to initialize GA4:', error);
77
- });
53
+ if (isBrowser() && this.config.gtm?.enabled) {
54
+ initGTM(this.config.gtm);
55
+ this.gtm._init(this.config.gtm.containerId, this.config.gtm.dataLayerName);
56
+ this.log('GTM initialized with containerId:', this.config.gtm.containerId);
78
57
  }
79
58
  this.initialized = true;
80
59
  this.log('Analytics SDK initialized', {
@@ -82,7 +61,7 @@ export class Analytics {
82
61
  clientId: this.clientId,
83
62
  sessionId: this.sessionManager.getSessionId(),
84
63
  });
85
- if (isBrowser()) {
64
+ if (isBrowser() && this.config.autoTrackPageView !== false) {
86
65
  this.trackPageView();
87
66
  }
88
67
  }
@@ -91,22 +70,17 @@ export class Analytics {
91
70
  this.log('Invalid event name');
92
71
  return;
93
72
  }
73
+ if (!this.sampled)
74
+ return;
94
75
  const normalizedProps = properties && isObject(properties) ? properties : {};
95
76
  const isKeyEvent = options?.keyEvent === true || this.isKeyEvent(eventName);
96
- if (this.config.ga?.enabled) {
97
- const gaOptions = {
98
- sessionId: this.sessionManager.getSessionId(),
99
- pageUrl: isBrowser() ? getPageUrl() : '',
77
+ if (this.gtm.ready) {
78
+ this.gtm.track(eventName, {
79
+ ...normalizedProps,
80
+ session_id: this.sessionManager.getSessionId(),
81
+ page_url: isBrowser() ? getPageUrl() : '',
100
82
  referrer: isBrowser() ? document.referrer : '',
101
- marketing: collectMarketing(),
102
- userId: this.userId,
103
- };
104
- if (this.gaInitialized) {
105
- trackToGA(eventName, normalizedProps, gaOptions);
106
- }
107
- else {
108
- this.gaPendingQueue.push({ eventName, properties: normalizedProps, options: gaOptions });
109
- }
83
+ });
110
84
  }
111
85
  if (this.config.disableServer)
112
86
  return;
@@ -136,15 +110,12 @@ export class Analytics {
136
110
  if (attributes && isObject(attributes)) {
137
111
  this.userProps = attributes;
138
112
  }
139
- if (this.gaInitialized) {
140
- setGAUserId(userId);
113
+ if (this.gtm.ready) {
114
+ this.gtm.setUserId(userId);
141
115
  if (attributes && isObject(attributes)) {
142
- setGAUserProperties(attributes);
116
+ this.gtm.setUserProperties(attributes);
143
117
  }
144
118
  }
145
- else if (this.config.ga?.enabled) {
146
- this.gaPendingIdentify = { userId, attributes };
147
- }
148
119
  this.log('User identified:', { userId, attributes });
149
120
  if (wasAnonymous && this.buffer.length > 0) {
150
121
  this.flushBuffer();
@@ -164,8 +135,8 @@ export class Analytics {
164
135
  clearTimeout(this.bufferTimer);
165
136
  this.bufferTimer = null;
166
137
  }
167
- if (this.gaInitialized) {
168
- setGAUserId(null);
138
+ if (this.gtm.ready) {
139
+ this.gtm.setUserId(null);
169
140
  }
170
141
  this.log('Analytics reset');
171
142
  }
@@ -190,6 +161,16 @@ export class Analytics {
190
161
  console.log('[Analytics]', ...args);
191
162
  }
192
163
  }
164
+ resolveSampling() {
165
+ const rate = this.config.sampleRate ?? 1;
166
+ if (rate >= 1)
167
+ return true;
168
+ if (rate <= 0)
169
+ return false;
170
+ const decision = Math.random() < rate;
171
+ this.log(`Sampling decision: ${decision ? 'included' : 'excluded'} (sampleRate=${rate})`);
172
+ return decision;
173
+ }
193
174
  getOrCreateClientId() {
194
175
  if (!isBrowser())
195
176
  return generateUUID();
@@ -235,8 +216,9 @@ export class Analytics {
235
216
  const merged = {};
236
217
  for (const key of Object.keys(defaults)) {
237
218
  const k = key;
238
- if (defaults[k] !== undefined) {
239
- merged[k] = defaults[k];
219
+ const val = defaults[k];
220
+ if (val !== undefined && val !== '') {
221
+ merged[k] = val;
240
222
  }
241
223
  }
242
224
  for (const key of Object.keys(properties)) {
@@ -330,6 +312,8 @@ export class Analytics {
330
312
  recoverFailedEvents() {
331
313
  if (this.config.disableServer)
332
314
  return;
315
+ if (!this.sampled)
316
+ return;
333
317
  const failedEvents = StorageQueue.recover();
334
318
  if (failedEvents.length > 0) {
335
319
  this.log(`Recovered ${failedEvents.length} failed events from storage`);
@@ -1 +1 @@
1
- {"version":3,"file":"context-collector.d.ts","sourceRoot":"","sources":["../../src/core/context-collector.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,gBAAgB,EAGjB,MAAM,UAAU,CAAC;AAiBlB,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,cAAc,CAoB3G;AAED,wBAAgB,gBAAgB,IAAI,gBAAgB,CAgCnD"}
1
+ {"version":3,"file":"context-collector.d.ts","sourceRoot":"","sources":["../../src/core/context-collector.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,gBAAgB,EAGjB,MAAM,UAAU,CAAC;AAiBlB,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,cAAc,CAoB3G;AAED,wBAAgB,gBAAgB,IAAI,gBAAgB,CAkCnD"}
@@ -23,19 +23,21 @@ export function collectContext(appKey, merchantLanguage, clientType) {
23
23
  export function collectMarketing() {
24
24
  if (!isBrowser())
25
25
  return {};
26
- // Persist UTM params from the landing URL so they survive SPA navigation
26
+ // If current URL has UTM params (new campaign visit), update the cache and use them.
27
+ // If not (SPA internal navigation), fall back to cached value so attribution is preserved.
27
28
  let utm = {};
28
- const storedUtm = safeLocalStorageGet(STORAGE_KEYS.UTM_PARAMS);
29
- if (storedUtm) {
30
- try {
31
- utm = JSON.parse(storedUtm);
32
- }
33
- catch { /* ignore corrupt value */ }
29
+ const freshUtm = parseUTMParams();
30
+ if (Object.keys(freshUtm).length > 0) {
31
+ utm = freshUtm;
32
+ safeLocalStorageSet(STORAGE_KEYS.UTM_PARAMS, JSON.stringify(utm));
34
33
  }
35
34
  else {
36
- utm = parseUTMParams();
37
- if (Object.keys(utm).length > 0) {
38
- safeLocalStorageSet(STORAGE_KEYS.UTM_PARAMS, JSON.stringify(utm));
35
+ const storedUtm = safeLocalStorageGet(STORAGE_KEYS.UTM_PARAMS);
36
+ if (storedUtm) {
37
+ try {
38
+ utm = JSON.parse(storedUtm);
39
+ }
40
+ catch { /* ignore corrupt value */ }
39
41
  }
40
42
  }
41
43
  let landingPage = safeLocalStorageGet(STORAGE_KEYS.LANDING_PAGE);
@@ -3,10 +3,9 @@ export interface GAEventOptions {
3
3
  sessionId: string;
4
4
  pageUrl: string;
5
5
  referrer: string;
6
- marketing: MarketingPayload;
7
- userId?: string | null;
8
6
  }
9
7
  export declare function trackToGA(eventName: string, properties: Record<string, unknown>, options: GAEventOptions): void;
10
8
  export declare function setGAUserId(userId: string | null): void;
11
9
  export declare function setGAUserProperties(properties: Record<string, unknown>): void;
10
+ export declare function setGAMarketing(marketing: MarketingPayload): void;
12
11
  //# sourceMappingURL=ga-adapter.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ga-adapter.d.ts","sourceRoot":"","sources":["../../src/core/ga-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE5C,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,gBAAgB,CAAC;IAC5B,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB;AAED,wBAAgB,SAAS,CACvB,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACnC,OAAO,EAAE,cAAc,GACtB,IAAI,CAqBN;AAED,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAGvD;AAED,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAG7E"}
1
+ {"version":3,"file":"ga-adapter.d.ts","sourceRoot":"","sources":["../../src/core/ga-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE5C,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAqBD,wBAAgB,SAAS,CACvB,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACnC,OAAO,EAAE,cAAc,GACtB,IAAI,CAqBN;AAED,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAGvD;AAED,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAG7E;AAID,wBAAgB,cAAc,CAAC,SAAS,EAAE,gBAAgB,GAAG,IAAI,CAWhE"}
@@ -1,27 +1,38 @@
1
+ // GA4 reserved event names — sending these as custom events causes silent drops
2
+ const GA4_RESERVED_NAMES = new Set([
3
+ 'ad_activeview', 'ad_click', 'ad_exposure', 'ad_impression', 'ad_query',
4
+ 'adunit_exposure', 'app_clear_data', 'app_exception', 'app_install',
5
+ 'app_remove', 'app_update', 'app_upgrade', 'error', 'firebase_campaign',
6
+ 'first_open', 'first_visit', 'in_app_purchase', 'notification_dismiss',
7
+ 'notification_foreground', 'notification_open', 'notification_receive',
8
+ 'os_update', 'session_start', 'user_engagement',
9
+ ]);
10
+ // System/automated events — don't contribute to engagement_time_msec
11
+ const SYSTEM_EVENTS = new Set(['web_vital', 'error_event']);
12
+ function sanitizeEventName(name) {
13
+ let result = name.replace(/[^a-zA-Z0-9_]/g, '_');
14
+ if (!/^[a-zA-Z]/.test(result))
15
+ result = 'e_' + result;
16
+ return result.slice(0, 40);
17
+ }
1
18
  export function trackToGA(eventName, properties, options) {
2
19
  if (typeof window === 'undefined' || !window.gtag)
3
20
  return;
4
- const params = {
5
- session_id: options.sessionId,
6
- engagement_time_msec: 100,
7
- page_location: options.pageUrl,
8
- page_referrer: options.referrer,
9
- };
10
- const { marketing, userId } = options;
11
- if (marketing.utm_source)
12
- params.utm_source = marketing.utm_source;
13
- if (marketing.utm_medium)
14
- params.utm_medium = marketing.utm_medium;
15
- if (marketing.utm_campaign)
16
- params.utm_campaign = marketing.utm_campaign;
17
- if (marketing.utm_term)
18
- params.utm_term = marketing.utm_term;
19
- if (marketing.utm_content)
20
- params.utm_content = marketing.utm_content;
21
- if (userId)
22
- params.user_id = userId;
23
- Object.assign(params, properties);
24
- window.gtag('event', eventName, params);
21
+ // Sanitize event name for GA4 compliance
22
+ const safeName = GA4_RESERVED_NAMES.has(eventName)
23
+ ? `custom_${eventName}`.slice(0, 40)
24
+ : sanitizeEventName(eventName);
25
+ // Business properties first, then GA reserved fields override — prevents
26
+ // caller properties from corrupting session_id / page_location etc.
27
+ const params = { ...properties };
28
+ params.session_id = options.sessionId;
29
+ params.page_location = options.pageUrl;
30
+ params.page_referrer = options.referrer;
31
+ // engagement_time_msec only for user-facing events, not automated system events
32
+ if (!SYSTEM_EVENTS.has(eventName)) {
33
+ params.engagement_time_msec = 100;
34
+ }
35
+ window.gtag('event', safeName, params);
25
36
  }
26
37
  export function setGAUserId(userId) {
27
38
  if (typeof window === 'undefined' || !window.gtag)
@@ -33,3 +44,23 @@ export function setGAUserProperties(properties) {
33
44
  return;
34
45
  window.gtag('set', 'user_properties', properties);
35
46
  }
47
+ // Set UTM attribution once at session level — GA4 auto-associates with all
48
+ // subsequent events, no need to repeat on every event payload
49
+ export function setGAMarketing(marketing) {
50
+ if (typeof window === 'undefined' || !window.gtag)
51
+ return;
52
+ const params = {};
53
+ if (marketing.utm_source)
54
+ params.utm_source = marketing.utm_source;
55
+ if (marketing.utm_medium)
56
+ params.utm_medium = marketing.utm_medium;
57
+ if (marketing.utm_campaign)
58
+ params.utm_campaign = marketing.utm_campaign;
59
+ if (marketing.utm_term)
60
+ params.utm_term = marketing.utm_term;
61
+ if (marketing.utm_content)
62
+ params.utm_content = marketing.utm_content;
63
+ if (Object.keys(params).length > 0) {
64
+ window.gtag('set', params);
65
+ }
66
+ }
@@ -0,0 +1,3 @@
1
+ import { GTMConfig } from '../types';
2
+ export declare function initGTM(config: GTMConfig): void;
3
+ //# sourceMappingURL=gtm-loader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gtm-loader.d.ts","sourceRoot":"","sources":["../../src/core/gtm-loader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAErC,wBAAgB,OAAO,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAyC/C"}
@@ -0,0 +1,38 @@
1
+ export function initGTM(config) {
2
+ if (!config.enabled || !config.containerId)
3
+ return;
4
+ if (typeof window === 'undefined')
5
+ return;
6
+ const dataLayerName = config.dataLayerName || 'dataLayer';
7
+ const w = window;
8
+ // Initialize dataLayer before the script loads so queued pushes are preserved
9
+ if (!Array.isArray(w[dataLayerName])) {
10
+ w[dataLayerName] = [];
11
+ }
12
+ w[dataLayerName].push({ 'gtm.start': new Date().getTime(), event: 'gtm.js' });
13
+ // Inject <head> script if not already present
14
+ const existingScript = document.querySelector(`script[src*="googletagmanager.com/gtm.js?id=${config.containerId}"]`);
15
+ if (!existingScript) {
16
+ const dl = dataLayerName !== 'dataLayer' ? `&l=${encodeURIComponent(dataLayerName)}` : '';
17
+ const script = document.createElement('script');
18
+ script.async = true;
19
+ script.src = `https://www.googletagmanager.com/gtm.js?id=${config.containerId}${dl}`;
20
+ const firstScript = document.getElementsByTagName('script')[0];
21
+ firstScript.parentNode?.insertBefore(script, firstScript);
22
+ }
23
+ // Inject <body> noscript fallback if not already present
24
+ if (!document.querySelector(`noscript[data-gtm-id="${config.containerId}"]`)) {
25
+ const noscript = document.createElement('noscript');
26
+ noscript.setAttribute('data-gtm-id', config.containerId);
27
+ const iframe = document.createElement('iframe');
28
+ iframe.src = `https://www.googletagmanager.com/ns.html?id=${config.containerId}`;
29
+ iframe.height = '0';
30
+ iframe.width = '0';
31
+ iframe.style.display = 'none';
32
+ iframe.style.visibility = 'hidden';
33
+ noscript.appendChild(iframe);
34
+ if (document.body) {
35
+ document.body.insertBefore(noscript, document.body.firstChild);
36
+ }
37
+ }
38
+ }
@@ -0,0 +1,19 @@
1
+ declare global {
2
+ interface Window {
3
+ dataLayer: unknown[];
4
+ }
5
+ }
6
+ export declare class GTMManager {
7
+ private _initialized;
8
+ private _containerId;
9
+ private _dataLayerName;
10
+ get ready(): boolean;
11
+ get containerId(): string | undefined;
12
+ push(data: Record<string, unknown>): void;
13
+ track(eventName: string, properties?: Record<string, unknown>): void;
14
+ setUserId(userId: string | null): void;
15
+ setUserProperties(properties: Record<string, unknown>): void;
16
+ _init(containerId: string, dataLayerName?: string): void;
17
+ _destroy(): void;
18
+ }
19
+ //# sourceMappingURL=gtm-manager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gtm-manager.d.ts","sourceRoot":"","sources":["../../src/core/gtm-manager.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,SAAS,EAAE,OAAO,EAAE,CAAC;KACtB;CACF;AAED,qBAAa,UAAU;IACrB,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,YAAY,CAAqB;IACzC,OAAO,CAAC,cAAc,CAAe;IAErC,IAAI,KAAK,IAAI,OAAO,CAEnB;IAED,IAAI,WAAW,IAAI,MAAM,GAAG,SAAS,CAEpC;IAED,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IASzC,KAAK,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAIpE,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAItC,iBAAiB,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAI5D,KAAK,CAAC,WAAW,EAAE,MAAM,EAAE,aAAa,SAAc,GAAG,IAAI;IAM7D,QAAQ,IAAI,IAAI;CAIjB"}
@@ -0,0 +1,39 @@
1
+ export class GTMManager {
2
+ constructor() {
3
+ this._initialized = false;
4
+ this._dataLayerName = 'dataLayer';
5
+ }
6
+ get ready() {
7
+ return this._initialized && typeof window !== 'undefined';
8
+ }
9
+ get containerId() {
10
+ return this._containerId;
11
+ }
12
+ push(data) {
13
+ if (!this.ready)
14
+ return;
15
+ const w = window;
16
+ const dl = w[this._dataLayerName];
17
+ if (Array.isArray(dl)) {
18
+ dl.push(data);
19
+ }
20
+ }
21
+ track(eventName, properties) {
22
+ this.push({ event: eventName, ...(properties || {}) });
23
+ }
24
+ setUserId(userId) {
25
+ this.push({ userId: userId ?? undefined });
26
+ }
27
+ setUserProperties(properties) {
28
+ this.push(properties);
29
+ }
30
+ _init(containerId, dataLayerName = 'dataLayer') {
31
+ this._containerId = containerId;
32
+ this._dataLayerName = dataLayerName;
33
+ this._initialized = true;
34
+ }
35
+ _destroy() {
36
+ this._initialized = false;
37
+ this._containerId = undefined;
38
+ }
39
+ }
package/dist/index.d.ts CHANGED
@@ -6,11 +6,11 @@ export { initAutoTrack } from './core/auto-track';
6
6
  export type { AutoTrackAPI } from './core/auto-track';
7
7
  export { initErrorMonitor } from './core/error-monitor';
8
8
  export type { ErrorMonitorAPI } from './core/error-monitor';
9
- export { GAManager } from './core/ga-manager';
9
+ export { GTMManager } from './core/gtm-manager';
10
10
  export { initPerformanceMonitor } from './core/performance-monitor';
11
11
  export type { PerformanceMonitorAPI } from './core/performance-monitor';
12
12
  export { collectContext, collectMarketing } from './core/context-collector';
13
- export type { AnalyticsConfig, AnalyticsPayload, EventPayload, EventProperties, EventContext, ContextPayload, MarketingPayload, BrowserInfo, OSInfo, TrackOptions, TrackEvent, QueueItem, UserProfile, Environment, PerformanceConfig, GAConfig, GAConsentMode, GAConsentParams, } from './types';
13
+ export type { AnalyticsConfig, AnalyticsPayload, EventPayload, EventProperties, EventContext, ContextPayload, MarketingPayload, BrowserInfo, OSInfo, TrackOptions, TrackEvent, QueueItem, UserProfile, Environment, PerformanceConfig, GTMConfig, } from './types';
14
14
  export { API_KEY_MAP, SDK_VERSION, DEFAULT_CONFIG, STORAGE_KEYS, } from './types';
15
15
  export { generateUUID, generateId, getTimestamp, isObject, merge, detectBrowser, detectOS, getDeviceType, getScreenSize, getPageUrl, getReferrer, getHostname, getTimezone, getLanguage, getCountryFromLanguage, parseUTMParams, isBrowser, truncateText, } from './utils';
16
16
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,YAAY,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,YAAY,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,sBAA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MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpE,YAAY,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACxE,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAE5E,YAAY,EACV,eAAe,EACf,gBAAgB,EAChB,YAAY,EACZ,eAAe,EACf,YAAY,EACZ,cAAc,EACd,gBAAgB,EAChB,WAAW,EACX,MAAM,EACN,YAAY,EACZ,UAAU,EACV,SAAS,EACT,WAAW,EACX,WAAW,EACX,iBAAiB,EACjB,SAAS,GACV,MAAM,SAAS,CAAC;AAEjB,OAAO,EACL,WAAW,EACX,WAAW,EACX,cAAc,EACd,YAAY,GACb,MAAM,SAAS,CAAC;AAEjB,OAAO,EACL,YAAY,EACZ,UAAU,EACV,YAAY,EACZ,QAAQ,EACR,KAAK,EACL,aAAa,EACb,QAAQ,EACR,aAAa,EACb,aAAa,EACb,UAAU,EACV,WAAW,EACX,WAAW,EACX,WAAW,EACX,WAAW,EACX,sBAAsB,EACtB,cAAc,EACd,SAAS,EACT,YAAY,GACb,MAAM,SAAS,CAAC"}
package/dist/index.js CHANGED
@@ -4,7 +4,7 @@ export { StorageQueue } from './core/storage';
4
4
  export { SessionManager } from './core/session-manager';
5
5
  export { initAutoTrack } from './core/auto-track';
6
6
  export { initErrorMonitor } from './core/error-monitor';
7
- export { GAManager } from './core/ga-manager';
7
+ export { GTMManager } from './core/gtm-manager';
8
8
  export { initPerformanceMonitor } from './core/performance-monitor';
9
9
  export { collectContext, collectMarketing } from './core/context-collector';
10
10
  export { API_KEY_MAP, SDK_VERSION, DEFAULT_CONFIG, STORAGE_KEYS, } from './types';
@@ -77,19 +77,10 @@ export interface AnalyticsPayload {
77
77
  export interface PerformanceConfig {
78
78
  enabled?: boolean;
79
79
  }
80
- export type GAConsentMode = 'default' | 'update';
81
- export interface GAConsentParams {
82
- ad_storage?: 'granted' | 'denied';
83
- analytics_storage?: 'granted' | 'denied';
84
- ad_user_data?: 'granted' | 'denied';
85
- ad_personalization?: 'granted' | 'denied';
86
- [key: string]: unknown;
87
- }
88
- export interface GAConfig {
89
- measurementId: string;
80
+ export interface GTMConfig {
81
+ containerId: string;
90
82
  enabled: boolean;
91
- sendPageView?: boolean;
92
- debugMode?: boolean;
83
+ dataLayerName?: string;
93
84
  }
94
85
  export interface AnalyticsConfig {
95
86
  appKey?: string;
@@ -98,6 +89,7 @@ export interface AnalyticsConfig {
98
89
  env?: Environment;
99
90
  debug?: boolean;
100
91
  autoTrack?: boolean;
92
+ autoTrackPageView?: boolean;
101
93
  system?: string;
102
94
  domain?: string;
103
95
  keyEvents?: string[];
@@ -107,8 +99,9 @@ export interface AnalyticsConfig {
107
99
  sessionTimeout?: number;
108
100
  autoTrackSelector?: string;
109
101
  performance?: PerformanceConfig;
110
- ga?: GAConfig;
102
+ gtm?: GTMConfig;
111
103
  disableServer?: boolean;
104
+ sampleRate?: number;
112
105
  /** @deprecated use appKey instead */
113
106
  appId?: string;
114
107
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,aAAa,GAAG,MAAM,GAAG,SAAS,GAAG,KAAK,GAAG,KAAK,GAAG,MAAM,GAAG,YAAY,CAAC;AAE9G,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,MAAM;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,cAAc;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,Q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EnC,eAAO,MAAM,cAAc;;;;;;;;;CASjB,CAAC;AAEX,eAAO,MAAM,YAAY;;;;;;CAMf,CAAC;AAMX,eAAO,MAAM,iBAAiB,MAAM,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "onerway-analytics",
3
- "version": "1.0.2",
3
+ "version": "1.1.0",
4
4
  "description": "Onrway Analytics SDK",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",