Skip to content

Commit

Permalink
Fjern logging av window.location
Browse files Browse the repository at this point in the history
  • Loading branch information
peterbb committed Sep 1, 2023
1 parent 7e6ed4e commit 54fd84d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/bedriftsmeny/amplitudeProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,18 @@ interface Props {

export const AmplitudeLoggerContext = createContext<Context>({} as Context);

const getLimitedUrl = () => {
const {origin, pathname } = window.location;
return `${origin}/${pathname.split('/')[1]}`;
}

export const AmplitudeProvider: FunctionComponent<Props> = (props) => {

const loggBedriftValgt = () => {
if (props.amplitudeClient !== undefined) {
props.amplitudeClient.logEvent("virksomhetsklikk", {url:window.location.toString()})
props.amplitudeClient.logEvent("virksomhetsklikk", {
url: getLimitedUrl(),
})
}
}

Expand Down

0 comments on commit 54fd84d

Please sign in to comment.