Skip to content

armgit / umami

Public Imported from GitHub
0

Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.

feat: add EdgeOne headers for geolocation detection​

Mintihuangad264f941d05
diff --git a/src/lib/detect.ts b/src/lib/detect.ts
index 68cb66726..910d122be 100644
--- a/src/lib/detect.ts
+++ b/src/lib/detect.ts
@@ -28,6 +28,12 @@ const PROVIDER_HEADERS = [
regionHeader: 'cloudfront-viewer-country-region',
cityHeader: 'cloudfront-viewer-city',
},
+ // EdgeOne headers (requires custom request headers in Rule Priorities, see: https://edgeone.ai/document/46151)
+ {
+ countryHeader: 'eo-ipcountry',
+ regionHeader: 'eo-region-code',
+ cityHeader: 'eo-ipcity',
+ },
];
export function getDevice(userAgent: string, screen: string = '') {