Skip to content

Commit

Permalink
Sensurer logging (#125)
Browse files Browse the repository at this point in the history
* Fjern logging av window.location

* Release 6.10.2
  • Loading branch information
peterbb authored Sep 1, 2023
1 parent 7e6ed4e commit 9c6eea3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@navikt/bedriftsmeny",
"version": "6.10.1",
"version": "6.10.2",
"description": "Bedriftsvelger og -meny for innlogget arbeidsgiver. Laget av TAG (Tjenester for Arbeidsgivere).",
"author": "NAVIKT",
"license": "MIT",
Expand Down
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 9c6eea3

Please sign in to comment.