diff --git a/package-lock.json b/package-lock.json index 35297f204388..00644d4e769b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ ], "dependencies": { "@babel/preset-typescript": "^7.24.7", - "@deriv-com/analytics": "1.26.1", + "@deriv-com/analytics": "1.26.2", "@sendbird/chat": "^4.9.7", "@types/react-transition-group": "^4.4.4", "babel-jest": "^29.7.0", @@ -2663,9 +2663,9 @@ } }, "node_modules/@deriv-com/analytics": { - "version": "1.26.1", - "resolved": "https://registry.npmjs.org/@deriv-com/analytics/-/analytics-1.26.1.tgz", - "integrity": "sha512-cZKv+yd4TnAlidUfkf9esANaRQ1tw+UGKMaaLfpWXMbl7g+hnWfKV22nUfPv8UFqeshEfYfQvcfB6EQHmjVBMQ==", + "version": "1.26.2", + "resolved": "https://registry.npmjs.org/@deriv-com/analytics/-/analytics-1.26.2.tgz", + "integrity": "sha512-9hFCLDig+Nu0WO0MlywjUfLtuOXAUEwiw/Ia40KlS9B2NS2NLhpA42NOFzMfW1T9PAkD8duUUlT9lkUkZmgjOQ==", "dependencies": { "@growthbook/growthbook": "^1.1.0", "@rudderstack/analytics-js": "^3.5.1", @@ -50499,7 +50499,7 @@ "license": "Apache-2.0", "dependencies": { "@binary-com/binary-document-uploader": "^2.4.8", - "@deriv-com/analytics": "1.26.1", + "@deriv-com/analytics": "1.26.2", "@deriv-com/quill-ui": "1.21.0", "@deriv-com/translations": "1.3.9", "@deriv-com/ui": "1.36.4", @@ -50607,7 +50607,7 @@ "uuid": "^9.0.1" }, "devDependencies": { - "@deriv-com/analytics": "1.26.1", + "@deriv-com/analytics": "1.26.2", "@deriv/api-types": "1.0.172", "@testing-library/react": "^12.1.5", "@testing-library/react-hooks": "^7.0.2", @@ -50646,7 +50646,7 @@ "version": "0.0.4", "license": "Apache-2.0", "dependencies": { - "@deriv-com/analytics": "1.26.1", + "@deriv-com/analytics": "1.26.2", "@deriv-com/translations": "1.3.9", "@deriv-com/ui": "1.36.4", "@deriv/account": "^1.0.0", @@ -50862,7 +50862,7 @@ "name": "@deriv/cashier", "version": "1.0.0", "dependencies": { - "@deriv-com/analytics": "1.26.1", + "@deriv-com/analytics": "1.26.2", "@deriv-com/ui": "1.36.4", "@deriv/api": "^1.0.0", "@deriv/api-types": "1.0.172", @@ -50939,7 +50939,7 @@ "version": "1.0.0", "license": "Apache-2.0", "dependencies": { - "@deriv-com/analytics": "1.26.1", + "@deriv-com/analytics": "1.26.2", "@deriv-com/translations": "1.3.9", "@deriv-com/ui": "1.36.4", "@deriv-com/utils": "^0.0.36", @@ -51144,7 +51144,7 @@ "dependencies": { "@babel/polyfill": "^7.12.1 ", "@datadog/browser-rum": "^5.11.0", - "@deriv-com/analytics": "1.26.1", + "@deriv-com/analytics": "1.26.2", "@deriv-com/quill-tokens": "2.0.4", "@deriv-com/quill-ui": "1.21.0", "@deriv-com/translations": "1.3.9", @@ -51279,7 +51279,7 @@ "version": "1.0.0", "dependencies": { "@binary-com/binary-document-uploader": "^2.4.8", - "@deriv-com/analytics": "1.26.1", + "@deriv-com/analytics": "1.26.2", "@deriv-com/auth-client": "1.0.29", "@deriv-com/ui": "1.36.4", "@deriv-com/utils": "^0.0.36", @@ -51338,7 +51338,7 @@ "version": "0.7.3", "license": "ISC", "dependencies": { - "@deriv-com/analytics": "1.26.1", + "@deriv-com/analytics": "1.26.2", "@deriv-com/ui": "1.36.4", "@deriv-com/utils": "^0.0.36", "@deriv/api": "^1.0.0", @@ -51492,7 +51492,7 @@ "license": "Apache-2.0", "dependencies": { "@babel/polyfill": "^7.12.1 ", - "@deriv-com/analytics": "1.26.1", + "@deriv-com/analytics": "1.26.2", "@deriv-com/ui": "1.36.4", "@deriv/api-types": "1.0.172", "@deriv/components": "^1.0.0", @@ -51588,7 +51588,7 @@ "version": "1.0.0", "license": "Apache-2.0", "dependencies": { - "@deriv-com/analytics": "1.26.1", + "@deriv-com/analytics": "1.26.2", "@deriv-com/utils": "^0.0.36", "@deriv/api-types": "1.0.172", "@deriv/quill-icons": "1.23.3", @@ -51658,7 +51658,7 @@ "version": "3.8.0", "license": "Apache-2.0", "dependencies": { - "@deriv-com/analytics": "1.26.1", + "@deriv-com/analytics": "1.26.2", "@deriv-com/quill-tokens": "2.0.4", "@deriv-com/quill-ui": "1.21.0", "@deriv-com/ui": "1.36.4", @@ -51844,7 +51844,7 @@ "name": "@deriv/wallets", "version": "1.0.0", "dependencies": { - "@deriv-com/analytics": "1.26.1", + "@deriv-com/analytics": "1.26.2", "@deriv-com/translations": "1.3.9", "@deriv-com/ui": "1.36.4", "@deriv-com/utils": "^0.0.36", diff --git a/package.json b/package.json index da0c3a8b35f9..8eaa8a30b715 100644 --- a/package.json +++ b/package.json @@ -105,7 +105,7 @@ }, "dependencies": { "@babel/preset-typescript": "^7.24.7", - "@deriv-com/analytics": "1.26.1", + "@deriv-com/analytics": "1.26.2", "@sendbird/chat": "^4.9.7", "@types/react-transition-group": "^4.4.4", "babel-jest": "^29.7.0", diff --git a/packages/account/package.json b/packages/account/package.json index b8dbd4fe8084..ddf2e3d2a5d5 100644 --- a/packages/account/package.json +++ b/packages/account/package.json @@ -30,7 +30,7 @@ }, "dependencies": { "@binary-com/binary-document-uploader": "^2.4.8", - "@deriv-com/analytics": "1.26.1", + "@deriv-com/analytics": "1.26.2", "@deriv-com/translations": "1.3.9", "@deriv-com/utils": "^0.0.36", "@deriv-com/ui": "1.36.4", diff --git a/packages/api-v2/package.json b/packages/api-v2/package.json index 16af3718ef49..cf296b7b0d18 100644 --- a/packages/api-v2/package.json +++ b/packages/api-v2/package.json @@ -16,7 +16,7 @@ "uuid": "^9.0.1" }, "devDependencies": { - "@deriv-com/analytics": "1.26.1", + "@deriv-com/analytics": "1.26.2", "@deriv/api-types": "1.0.172", "@testing-library/react": "^12.1.5", "@testing-library/react-hooks": "^7.0.2", diff --git a/packages/appstore/package.json b/packages/appstore/package.json index 96b7d9aea58b..19a0422671f9 100644 --- a/packages/appstore/package.json +++ b/packages/appstore/package.json @@ -26,7 +26,7 @@ "author": "Deriv", "license": "Apache-2.0", "dependencies": { - "@deriv-com/analytics": "1.26.1", + "@deriv-com/analytics": "1.26.2", "@deriv-com/translations": "1.3.9", "@deriv-com/ui": "1.36.4", "@deriv/account": "^1.0.0", diff --git a/packages/cashier/package.json b/packages/cashier/package.json index f7d72bd6f908..d96624ee48fd 100644 --- a/packages/cashier/package.json +++ b/packages/cashier/package.json @@ -37,7 +37,7 @@ "url": "https://github.com/deriv-com/deriv-app/issues" }, "dependencies": { - "@deriv-com/analytics": "1.26.1", + "@deriv-com/analytics": "1.26.2", "@deriv-com/ui": "1.36.4", "@deriv/api": "^1.0.0", "@deriv/api-types": "1.0.172", diff --git a/packages/cfd/package.json b/packages/cfd/package.json index 1f1e86da39ac..f2c445800db1 100644 --- a/packages/cfd/package.json +++ b/packages/cfd/package.json @@ -86,7 +86,7 @@ }, "dependencies": { "@deriv-com/ui": "1.36.4", - "@deriv-com/analytics": "1.26.1", + "@deriv-com/analytics": "1.26.2", "@deriv-com/translations": "1.3.9", "@deriv-com/utils": "^0.0.36", "@deriv/account": "^1.0.0", diff --git a/packages/core/package.json b/packages/core/package.json index d450e348cd16..1d14849cedb2 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -95,7 +95,7 @@ }, "dependencies": { "@datadog/browser-rum": "^5.11.0", - "@deriv-com/analytics": "1.26.1", + "@deriv-com/analytics": "1.26.2", "@deriv-com/quill-tokens": "2.0.4", "@deriv-com/quill-ui": "1.21.0", "@deriv-com/translations": "1.3.9", diff --git a/packages/core/src/Utils/Analytics/index.ts b/packages/core/src/Utils/Analytics/index.ts index 5cbb8d5a8c7d..978de6b5c388 100644 --- a/packages/core/src/Utils/Analytics/index.ts +++ b/packages/core/src/Utils/Analytics/index.ts @@ -44,6 +44,9 @@ export const AnalyticsInitializer = async () => { utm_content: ppc_campaign_cookies?.utm_content, domain: window.location.hostname, url: window.location.href, + network_type: navigator.connection?.effectiveType, + network_rtt: navigator.connection?.rtt, + network_downlink: navigator.connection?.downlink, }, }, }; diff --git a/packages/hooks/package.json b/packages/hooks/package.json index 082b3794db18..359cd45b98d9 100644 --- a/packages/hooks/package.json +++ b/packages/hooks/package.json @@ -6,7 +6,7 @@ "sideEffects": false, "dependencies": { "@binary-com/binary-document-uploader": "^2.4.8", - "@deriv-com/analytics": "1.26.1", + "@deriv-com/analytics": "1.26.2", "@deriv/api": "^1.0.0", "@deriv-com/auth-client": "1.0.29", "@deriv/stores": "^1.0.0", diff --git a/packages/p2p/package.json b/packages/p2p/package.json index 3270f36b5255..3c9228ececd7 100644 --- a/packages/p2p/package.json +++ b/packages/p2p/package.json @@ -33,7 +33,7 @@ "license": "ISC", "dependencies": { "@deriv-com/ui": "1.36.4", - "@deriv-com/analytics": "1.26.1", + "@deriv-com/analytics": "1.26.2", "@deriv-com/utils": "^0.0.36", "@deriv/api": "^1.0.0", "@deriv/api-types": "1.0.172", diff --git a/packages/reports/package.json b/packages/reports/package.json index 1ed2f646b56f..5f0c9462443c 100644 --- a/packages/reports/package.json +++ b/packages/reports/package.json @@ -78,7 +78,7 @@ }, "dependencies": { "@deriv-com/ui": "1.36.4", - "@deriv-com/analytics": "1.26.1", + "@deriv-com/analytics": "1.26.2", "@deriv/components": "^1.0.0", "@deriv/deriv-api": "^1.0.15", "@deriv/api-types": "1.0.172", diff --git a/packages/shared/package.json b/packages/shared/package.json index 37674a592d0b..fdab7a167910 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -46,7 +46,7 @@ "typescript": "^4.6.3" }, "dependencies": { - "@deriv-com/analytics": "1.26.1", + "@deriv-com/analytics": "1.26.2", "@deriv/quill-icons": "1.23.3", "@deriv/api-types": "1.0.172", "@deriv/translations": "^1.0.0", diff --git a/packages/trader/package.json b/packages/trader/package.json index 8d079daee764..c9a155349ec2 100644 --- a/packages/trader/package.json +++ b/packages/trader/package.json @@ -88,7 +88,7 @@ "webpack-node-externals": "^2.5.2" }, "dependencies": { - "@deriv-com/analytics": "1.26.1", + "@deriv-com/analytics": "1.26.2", "@deriv-com/quill-tokens": "2.0.4", "@deriv-com/quill-ui": "1.21.0", "@deriv-com/utils": "^0.0.36", diff --git a/packages/wallets/package.json b/packages/wallets/package.json index 3cd2a6371c4d..6c0e763c4bde 100644 --- a/packages/wallets/package.json +++ b/packages/wallets/package.json @@ -14,7 +14,7 @@ "start": "rimraf dist && npm run test && npm run serve" }, "dependencies": { - "@deriv-com/analytics": "1.26.1", + "@deriv-com/analytics": "1.26.2", "@deriv-com/translations": "1.3.9", "@deriv-com/ui": "1.36.4", "@deriv-com/utils": "^0.0.36", diff --git a/types/global.d.ts b/types/global.d.ts index a9677c64eb12..60a941ed0e00 100644 --- a/types/global.d.ts +++ b/types/global.d.ts @@ -43,12 +43,22 @@ declare global { // eslint-disable-next-line @typescript-eslint/no-explicit-any Analytics: any; GrowthbookFeatures: { [key: string]: boolean }; + navigator: Navigator; } + interface FreshChatConfig { token: string | null; locale?: string; hideButton?: boolean; } + interface Navigator { + connection?: NetworkInformation; + } + interface NetworkInformation { + effectiveType?: 'slow-2g' | '2g' | '3g' | '4g'; + rtt?: number; + downlink?: number; + } } export {};