Skip to content

Commit

Permalink
Bruker bare umami hvis vi er localhost eller demo
Browse files Browse the repository at this point in the history
  • Loading branch information
tepose committed Jan 6, 2025
1 parent 8fd5f75 commit ce35ac4
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions app/hooks/useAnalytics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useCallback } from "react";

import { IRapporteringsperiode } from "~/models/rapporteringsperiode.server";
import { DecoratorLocale } from "~/utils/dekoratoren.utils";
import { getEnv } from "~/utils/env.utils";
import { getEnv, isLocalOrDemo } from "~/utils/env.utils";
import { Rapporteringstype } from "~/utils/types";

import { useLocale } from "./useLocale";
Expand Down Expand Up @@ -43,11 +43,13 @@ export function useAnalytics() {

const trackEvent = useCallback(
<T extends object>(event: string, props: T = {} as T) => {
umami(event, {
skjemanavn,
språk,
...props,
});
if (isLocalOrDemo) {
umami(event, {
skjemanavn,
språk,
...props,
});
}

amplitude(event, {
skjemanavn,
Expand Down

0 comments on commit ce35ac4

Please sign in to comment.