feat: add analytics (#528)
* feat: add analytics * feat: send data to umami * refactor: fix format * fix: click behavior of switches * refactor: format * chore: rerun ci --------- Co-authored-by: Meier Lukas <meierschlumpf@gmail.com>
This commit is contained in:
14
apps/nextjs/src/components/layout/analytics.tsx
Normal file
14
apps/nextjs/src/components/layout/analytics.tsx
Normal file
@@ -0,0 +1,14 @@
|
||||
import Script from "next/script";
|
||||
|
||||
import { UMAMI_WEBSITE_ID } from "@homarr/analytics";
|
||||
import { api } from "@homarr/api/server";
|
||||
|
||||
export const Analytics = async () => {
|
||||
const analytics = await api.serverSettings.getAnalytics();
|
||||
|
||||
if (analytics.enableGeneral) {
|
||||
return <Script src="https://umami.homarr.dev/script.js" data-website-id={UMAMI_WEBSITE_ID} defer />;
|
||||
}
|
||||
|
||||
return <></>;
|
||||
};
|
||||
Reference in New Issue
Block a user