Skip to content

Commit

Permalink
Bruk amplitude til logging
Browse files Browse the repository at this point in the history
  • Loading branch information
ingfo committed Jan 3, 2025
1 parent c73fa3a commit 55f4f5d
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/components/ekspandertbart-panel/metrikk-ekspanderbartpanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {ExpansionCard} from '@navikt/ds-react';
import {logEvent} from '../../utils/frontend-logger';
import {finnSideNavn} from '../../middleware/metrics-middleware';
import '../toolbar/toolbar.css';
import {trackAmplitude} from '../../amplitude/amplitude';

interface Props {
tittel: string;
Expand All @@ -19,6 +20,22 @@ export function MetrikkEkspanderbartpanel({tittel, lamellNavnForLogging, childre
apen: !isApen,
sideNavn: finnSideNavn()
});

if (isApen) {
trackAmplitude({
name: 'accordion åpnet',
data: {
tekst: tittel
}
});
} else {
trackAmplitude({
name: 'accordion lukket',
data: {
tekst: tittel
}
});
}
};

return (
Expand Down

0 comments on commit 55f4f5d

Please sign in to comment.