Skip to content

Commit

Permalink
fix: posthog configuration (janhq#1283)
Browse files Browse the repository at this point in the history
fix: posthog configuration
  • Loading branch information
0xHieu01 authored Jan 2, 2024
2 parents 45fdadf + cf7aa61 commit 7e88f1c
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions web/utils/posthog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,25 @@ function getOperatingSystem(): string {
return 'Unknown'
}

// Function to capture app version and operating system
function captureAppVersionAndOS() {
const properties: Properties = {
appVersion: VERSION,
userOperatingSystem: getOperatingSystem(),
$appVersion: VERSION,
$userOperatingSystem: getOperatingSystem(),
// Set the following Posthog default properties to empty strings
$initial_browser: '',
$browser: '',
$initial_browser_version: '',
$browser_version: '',
$initial_current_url: '',
$current_url: '',
$initial_device_type: '',
$device_type: '',
$initial_pathname: '',
$pathname: '',
$initial_referrer: '',
$referrer: '',
$initial_referring_domain: '',
$referring_domain: '',
}
posthog.capture(AnalyticsEvent.Ping, properties)
}
Expand Down

0 comments on commit 7e88f1c

Please sign in to comment.