Pirsch
Pirsch provides privacy-friendly, cookieless web analytics. The official embed loads a single deferred script with an id of pianjs and your data-code identification code. c15t preserves that script id so the Pirsch loader can find its own element and read the configured attributes.
Integrate with c15t
import { type ReactNode } from 'react';
import { ConsentManagerProvider } from '@c15t/react';
import { pirsch } from '@c15t/scripts/pirsch';
const scripts = [
pirsch({
identificationCode: 'YOUR_IDENTIFICATION_CODE',
}),
];
export function ConsentProvider({ children }: { children: ReactNode }) {
return (
<ConsentManagerProvider
options={{
mode: 'hosted',
backendURL: 'https://your-instance.c15t.dev',
scripts,
}}
>
{children}
</ConsentManagerProvider>
);
}How c15t loads it
- Category:
measurement(Analytics) - Loads when: measurement consent is granted
- On revocation: unloaded — c15t removes the script element from the DOM. Pirsch is cookieless, so no client-side cookies need clearing.
The helper maps Pirsch's core script attributes:
pirsch({
identificationCode: 'YOUR_IDENTIFICATION_CODE',
domain: 'rollup.example.com:ROLLUP_IDENTIFICATION_CODE',
dev: 'example.com',
hitEndpoint: 'https://analytics.example.com/hit',
eventEndpoint: 'https://analytics.example.com/event',
disablePageViews: true,
})Use the extended loader when you need Pirsch's extended script variant:
pirsch({
identificationCode: 'YOUR_IDENTIFICATION_CODE',
extended: true,
})To proxy or self-host the loader, pass a custom URL:
pirsch({
identificationCode: 'YOUR_IDENTIFICATION_CODE',
scriptUrl: 'https://analytics.example.com/pa.js',
})Types
PirschOptions
Warning: ExtractedTypeTable: Could not extract "PirschOptions" from "./packages/scripts/src/vendors/analytics/pirsch.ts" using base path "/vercel/path0/apps/c15t-docs/.leadtype/c15t". Verify the path/name and that the file is included by your tsconfig.
Script
Warning: ExtractedTypeTable: Could not extract "Script" from "./packages/core/src/libs/script-loader/types.ts" using base path "/vercel/path0/apps/c15t-docs/.leadtype/c15t". Verify the path/name and that the file is included by your tsconfig.