From f0b3ad16f7f64d72d4d786260ecdaeec6d4aff33 Mon Sep 17 00:00:00 2001 From: Viet Date: Wed, 14 May 2025 14:23:47 +0700 Subject: [PATCH 1/3] Add timezone --- src/utils/index.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/utils/index.ts b/src/utils/index.ts index ceae3fb..718e85f 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -46,6 +46,7 @@ const startTracker = async ( const queryString = window.location.search; const urlParams = new URLSearchParams(queryString); const ip = ''; + const userTimeZone = Intl.DateTimeFormat().resolvedOptions().timeZone?.toLowerCase(); try { const fingerprint = getFingerprint(); @@ -76,6 +77,7 @@ const startTracker = async ( browser_version: browser_version, lang: lang, device: device?.includes('iPhone') ? 'mobile' : device?.includes('iPad') ? 'tablet' : device, + timezone: userTimeZone, ...(attributes?.length && { event_name: 'visit', event_type: 'action', @@ -127,6 +129,7 @@ const trackEvent = async (endpoint: string, referer?: string, data?: object, _ur const lang = window.navigator['userLanguage'] || window.navigator.language; const device = browser?.platform?.model ?? browser?.platform?.type; const ip = ''; + const userTimeZone = Intl.DateTimeFormat().resolvedOptions().timeZone?.toLowerCase(); const fingerprint = getFingerprint(); const headers = { type: 'application/json' }; @@ -144,6 +147,7 @@ const trackEvent = async (endpoint: string, referer?: string, data?: object, _ur browser_name: browser_name, browser_version: browser_version, lang: lang, + timezone: userTimeZone, device: device?.includes('iPhone') ? 'mobile' : device?.includes('iPad') From 14dae8d699a834352f6c70bd9344b316b16971dd Mon Sep 17 00:00:00 2001 From: Viet Date: Wed, 14 May 2025 14:24:09 +0700 Subject: [PATCH 2/3] prepare to release --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e8fe3a6..2cf9e4c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "aesirx-analytics", - "version": "2.4.2", + "version": "2.4.3", "license": "GPL-3.0-only", "author": "AesirX", "repository": "https://gitlab.redweb.dk/aesirx/analytics", From 8cd2019375db385ca4d9368094edebd2d31b13f5 Mon Sep 17 00:00:00 2001 From: Viet Date: Wed, 14 May 2025 14:26:02 +0700 Subject: [PATCH 3/3] Update value --- src/utils/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/index.ts b/src/utils/index.ts index 718e85f..16b5dfb 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -46,7 +46,7 @@ const startTracker = async ( const queryString = window.location.search; const urlParams = new URLSearchParams(queryString); const ip = ''; - const userTimeZone = Intl.DateTimeFormat().resolvedOptions().timeZone?.toLowerCase(); + const userTimeZone = Intl.DateTimeFormat().resolvedOptions()?.timeZone; try { const fingerprint = getFingerprint(); @@ -129,7 +129,7 @@ const trackEvent = async (endpoint: string, referer?: string, data?: object, _ur const lang = window.navigator['userLanguage'] || window.navigator.language; const device = browser?.platform?.model ?? browser?.platform?.type; const ip = ''; - const userTimeZone = Intl.DateTimeFormat().resolvedOptions().timeZone?.toLowerCase(); + const userTimeZone = Intl.DateTimeFormat().resolvedOptions()?.timeZone; const fingerprint = getFingerprint(); const headers = { type: 'application/json' };