Documentation
Documentation
import type { UseNetworkBlockerOptions } from '@c15t/svelte';
// Pass as `networkBlocker={networkBlocker}` on ConsentProvider.
export const networkBlocker: UseNetworkBlockerOptions = {
onRequestBlocked: ({ method, url }) => {
console.info('Blocked until consent', method, url);
},
rules: [
{
category: 'measurement',
domain: 'google-analytics.com',
id: 'google-analytics',
},
{
category: 'marketing',
domain: 'connect.facebook.net',
id: 'meta-pixel',
pathIncludes: '/signals',
},
],
};