Skip to content
This repository was archived by the owner on Sep 18, 2024. It is now read-only.

Commit b2fa38e

Browse files
committed
Utelater query-parametre fra amplitude logging
1 parent 7398c1e commit b2fa38e

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/utils/analytics/amplitude.ts

+7-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ import { InnloggingsstatusState } from '../../store/reducers/innloggingsstatus-d
44

55
type EventData = Record<string, any>;
66

7+
const buildPlatformField = () => {
8+
const { origin, pathname, hash } = window.location;
9+
return `${origin}${pathname}${hash}`;
10+
};
11+
712
export const initAmplitude = () => {
813
const userProps = {
914
skjermbredde: window.screen.width,
@@ -17,7 +22,7 @@ export const initAmplitude = () => {
1722
saveEvents: false,
1823
includeUtm: true,
1924
includeReferrer: true,
20-
platform: window.location.toString(),
25+
platform: buildPlatformField(),
2126
});
2227
amplitude.getInstance().setUserProperties(userProps);
2328

@@ -73,7 +78,7 @@ export const logAmplitudeEvent = (eventName: string, eventData: EventData = {},
7378
eventName,
7479
{
7580
...eventData,
76-
platform: window.location.toString(),
81+
platform: buildPlatformField(),
7782
origin,
7883
originVersion: eventData.originVersion || 'unknown',
7984
viaDekoratoren: true,

0 commit comments

Comments
 (0)