@astroutils/analytics
which analytics provider are you using?
-
Install the package:
Terminal window pnpm add @astroutils/analyticsTerminal window yarn add @astroutils/analyticsTerminal window npm install @astroutils/analyticsTerminal window bun add @astroutils/analytics -
Add the
<Analytics />
component to your layout file:src/layouts/Layout.astro ---import { Analytics } from "@astroutils/analytics/umami";---...<Analyticshost="the url to the tracker script"websiteId="the website id from umami"/> {/* add this before the end of your <head> tag */}
don’t see your analytics provider? submit a new one!