Skip to content

Commit

Permalink
Forsøk på å sende med skjermbredde, skjermhøyde, vindusbredde, vindus…
Browse files Browse the repository at this point in the history
…høyde til amplitude
  • Loading branch information
matsbyfl committed Jan 24, 2025
1 parent fe3f130 commit 62bf7fa
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion client/src/utils/amplitude.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,16 @@ export async function initAmplitude(): Promise<void> {
if (!import.meta.env.PROD || window.appSettings.USE_MSW) return
const { AMPLITUDE_API_KEY: apiKey, AMPLITUDE_SERVER_URL: serverUrl } = window.appSettings
if (!(apiKey && serverUrl)) return
const { init, track } = await import('@amplitude/analytics-browser')
const { init, track, identify, Identify } = await import('@amplitude/analytics-browser')

identify(
new Identify()
.set('skjermbredde', window.screen.width)
.set('skjermhoyde', window.screen.height)
.set('vindusbredde', window.innerWidth)
.set('vindushoyde', window.innerHeight)
)

init(apiKey, undefined, {
serverUrl,
defaultTracking: false,
Expand Down

0 comments on commit 62bf7fa

Please sign in to comment.