GDRP friendly tracking in your astro app / site 🚀
Using the Astro CLI is the recommended way to setup integrations in Astro.
# npm
npx astro add astro-posthog
# pnpm
pnpm dlx astro add astro-posthog
When the automatic setup from Astro is not an option for you, feel free to install the package manually.
# npm
npm install astro-posthog
# pnpm
pnpm add astro-posthog
import { defineConfig } from 'astro/config';
import posthog from "astro-posthog";
// https://astro.build/config
export default defineConfig({
integrations: [
posthog({
posthogKey: 'phc_your-posthog-key',
api_host: 'https://eu.i.posthog.com',
defaults: '2025-05-24',
person_profiles: 'identified_only',
}),
]
});
© 2025-current, jop-software Inh. Johannes Przymusinski