@c15t/scripts 3.0.0-alpha.1 → 3.0.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +4 -0
- package/README.md +3 -3
- package/dist/e2e-test-utils.js +5 -3
- package/dist/events.js +218 -0
- package/dist/registry.js +30 -0
- package/dist/vendors/ads-and-pixels/pinterest-tag.js +123 -0
- package/dist/vendors/analytics/google-tag.js +14 -2
- package/dist/vendors/analytics/one-dollar-stats.js +30 -0
- package/dist/vendors/analytics/segment.js +10 -1
- package/dist/vendors/functional/front-chat.js +64 -0
- package/dist/vendors/tag-managers/google-tag-manager.js +17 -3
- package/dist-types/events.d.ts +46 -0
- package/dist-types/registry.d.ts +27 -0
- package/dist-types/vendors/ads-and-pixels/pinterest-tag.d.ts +295 -0
- package/dist-types/vendors/analytics/google-tag.d.ts +3 -1
- package/dist-types/vendors/analytics/one-dollar-stats.d.ts +39 -0
- package/dist-types/vendors/analytics/segment.d.ts +7 -1
- package/dist-types/vendors/functional/front-chat.d.ts +62 -0
- package/dist-types/vendors/tag-managers/google-tag-manager.d.ts +3 -1
- package/docs/README.md +4 -0
- package/docs/customization/overview.md +4 -3
- package/docs/customization/recipes.md +4 -2
- package/docs/customization/tokens.md +66 -3
- package/docs/frameworks/javascript/script-loader.md +6 -0
- package/docs/frameworks/next/script-loader.md +18 -12
- package/docs/frameworks/react/script-loader.md +6 -0
- package/docs/guides/consent-state.md +327 -0
- package/docs/guides/shared-consent-controls.md +158 -0
- package/docs/integrations/adobe-analytics.md +1 -1
- package/docs/integrations/ahrefs-analytics.md +1 -1
- package/docs/integrations/amplitude.md +1 -1
- package/docs/integrations/clearbit.md +1 -1
- package/docs/integrations/cloudflare-web-analytics.md +1 -1
- package/docs/integrations/cloudflare-zaraz.md +1 -1
- package/docs/integrations/crisp.md +1 -1
- package/docs/integrations/databuddy.md +1 -1
- package/docs/integrations/fathom-analytics.md +1 -1
- package/docs/integrations/front-chat.md +322 -0
- package/docs/integrations/google-maps.md +1 -1
- package/docs/integrations/google-tag-manager.md +1 -1
- package/docs/integrations/google-tag.md +1 -1
- package/docs/integrations/granular-consent.md +3 -1
- package/docs/integrations/heap.md +1 -1
- package/docs/integrations/hightouch.md +1 -1
- package/docs/integrations/hotjar.md +1 -1
- package/docs/integrations/intercom.md +1 -1
- package/docs/integrations/linkedin-insights.md +1 -1
- package/docs/integrations/logrocket.md +1 -1
- package/docs/integrations/matomo-analytics.md +1 -1
- package/docs/integrations/meta-pixel.md +1 -1
- package/docs/integrations/microsoft-clarity.md +1 -1
- package/docs/integrations/microsoft-uet.md +1 -1
- package/docs/integrations/mixpanel-analytics.md +1 -1
- package/docs/integrations/one-dollar-stats.md +305 -0
- package/docs/integrations/openai-pixel.md +1 -1
- package/docs/integrations/overview.md +17 -14
- package/docs/integrations/pinterest-tag.md +321 -0
- package/docs/integrations/pirsch.md +1 -1
- package/docs/integrations/plausible-analytics.md +1 -1
- package/docs/integrations/posthog.md +1 -1
- package/docs/integrations/promptwatch.md +1 -1
- package/docs/integrations/reddit-pixel.md +1 -1
- package/docs/integrations/rudderstack.md +1 -1
- package/docs/integrations/rybbit-analytics.md +1 -1
- package/docs/integrations/segment.md +1 -1
- package/docs/integrations/snapchat-pixel.md +1 -1
- package/docs/integrations/tiktok-pixel.md +1 -1
- package/docs/integrations/umami-analytics.md +1 -1
- package/docs/integrations/vercel-analytics.md +1 -1
- package/docs/integrations/x-pixel.md +1 -1
- package/docs/integrations/youtube.md +1 -1
- package/docs/upgrade-v3.md +129 -1
- package/package.json +25 -2
|
@@ -194,7 +194,7 @@ clientEntrypoint: fileURLToPath(new URL('./src/c15t.client.ts', import.meta.url)
|
|
|
194
194
|
Export the scripts from that module:
|
|
195
195
|
|
|
196
196
|
```ts title="src/c15t.client.ts"
|
|
197
|
-
import type { C15tClientOptionsExtension } from '
|
|
197
|
+
import type { C15tClientOptionsExtension } from 'c15t/astro';
|
|
198
198
|
import { scripts } from './consent-scripts';
|
|
199
199
|
|
|
200
200
|
export default { scripts } satisfies C15tClientOptionsExtension;
|
|
@@ -203,7 +203,7 @@ clientEntrypoint: fileURLToPath(new URL('./src/c15t.client.ts', import.meta.url)
|
|
|
203
203
|
Export the scripts from that module:
|
|
204
204
|
|
|
205
205
|
```ts title="src/c15t.client.ts"
|
|
206
|
-
import type { C15tClientOptionsExtension } from '
|
|
206
|
+
import type { C15tClientOptionsExtension } from 'c15t/astro';
|
|
207
207
|
import { scripts } from './consent-scripts';
|
|
208
208
|
|
|
209
209
|
export default { scripts } satisfies C15tClientOptionsExtension;
|
|
@@ -196,7 +196,7 @@ clientEntrypoint: fileURLToPath(new URL('./src/c15t.client.ts', import.meta.url)
|
|
|
196
196
|
Export the scripts from that module:
|
|
197
197
|
|
|
198
198
|
```ts title="src/c15t.client.ts"
|
|
199
|
-
import type { C15tClientOptionsExtension } from '
|
|
199
|
+
import type { C15tClientOptionsExtension } from 'c15t/astro';
|
|
200
200
|
import { scripts } from './consent-scripts';
|
|
201
201
|
|
|
202
202
|
export default { scripts } satisfies C15tClientOptionsExtension;
|
|
@@ -194,7 +194,7 @@ clientEntrypoint: fileURLToPath(new URL('./src/c15t.client.ts', import.meta.url)
|
|
|
194
194
|
Export the scripts from that module:
|
|
195
195
|
|
|
196
196
|
```ts title="src/c15t.client.ts"
|
|
197
|
-
import type { C15tClientOptionsExtension } from '
|
|
197
|
+
import type { C15tClientOptionsExtension } from 'c15t/astro';
|
|
198
198
|
import { scripts } from './consent-scripts';
|
|
199
199
|
|
|
200
200
|
export default { scripts } satisfies C15tClientOptionsExtension;
|
|
@@ -194,7 +194,7 @@ clientEntrypoint: fileURLToPath(new URL('./src/c15t.client.ts', import.meta.url)
|
|
|
194
194
|
Export the scripts from that module:
|
|
195
195
|
|
|
196
196
|
```ts title="src/c15t.client.ts"
|
|
197
|
-
import type { C15tClientOptionsExtension } from '
|
|
197
|
+
import type { C15tClientOptionsExtension } from 'c15t/astro';
|
|
198
198
|
import { scripts } from './consent-scripts';
|
|
199
199
|
|
|
200
200
|
export default { scripts } satisfies C15tClientOptionsExtension;
|
|
@@ -197,7 +197,7 @@ clientEntrypoint: fileURLToPath(new URL('./src/c15t.client.ts', import.meta.url)
|
|
|
197
197
|
Export the scripts from that module:
|
|
198
198
|
|
|
199
199
|
```ts title="src/c15t.client.ts"
|
|
200
|
-
import type { C15tClientOptionsExtension } from '
|
|
200
|
+
import type { C15tClientOptionsExtension } from 'c15t/astro';
|
|
201
201
|
import { scripts } from './consent-scripts';
|
|
202
202
|
|
|
203
203
|
export default { scripts } satisfies C15tClientOptionsExtension;
|
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: OneDollarStats
|
|
3
|
+
description: Load the OneDollarStats tracker with measurement permission,
|
|
4
|
+
forward its settings and verify loading and revocation.
|
|
5
|
+
group: integrations
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Configure OneDollarStats
|
|
9
|
+
|
|
10
|
+
OneDollarStats needs no API key. The helper loads the tracker after
|
|
11
|
+
measurement permission and forwards its settings as `data-*` attributes.
|
|
12
|
+
|
|
13
|
+
| Package manager | Command |
|
|
14
|
+
| :-------------- | :-------------------------- |
|
|
15
|
+
| npm | `npm install @c15t/scripts` |
|
|
16
|
+
| pnpm | `pnpm add @c15t/scripts` |
|
|
17
|
+
| yarn | `yarn add @c15t/scripts` |
|
|
18
|
+
| bun | `bun add @c15t/scripts` |
|
|
19
|
+
|
|
20
|
+
```ts title="src/consent-scripts.ts"
|
|
21
|
+
import { oneDollarStats } from '@c15t/scripts/one-dollar-stats';
|
|
22
|
+
|
|
23
|
+
export const scripts = [oneDollarStats()];
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Register the scripts
|
|
27
|
+
|
|
28
|
+
Complete your [framework quickstart](https://c15t.com/docs/frameworks) first. Keep its Inth
|
|
29
|
+
endpoint, policy, styles and consent UI. Remove the vendor's original script,
|
|
30
|
+
SDK initializer or tag-manager entry so c15t owns loading once.
|
|
31
|
+
|
|
32
|
+
The `scripts` export in `src/consent-scripts.ts` is a configuration, not an
|
|
33
|
+
initializer. Add it to your existing consent owner using the registration point
|
|
34
|
+
below. These are partial edits to that owner, not additional providers.
|
|
35
|
+
|
|
36
|
+
**Next.js**
|
|
37
|
+
|
|
38
|
+
Import the configuration into the client boundary from your router guide:
|
|
39
|
+
|
|
40
|
+
```ts
|
|
41
|
+
import { ConsentRoot } from 'c15t/next';
|
|
42
|
+
import { scripts } from './consent-scripts';
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Keep the server-resolved `state` and shared `consentConfig` from your
|
|
46
|
+
router guide. Its manifest, init and save URLs stay in effect. Add
|
|
47
|
+
`scripts` as a top-level prop on the existing root:
|
|
48
|
+
|
|
49
|
+
```tsx
|
|
50
|
+
<ConsentRoot state={state} config={consentConfig} scripts={scripts}>
|
|
51
|
+
{children}
|
|
52
|
+
</ConsentRoot>
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
For a Pages Router or static-export setup using `ConsentProvider`, add
|
|
56
|
+
`scripts` to its existing `options` instead. Keep the router-specific setup
|
|
57
|
+
from [Next.js script loading](../frameworks/next/script-loader.md).
|
|
58
|
+
|
|
59
|
+
**TanStack Start**
|
|
60
|
+
|
|
61
|
+
In your existing root route component, import the scripts alongside
|
|
62
|
+
`ConsentRoot`. Keep the server loader from the [TanStack Start quickstart](https://c15t.com/docs/frameworks/tanstack-start/quickstart).
|
|
63
|
+
|
|
64
|
+
```tsx
|
|
65
|
+
import { Outlet } from '@tanstack/react-router';
|
|
66
|
+
import { ConsentRoot } from 'c15t/tanstack-start';
|
|
67
|
+
import { scripts } from '../consent-scripts';
|
|
68
|
+
|
|
69
|
+
function Root() {
|
|
70
|
+
const state = Route.useLoaderData();
|
|
71
|
+
return (
|
|
72
|
+
<ConsentRoot state={state} backendURL={backendURL} initRoute={false} scripts={scripts}>
|
|
73
|
+
<Outlet />
|
|
74
|
+
{/* Keep your consent banner, dialog and preferences link here. */}
|
|
75
|
+
</ConsentRoot>
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
This edits the existing route. `Route` and `backendURL` come from its setup;
|
|
81
|
+
keep the document shell and head components if they are part of your root.
|
|
82
|
+
`initRoute={false}` keeps the quickstart's direct-backend initialization.
|
|
83
|
+
If your app mounts a consent server route, retain its existing `initRoute`
|
|
84
|
+
instead. Do not return script callbacks from a server function or route loader.
|
|
85
|
+
|
|
86
|
+
**React**
|
|
87
|
+
|
|
88
|
+
Import the scripts into your existing provider component:
|
|
89
|
+
|
|
90
|
+
```ts
|
|
91
|
+
import { ConsentProvider } from 'c15t/react';
|
|
92
|
+
import { scripts } from './consent-scripts';
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Keep the existing options and add `scripts`:
|
|
96
|
+
|
|
97
|
+
```tsx
|
|
98
|
+
<ConsentProvider options={{ ...consentOptions, scripts }}>
|
|
99
|
+
{children}
|
|
100
|
+
</ConsentProvider>
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Here `consentOptions` is your existing configuration, including
|
|
104
|
+
`mode: hosted({ url: backendURL })`. Keep the banner, dialog and preferences
|
|
105
|
+
link inside the provider. See [React script loading](../frameworks/react/script-loader.md).
|
|
106
|
+
|
|
107
|
+
**Nuxt**
|
|
108
|
+
|
|
109
|
+
Attach one loader from the root `app.vue`, after the Nuxt module has
|
|
110
|
+
started its browser runtime. This keeps vendor callbacks in application code rather
|
|
111
|
+
than serialized `nuxt.config.ts` runtime configuration.
|
|
112
|
+
|
|
113
|
+
```vue title="app/app.vue"
|
|
114
|
+
<script setup lang="ts">
|
|
115
|
+
import { onUnmounted } from 'vue';
|
|
116
|
+
import { createScriptLoader } from 'c15t/modules/script-loader';
|
|
117
|
+
import { scripts } from '../src/consent-scripts';
|
|
118
|
+
|
|
119
|
+
const nuxtApp = useNuxtApp();
|
|
120
|
+
const kernel = useConsentKernel();
|
|
121
|
+
let loader: ReturnType<typeof createScriptLoader> | undefined;
|
|
122
|
+
|
|
123
|
+
const removeMountedHook = nuxtApp.hook('app:mounted', () => {
|
|
124
|
+
loader = createScriptLoader({ kernel, scripts });
|
|
125
|
+
});
|
|
126
|
+
onUnmounted(() => {
|
|
127
|
+
removeMountedHook();
|
|
128
|
+
loader?.dispose();
|
|
129
|
+
});
|
|
130
|
+
</script>
|
|
131
|
+
|
|
132
|
+
<template>
|
|
133
|
+
<ConsentRoot />
|
|
134
|
+
<NuxtPage />
|
|
135
|
+
</template>
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
Merge the setup code into your root and retain its footer and preferences
|
|
139
|
+
link. `useConsentKernel` is auto-imported by the c15t Nuxt module. Adjust the
|
|
140
|
+
relative script import if your `app.vue` is at the project root. This loader
|
|
141
|
+
waits until the module has applied browser persistence and privacy signals,
|
|
142
|
+
then reads the current snapshot and observes future changes. Do not also register these scripts
|
|
143
|
+
in another loader. See the [Nuxt quickstart](https://c15t.com/docs/frameworks/nuxt/quickstart).
|
|
144
|
+
|
|
145
|
+
**Vue**
|
|
146
|
+
|
|
147
|
+
Use the kernel already provided by the Vue plugin. Merge this setup into
|
|
148
|
+
`App.vue`, whose lifetime covers the application:
|
|
149
|
+
|
|
150
|
+
```vue title="src/App.vue"
|
|
151
|
+
<script setup lang="ts">
|
|
152
|
+
import { onMounted, onUnmounted } from 'vue';
|
|
153
|
+
import { createScriptLoader } from 'c15t/modules/script-loader';
|
|
154
|
+
import { useConsentKernel } from 'c15t/vue/vue-plugin';
|
|
155
|
+
import ConsentRoot from 'c15t/vue/consent-root';
|
|
156
|
+
import { scripts } from './consent-scripts';
|
|
157
|
+
|
|
158
|
+
const kernel = useConsentKernel();
|
|
159
|
+
let loader: ReturnType<typeof createScriptLoader> | undefined;
|
|
160
|
+
|
|
161
|
+
onMounted(() => {
|
|
162
|
+
loader = createScriptLoader({ kernel, scripts });
|
|
163
|
+
});
|
|
164
|
+
onUnmounted(() => loader?.dispose());
|
|
165
|
+
</script>
|
|
166
|
+
|
|
167
|
+
<template>
|
|
168
|
+
<ConsentRoot />
|
|
169
|
+
<main>Your application</main>
|
|
170
|
+
</template>
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
Keep your existing page content and preferences link. The plugin still owns
|
|
174
|
+
the kernel and persistence; this component owns only the vendor loader.
|
|
175
|
+
Do not register the same scripts in plugin configuration as well. See the
|
|
176
|
+
[Vue quickstart](https://c15t.com/docs/frameworks/vue/quickstart).
|
|
177
|
+
|
|
178
|
+
**Astro**
|
|
179
|
+
|
|
180
|
+
Point the existing Astro integration at a client module. Keep its `mode`,
|
|
181
|
+
`ui` and framework integration from the [Astro quickstart](https://c15t.com/docs/frameworks/astro/quickstart).
|
|
182
|
+
Import `fileURLToPath` in your Astro configuration:
|
|
183
|
+
|
|
184
|
+
```js title="astro.config.mjs"
|
|
185
|
+
import { fileURLToPath } from 'node:url';
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
Add this option to the existing `c15t({ ... })` call. Resolve the path from
|
|
189
|
+
the configuration file because Astro injects the import into a virtual module:
|
|
190
|
+
|
|
191
|
+
```js
|
|
192
|
+
clientEntrypoint: fileURLToPath(new URL('./src/c15t.client.ts', import.meta.url)),
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
Export the scripts from that module:
|
|
196
|
+
|
|
197
|
+
```ts title="src/c15t.client.ts"
|
|
198
|
+
import type { C15tClientOptionsExtension } from 'c15t/astro';
|
|
199
|
+
import { scripts } from './consent-scripts';
|
|
200
|
+
|
|
201
|
+
export default { scripts } satisfies C15tClientOptionsExtension;
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
The integration passes this extension to its shared browser runtime. Vendor
|
|
205
|
+
helpers contain callbacks, so do not put them in the serialized `scripts`
|
|
206
|
+
option in `astro.config.mjs`. Keep one runtime across consent islands and
|
|
207
|
+
`ClientRouter` navigation.
|
|
208
|
+
|
|
209
|
+
**Svelte**
|
|
210
|
+
|
|
211
|
+
Import the scripts in the component that owns your existing provider and
|
|
212
|
+
pass them as a top-level prop:
|
|
213
|
+
|
|
214
|
+
```svelte title="src/App.svelte"
|
|
215
|
+
<script lang="ts">
|
|
216
|
+
import { ConsentManagerProvider, hosted } from '@c15t/svelte';
|
|
217
|
+
import { scripts } from './consent-scripts';
|
|
218
|
+
|
|
219
|
+
const backendURL = import.meta.env.VITE_C15T_BACKEND_URL;
|
|
220
|
+
if (!backendURL) throw new Error('Set VITE_C15T_BACKEND_URL');
|
|
221
|
+
const mode = hosted({ url: backendURL });
|
|
222
|
+
</script>
|
|
223
|
+
|
|
224
|
+
<ConsentManagerProvider {mode} {scripts}>
|
|
225
|
+
<!-- Keep your application, consent UI and preferences link here. -->
|
|
226
|
+
</ConsentManagerProvider>
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
Retain the styles and consent UI from the [Svelte quickstart](https://c15t.com/docs/frameworks/svelte/quickstart).
|
|
230
|
+
The provider owns the loader and disposes it on unmount.
|
|
231
|
+
|
|
232
|
+
**SvelteKit**
|
|
233
|
+
|
|
234
|
+
Add the scripts to the existing root layout provider. Keep the server load
|
|
235
|
+
and its serializable prefetch data from the [SvelteKit quickstart](https://c15t.com/docs/frameworks/sveltekit/quickstart).
|
|
236
|
+
|
|
237
|
+
```svelte title="src/routes/+layout.svelte"
|
|
238
|
+
<script lang="ts">
|
|
239
|
+
import { ConsentManagerProvider, hosted } from '@c15t/svelte';
|
|
240
|
+
import { scripts } from '../consent-scripts';
|
|
241
|
+
|
|
242
|
+
let { children, data } = $props();
|
|
243
|
+
const mode = hosted({ url: data.backendURL });
|
|
244
|
+
</script>
|
|
245
|
+
|
|
246
|
+
<ConsentManagerProvider {mode} {scripts} prefetch={data.prefetch}>
|
|
247
|
+
{@render children()}
|
|
248
|
+
<!-- Keep your consent UI and preferences link here. -->
|
|
249
|
+
</ConsentManagerProvider>
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
Import vendor helpers in the layout component, not in `+layout.server.ts`.
|
|
253
|
+
For static hosting, keep your browser-only `mode` setup and omit request
|
|
254
|
+
prefetch; the `scripts` prop stays the same. If you pass an externally owned
|
|
255
|
+
`runtime` to the provider, register scripts when creating that runtime instead.
|
|
256
|
+
|
|
257
|
+
**JavaScript**
|
|
258
|
+
|
|
259
|
+
Attach the loader to your existing kernel before calling
|
|
260
|
+
`kernel.commands.init()`:
|
|
261
|
+
|
|
262
|
+
```ts
|
|
263
|
+
import { createScriptLoader } from 'c15t/modules/script-loader';
|
|
264
|
+
import { scripts } from './consent-scripts';
|
|
265
|
+
|
|
266
|
+
const loader = createScriptLoader({ kernel, scripts });
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
Call `loader.dispose()` when that application instance is destroyed.
|
|
270
|
+
`kernel` is the hosted kernel from your quickstart. A provider-owned kernel
|
|
271
|
+
already has a loader; do not attach a second one. See
|
|
272
|
+
[JavaScript script loading](../frameworks/javascript/script-loader.md).
|
|
273
|
+
|
|
274
|
+
## Options
|
|
275
|
+
|
|
276
|
+
Every setting is a string without the `data-` prefix. Setting names use
|
|
277
|
+
lowercase letters, digits and hyphens. Unknown names are forwarded so newer
|
|
278
|
+
tracker settings work.
|
|
279
|
+
|
|
280
|
+
| Option | Behavior |
|
|
281
|
+
| -------------- | ----------------------------------------------------------------------------------------------------------------------------- |
|
|
282
|
+
| `hostname` | Bare host, optionally with a port. Overrides the event hostname on every host, including production. |
|
|
283
|
+
| `devmode` | `'true'` records local visits. Local testing needs `hostname` as well. |
|
|
284
|
+
| `autocollect` | `'false'` turns off automatic page view and click collection. |
|
|
285
|
+
| `hash-routing` | `'true'` tracks hash routes. `'false'` omits the attribute, because the tracker turns hash routing on whenever it is present. |
|
|
286
|
+
| `url` | Custom collection endpoint. |
|
|
287
|
+
|
|
288
|
+
The tracker follows client-side navigation itself. See the
|
|
289
|
+
[vendor reference](https://docs.onedollarstats.com/installation) for its
|
|
290
|
+
settings.
|
|
291
|
+
|
|
292
|
+
## Consent behavior
|
|
293
|
+
|
|
294
|
+
Measurement permission gates the tracker. The tracker installs history hooks
|
|
295
|
+
and event listeners that removing its script cannot undo, so c15t reloads the
|
|
296
|
+
page when a visitor revokes measurement permission. Keep
|
|
297
|
+
`reloadOnConsentRevoked` enabled, and check measurement permission before any
|
|
298
|
+
manual tracking call.
|
|
299
|
+
|
|
300
|
+
## Verify the integration
|
|
301
|
+
|
|
302
|
+
Use a fresh session with an opt-in policy and confirm the tracker is absent.
|
|
303
|
+
Grant `measurement`, navigate between routes and confirm page views arrive. Then
|
|
304
|
+
revoke it, confirm the page reloads, and check that later navigation sends no
|
|
305
|
+
events. Follow the [consent verification guide](../guides/verify-consent.md).
|
|
@@ -198,7 +198,7 @@ clientEntrypoint: fileURLToPath(new URL('./src/c15t.client.ts', import.meta.url)
|
|
|
198
198
|
Export the scripts from that module:
|
|
199
199
|
|
|
200
200
|
```ts title="src/c15t.client.ts"
|
|
201
|
-
import type { C15tClientOptionsExtension } from '
|
|
201
|
+
import type { C15tClientOptionsExtension } from 'c15t/astro';
|
|
202
202
|
import { scripts } from './consent-scripts';
|
|
203
203
|
|
|
204
204
|
export default { scripts } satisfies C15tClientOptionsExtension;
|
|
@@ -61,6 +61,7 @@ kernel to control its DOM lifecycle. Embeds do not require `@c15t/scripts`.
|
|
|
61
61
|
| [Heap](./heap.md) | `heap` | `measurement` | Waits for effective permission |
|
|
62
62
|
| [Matomo Analytics](./matomo-analytics.md) | `matomoAnalytics` | `measurement` | Gated by default; optional consent mode |
|
|
63
63
|
| [Mixpanel](./mixpanel-analytics.md) | `mixpanelAnalytics` | `measurement` | Always loads; calls opt-in and opt-out APIs |
|
|
64
|
+
| [OneDollarStats](./one-dollar-stats.md) | `oneDollarStats` | `measurement` | Waits for effective permission |
|
|
64
65
|
| [Hotjar](./hotjar.md) | `hotjar` | `measurement` | Waits for effective permission |
|
|
65
66
|
| [Hightouch](./hightouch.md) | `hightouch` | `measurement` | Waits for effective permission |
|
|
66
67
|
| [LogRocket](./logrocket.md) | `logRocket` | `measurement` | Waits for effective permission |
|
|
@@ -76,23 +77,25 @@ kernel to control its DOM lifecycle. Embeds do not require `@c15t/scripts`.
|
|
|
76
77
|
|
|
77
78
|
## Functionality
|
|
78
79
|
|
|
79
|
-
| Integration
|
|
80
|
-
|
|
|
81
|
-
| [Crisp](./crisp.md)
|
|
82
|
-
| [
|
|
80
|
+
| Integration | Helper | Category | Loading behavior |
|
|
81
|
+
| ----------------------------- | ----------- | --------------- | ------------------------------ |
|
|
82
|
+
| [Crisp](./crisp.md) | `crisp` | `functionality` | Waits for effective permission |
|
|
83
|
+
| [Front Chat](./front-chat.md) | `frontChat` | `functionality` | Waits for effective permission |
|
|
84
|
+
| [Intercom](./intercom.md) | `intercom` | `functionality` | Waits for effective permission |
|
|
83
85
|
|
|
84
86
|
## Ads and pixels
|
|
85
87
|
|
|
86
|
-
| Integration | Helper | Category | Loading behavior
|
|
87
|
-
| ---------------------------------------------- | ------------------ | ----------- |
|
|
88
|
-
| [Meta Pixel](./meta-pixel.md) | `metaPixel` | `marketing` | Waits for effective permission
|
|
89
|
-
| [OpenAI Pixel](./openai-pixel.md) | `openaiPixel` | `marketing` | Gated initially; retains SDK and signals consent
|
|
90
|
-
| [
|
|
91
|
-
| [
|
|
92
|
-
| [
|
|
93
|
-
| [
|
|
94
|
-
| [
|
|
95
|
-
| [
|
|
88
|
+
| Integration | Helper | Category | Loading behavior |
|
|
89
|
+
| ---------------------------------------------- | ------------------ | ----------- | ---------------------------------------------------- |
|
|
90
|
+
| [Meta Pixel](./meta-pixel.md) | `metaPixel` | `marketing` | Waits for effective permission |
|
|
91
|
+
| [OpenAI Pixel](./openai-pixel.md) | `openaiPixel` | `marketing` | Gated initially; retains SDK and signals consent |
|
|
92
|
+
| [Pinterest Tag](./pinterest-tag.md) | `pinterestTag` | `marketing` | Gated initially; retains the tag and signals consent |
|
|
93
|
+
| [Reddit Pixel](./reddit-pixel.md) | `redditPixel` | `marketing` | Gated initially; retains SDK and switches cookies |
|
|
94
|
+
| [TikTok Pixel](./tiktok-pixel.md) | `tiktokPixel` | `marketing` | Gated initially; retains SDK and signals consent |
|
|
95
|
+
| [LinkedIn Insight Tag](./linkedin-insights.md) | `linkedinInsights` | `marketing` | Waits for effective permission |
|
|
96
|
+
| [Microsoft UET](./microsoft-uet.md) | `microsoftUet` | `marketing` | Always loads; signals ad storage consent |
|
|
97
|
+
| [Snapchat Pixel](./snapchat-pixel.md) | `snapchatPixel` | `marketing` | Waits for effective permission |
|
|
98
|
+
| [X Pixel](./x-pixel.md) | `xPixel` | `marketing` | Waits for effective permission |
|
|
96
99
|
|
|
97
100
|
## Keep one owner per vendor
|
|
98
101
|
|