Skip to content

Commit

Permalink
Add clientVersion to mobile analytics (#3498)
Browse files Browse the repository at this point in the history
  • Loading branch information
sliptype authored Jun 2, 2023
1 parent e2ba8ed commit 5523041
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/mobile/src/services/analytics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@ import VersionNumber from 'react-native-version-number'

import { versionInfo } from 'app/utils/appVersionWithCodepush'

import packageInfo from '../../package.json'
import type { Track, Screen, AllEvents } from '../types/analytics'
import { EventNames } from '../types/analytics'

const { version: clientVersion } = packageInfo

let analyticsSetupStatus: 'ready' | 'pending' | 'error' = 'pending'

const AmplitudeWriteKey = Config.AMPLITUDE_WRITE_KEY
Expand Down Expand Up @@ -76,6 +79,7 @@ export const track = async ({ eventName, properties }: Track) => {
const version = VersionNumber.appVersion
const propertiesWithContext = {
...properties,
clientVersion,
mobileClientVersion: version,
mobileClientVersionInclOTA: versionInfo ?? 'unknown'
}
Expand Down

0 comments on commit 5523041

Please sign in to comment.